Expand the tests, and have email_admin email src contacts in one e-mail, and dst contacts in another.

This commit is contained in:
Vlad Grigorescu 2021-06-17 14:49:24 -05:00
parent 9d0bd96e1f
commit 9d1e9a20e4
4 changed files with 38 additions and 12 deletions

View file

@ -1,5 +1,6 @@
# @TEST-EXEC: zeek -b %INPUT
# @TEST-EXEC: btest-diff sendmail.out
# @TEST-EXEC: btest-diff notice.log
@load base/frameworks/notice
@load base/utils/site
@ -7,7 +8,10 @@
redef Notice::mail_dest = "user@example.net";
redef Notice::sendmail = "fake-sendmail";
redef Site::local_admins += { [1.0.0.0/8] = set("cloudflare@example.net", "postmaster@the.cloud") };
redef Site::local_admins += {
[1.0.0.0/8] = set("cloudflare@example.net", "postmaster@the.cloud"),
[2.0.0.0/8] = set("2_dot@example.net"),
};
redef enum Notice::Type += {
Test_Notice,
@ -15,7 +19,7 @@ redef enum Notice::Type += {
event zeek_init()
{
NOTICE([$note=Test_Notice, $msg="test", $identifier="static", $src=1.1.1.1, $dst=[::1]]);
NOTICE([$note=Test_Notice, $msg="test", $identifier="static", $src=1.1.1.1, $dst=2.2.2.2]);
}
hook Notice::policy(n: Notice::Info) &priority=1