]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Add a simple test for zerofont
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Jun 2018 13:46:29 +0000 (14:46 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Jun 2018 13:46:29 +0000 (14:46 +0100)
test/functional/cases/100_general.robot
test/functional/messages/zerofont.eml [new file with mode: 0644]

index 31d82c4f896e370943b54ff5149cf93ddcf3e6d3..63ebe1946bf43d55f94dbd81258607d4719f365a 100644 (file)
@@ -46,3 +46,9 @@ EMAILS DETECTION 1
   Check Rspamc  ${result}  "jim@example.net"
   Should Contain  ${result.stdout}  "bob@example.net"
   Should Contain  ${result.stdout}  "rupert@example.net"
+
+EMAILS DETECTION ZEROFONT
+  ${result} =  Scan File  ${LOCAL_ADDR}  ${PORT_NORMAL}  ${TESTDIR}/messages/zerofont.eml
+  Follow Rspamd Log
+  Should Contain  ${result}  MANY_INVISIBLE_PARTS
+  Should Contain  ${result}  ZERO_FONT
\ No newline at end of file
diff --git a/test/functional/messages/zerofont.eml b/test/functional/messages/zerofont.eml
new file mode 100644 (file)
index 0000000..79fa5ed
--- /dev/null
@@ -0,0 +1,17 @@
+From: foobar@example.com
+Content-Type: text/html
+
+<!doctype html>
+<html lang="en-US" dir="ltr">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="Content-Security-Policy-Report-Only" content="script-src 'unsafe-inline'; img-src http: https: data: blob:; style-src 'unsafe-inline'; child-src 'none'; object-src 'none'; report-uri https://tiles.services.mozilla.com/v4/links/activity-stream/csp">
+    <title>New Tab</title>
+    <link rel="icon" type="image/png" href="chrome://branding/content/icon32.png"/>
+    <link rel="stylesheet" href="chrome://browser/content/contentSearchUI.css" />
+    <link rel="stylesheet" href="resource://activity-stream/css/activity-stream.css" />
+  </head>
+  <body class="activity-stream">
+    <div>fi<span style="FONT-SIZE: 0px">le </span>sh<span style="FONT-SIZE: 0px">aring </span></div>
+  </body>
+</html>