diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-12-08 15:11:16 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-12-08 15:11:16 +0200 |
commit | ae72c0999e2440a460cccf339249b8a0af89275f (patch) | |
tree | 13ee4fc64c5e27f8c194cabd51957994f5258cc9 /test/functional | |
parent | 6e25c8c70e789b78b0d2e725695f2818c5f7f0d1 (diff) | |
download | rspamd-ae72c0999e2440a460cccf339249b8a0af89275f.tar.gz rspamd-ae72c0999e2440a460cccf339249b8a0af89275f.zip |
[Test] Multimap received header flags
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/cases/102_multimap.robot | 16 | ||||
-rw-r--r-- | test/functional/configs/maps/rcvd2.list | 2 | ||||
-rw-r--r-- | test/functional/configs/multimap.conf | 11 | ||||
-rw-r--r-- | test/functional/messages/received3.eml | 16 | ||||
-rw-r--r-- | test/functional/messages/received4.eml | 16 |
5 files changed, 59 insertions, 2 deletions
diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot index 977a84991..dff28d7f2 100644 --- a/test/functional/cases/102_multimap.robot +++ b/test/functional/cases/102_multimap.robot @@ -13,6 +13,8 @@ ${REDIS_SCOPE} Suite ${RSPAMD_SCOPE} Suite ${RCVD1} ${TESTDIR}/messages/received1.eml ${RCVD2} ${TESTDIR}/messages/received2.eml +${RCVD3} ${TESTDIR}/messages/received3.eml +${RCVD4} ${TESTDIR}/messages/received4.eml ${URL1} ${TESTDIR}/messages/url1.eml ${URL2} ${TESTDIR}/messages/url2.eml ${URL3} ${TESTDIR}/messages/url3.eml @@ -261,16 +263,26 @@ MAP - RECEIVED - IP MINMAX POS - ONE Check Rspamc ${result} RCVD_TEST_01 Check Rspamc ${result} RCVD_TEST_02 inverse=1 -MAP - RECEIVED - IP MINMAX POS - TWO +MAP - RECEIVED - IP MINMAX POS - TWO / RCVD_AUTHED_ONE HIT ${result} = Scan Message With Rspamc ${RCVD2} Check Rspamc ${result} RCVD_TEST_02 - Check Rspamc ${result} RCVD_TEST_01 inverse=1 + Should Not Contain ${result.stdout} RCVD_TEST_01 + Should Contain ${result.stdout} RCVD_AUTHED_ONE MAP - RECEIVED - REDIS Redis HSET RCVD_TEST 2a01:7c8:aab6:26d:5054:ff:fed1:1da2 ${EMPTY} ${result} = Scan Message With Rspamc ${RCVD1} Check Rspamc ${result} RCVD_TEST_REDIS_01 +RCVD_AUTHED_ONE & RCVD_AUTHED_TWO - MISS + ${result} = Scan Message With Rspamc ${RCVD3} + Check Rspamc ${result} RCVD_AUTHED_ inverse=1 + +RCVD_AUTHED_TWO HIT / RCVD_AUTHED_ONE MISS + ${result} = Scan Message With Rspamc ${RCVD4} + Check Rspamc ${result} RCVD_AUTHED_TWO + Should Not Contain ${result.stdout} RCVD_AUTHED_ONE + *** Keywords *** Multimap Setup ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/multimap.conf diff --git a/test/functional/configs/maps/rcvd2.list b/test/functional/configs/maps/rcvd2.list new file mode 100644 index 000000000..97dba5b6f --- /dev/null +++ b/test/functional/configs/maps/rcvd2.list @@ -0,0 +1,2 @@ +151.18.193.131 + diff --git a/test/functional/configs/multimap.conf b/test/functional/configs/multimap.conf index 1c262a287..68a2118f7 100644 --- a/test/functional/configs/multimap.conf +++ b/test/functional/configs/multimap.conf @@ -136,4 +136,15 @@ multimap { type = "received"; map = "redis://RCVD_TEST"; } + RCVD_AUTHED_ONE { + type = "received"; + map = "${TESTDIR}/configs/maps/rcvd2.list"; + flags = ["authenticated"]; + nflags = ["ssl"]; + } + RCVD_AUTHED_TWO { + type = "received"; + map = "${TESTDIR}/configs/maps/rcvd2.list"; + flags = ["authenticated", "ssl"]; + } } diff --git a/test/functional/messages/received3.eml b/test/functional/messages/received3.eml new file mode 100644 index 000000000..9fea8eeaf --- /dev/null +++ b/test/functional/messages/received3.eml @@ -0,0 +1,16 @@ +Received: apparently
+Received: or is it
+Received: from server.chat-met-vreemden.nl (unknown [IPv6:2a01:7c8:aab6:26d:5054:ff:fed1:1da2])
+ (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
+ (Client did not present a certificate)
+ by mx1.freebsd.org (Postfix) with ESMTPS id CF0171862
+ for <test@example.com>; Mon, 6 Jul 2015 09:01:20 +0000 (UTC)
+ (envelope-from upwest201diana@outlook.com)
+Received: from ca-18-193-131.service.infuturo.it ([151.18.193.131] helo=User)
+ by server.chat-met-vreemden.nl with esmtp (Exim 4.76)
+ (envelope-from <upwest201diana@outlook.com>)
+ id 1ZC1sl-0006b4-TU; Mon, 06 Jul 2015 10:36:08 +0200
+MIME-Version: 1.0
+Content-Type: text/plain
+
+Hello
diff --git a/test/functional/messages/received4.eml b/test/functional/messages/received4.eml new file mode 100644 index 000000000..d34ebb1be --- /dev/null +++ b/test/functional/messages/received4.eml @@ -0,0 +1,16 @@ +Received: apparently
+Received: or is it
+Received: from server.chat-met-vreemden.nl (unknown [IPv6:2a01:7c8:aab6:26d:5054:ff:fed1:1da2])
+ (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
+ (Client did not present a certificate)
+ by mx1.freebsd.org (Postfix) with ESMTPS id CF0171862
+ for <test@example.com>; Mon, 6 Jul 2015 09:01:20 +0000 (UTC)
+ (envelope-from upwest201diana@outlook.com)
+Received: from ca-18-193-131.service.infuturo.it ([151.18.193.131] helo=User)
+ by server.chat-met-vreemden.nl with esmtpsa (Exim 4.76)
+ (envelope-from <upwest201diana@outlook.com>)
+ id 1ZC1sl-0006b4-TU; Mon, 06 Jul 2015 10:36:08 +0200
+MIME-Version: 1.0
+Content-Type: text/plain
+
+Hello
|