Skip to content

Commit

Permalink
[Test] Add combined maps tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed May 20, 2019
1 parent c7689ea commit fa772ca
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/functional/cases/102_multimap.robot
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,26 @@ MAP - FROM
${result} = Scan Message With Rspamc ${MESSAGE} --from user@example.com
Check Rspamc ${result} FROM_MAP

MAP - COMBINED IP MASK FROM
${result} = Scan Message With Rspamc ${MESSAGE} -i 10.1.0.10 --from user@example.com
Check Rspamc ${result} COMBINED_MAP_AND
Check Rspamc ${result} COMBINED_MAP_OR

MAP - COMBINED IP MASK ONLY
${result} = Scan Message With Rspamc ${MESSAGE} -i 10.1.0.10
Check Rspamc ${result} COMBINED_MAP_AND inverse=1
Check Rspamc ${result} COMBINED_MAP_OR

MAP - COMBINED FROM ONLY
${result} = Scan Message With Rspamc ${MESSAGE} --from user@example.com
Check Rspamc ${result} COMBINED_MAP_AND inverse=1
Check Rspamc ${result} COMBINED_MAP_OR

MAP - COMBINED MISS
${result} = Scan Message With Rspamc ${MESSAGE} -i 11.1.0.10 --from user@other.com
Check Rspamc ${result} COMBINED_MAP_AND inverse=1
Check Rspamc ${result} COMBINED_MAP_OR inverse=1

MAP - FROM MISS
${result} = Scan Message With Rspamc ${MESSAGE} --from user@other.com
Check Rspamc ${result} FROM_MAP inverse=1
Expand Down
30 changes: 30 additions & 0 deletions test/functional/configs/multimap.conf
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,34 @@ multimap {
map = "${TESTDIR}/configs/maps/rcvd2.list";
flags = ["authenticated", "ssl"];
}
COMBINED_MAP_AND {
type = "combined";
rules {
ip = {
type = "radix";
map = "${TESTDIR}/configs/maps/ip.list";
selector = "ip";
}
from {
map = "${TESTDIR}/configs/maps/domains.list";
selector = "from:domain";
}
}
expression = "from & ip"
}
COMBINED_MAP_OR {
type = "combined";
rules {
ip = {
type = "radix";
map = "${TESTDIR}/configs/maps/ip.list";
selector = "ip";
}
from {
map = "${TESTDIR}/configs/maps/domains.list";
selector = "from:domain";
}
}
expression = "from || ip"
}
}

0 comments on commit fa772ca

Please sign in to comment.