aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2019-01-25 11:00:59 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2019-01-25 11:00:59 +0300
commit41dab157a0787100773f672c74cf46ac7a5bd9fa (patch)
treef18ff6aadb089e11c6c94261838ea684ff9e68e5 /test
parentdd55b866e77be19e5a61b7abfcbd890d807839fd (diff)
downloadrspamd-41dab157a0787100773f672c74cf46ac7a5bd9fa.tar.gz
rspamd-41dab157a0787100773f672c74cf46ac7a5bd9fa.zip
[Test] Add tests for mime_types
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/105_mimetypes.robot10
-rw-r--r--test/functional/messages/next2last-digits_in_brackets.eml9
-rw-r--r--test/functional/messages/next2last-digits_in_parens.eml9
3 files changed, 28 insertions, 0 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/next2last-digits_in_brackets.eml b/test/functional/messages/next2last-digits_in_brackets.eml
new file mode 100644
index 000000000..9f2783213
--- /dev/null
+++ b/test/functional/messages/next2last-digits_in_brackets.eml
@@ -0,0 +1,9 @@
+Content-Type: multipart/mixed; boundary="------------D6BBFC1853527FEEDD26DC71"
+
+--------------D6BBFC1853527FEEDD26DC71
+Content-Type: application/x-msi; name="PDF417(3.2.4).msi"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment; filename="PDF417(3.2.4).msi"
+
+MAo=
+--------------D6BBFC1853527FEEDD26DC71--
diff --git a/test/functional/messages/next2last-digits_in_parens.eml b/test/functional/messages/next2last-digits_in_parens.eml
new file mode 100644
index 000000000..efa90fa4c
--- /dev/null
+++ b/test/functional/messages/next2last-digits_in_parens.eml
@@ -0,0 +1,9 @@
+Content-Type: multipart/mixed; boundary="------------D6BBFC1853527FEEDD26DC71"
+
+--------------D6BBFC1853527FEEDD26DC71
+Content-Type: application/x-msi; name="PDF417(3.2.4).msi"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment; filename="PDF417[3.2.4].msi"
+
+MAo=
+--------------D6BBFC1853527FEEDD26DC71--