commit 41dab15: [Test] Add tests for mime_types

Alexander Moisseev moiseev at mezonplus.ru
Fri Jan 25 20:35:07 UTC 2019


Author: Alexander Moisseev
Date: 2019-01-25 11:00:59 +0300
URL: https://github.com/rspamd/rspamd/commit/41dab157a0787100773f672c74cf46ac7a5bd9fa (refs/pull/2731/head)

[Test] Add tests for mime_types

---
 test/functional/cases/105_mimetypes.robot                      | 10 ++++++++++
 ...t.dotted_file_name.eml => next2last-digits_in_brackets.eml} |  4 ++--
 ...ext.dotted_file_name.eml => next2last-digits_in_parens.eml} |  4 ++--
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/test/functional/cases/105_mimetypes.robot b/test/functional/cases/105_mimetypes.robot
index 49c5ffc67..54a9cb4bb 100644
--- a/test/functional/cases/105_mimetypes.robot
+++ b/test/functional/cases/105_mimetypes.robot
@@ -33,6 +33,16 @@ Dotted file name is followed by Bad Extension
   Check Rspamc  ${result}  MIME_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[exe\\]\\n  re=1
   Should Not Contain  ${result.stdout}  MIME_DOUBLE_BAD_EXTENSION
 
+Dotted numbers in parentheses is followed by Bad Extension
+  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/next2last-digits_in_parens.eml
+  Check Rspamc  ${result}  MIME_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[msi\\]\\n  re=1
+  Should Not Contain  ${result.stdout}  MIME_DOUBLE_BAD_EXTENSION
+
+Dotted numbers in square brackets is followed by Bad Extension
+  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/next2last-digits_in_brackets.eml
+  Check Rspamc  ${result}  MIME_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[msi\\]\\n  re=1
+  Should Not Contain  ${result.stdout}  MIME_DOUBLE_BAD_EXTENSION
+
 Rar4
   ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/rar4.eml
   Check Rspamc  ${result}  MIME_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[exe\\]\\n  re=1
diff --git a/test/functional/messages/bad_ext.dotted_file_name.eml b/test/functional/messages/next2last-digits_in_brackets.eml
similarity index 57%
copy from test/functional/messages/bad_ext.dotted_file_name.eml
copy to test/functional/messages/next2last-digits_in_brackets.eml
index a12510635..9f2783213 100644
--- a/test/functional/messages/bad_ext.dotted_file_name.eml
+++ b/test/functional/messages/next2last-digits_in_brackets.eml
@@ -1,9 +1,9 @@
 Content-Type: multipart/mixed; boundary="------------D6BBFC1853527FEEDD26DC71"
 
 --------------D6BBFC1853527FEEDD26DC71
-Content-Type: application/x-msdownload; name="bad_ext.dotted_file_name.exe"
+Content-Type: application/x-msi; name="PDF417(3.2.4).msi"
 Content-Transfer-Encoding: base64
-Content-Disposition: attachment; filename="bad_ext.dotted_file_name.exe"
+Content-Disposition: attachment; filename="PDF417(3.2.4).msi"
 
 MAo=
 --------------D6BBFC1853527FEEDD26DC71--
diff --git a/test/functional/messages/bad_ext.dotted_file_name.eml b/test/functional/messages/next2last-digits_in_parens.eml
similarity index 57%
copy from test/functional/messages/bad_ext.dotted_file_name.eml
copy to test/functional/messages/next2last-digits_in_parens.eml
index a12510635..efa90fa4c 100644
--- a/test/functional/messages/bad_ext.dotted_file_name.eml
+++ b/test/functional/messages/next2last-digits_in_parens.eml
@@ -1,9 +1,9 @@
 Content-Type: multipart/mixed; boundary="------------D6BBFC1853527FEEDD26DC71"
 
 --------------D6BBFC1853527FEEDD26DC71
-Content-Type: application/x-msdownload; name="bad_ext.dotted_file_name.exe"
+Content-Type: application/x-msi; name="PDF417(3.2.4).msi"
 Content-Transfer-Encoding: base64
-Content-Disposition: attachment; filename="bad_ext.dotted_file_name.exe"
+Content-Disposition: attachment; filename="PDF417[3.2.4].msi"
 
 MAo=
 --------------D6BBFC1853527FEEDD26DC71--


More information about the Commits mailing list