From: Alexander Moisseev Date: Fri, 25 Jan 2019 08:00:59 +0000 (+0300) Subject: [Test] Add tests for mime_types X-Git-Tag: 1.9.0~253^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=41dab157a0787100773f672c74cf46ac7a5bd9fa;p=rspamd.git [Test] Add tests for mime_types --- 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--