Tweaking notice suppression disable and notice policy order tests.

They should be less sensitive to script-layer changes now.
This commit is contained in:
Jon Siwek 2011-10-14 10:47:32 -05:00
parent d84de52ee0
commit 556b88e322
4 changed files with 21 additions and 23 deletions

View file

@ -1,4 +1,10 @@
# This test checks that the default notice policy ordering is the same
# as a known baseline.
# This test checks that the default notice policy ordering does not
# change from run to run.
# @TEST-EXEC: bro -e ''
# @TEST-EXEC: btest-diff notice_policy.log
# @TEST-EXEC: mv notice_policy.log notice_policy.log.1
# @TEST-EXEC: bro -e ''
# @TEST-EXEC: mv notice_policy.log notice_policy.log.2
# @TEST-EXEC: bro -e ''
# @TEST-EXEC: mv notice_policy.log notice_policy.log.3
# @TEST-EXEC: diff notice_policy.log.1 notice_policy.log.2
# @TEST-EXEC: diff notice_policy.log.1 notice_policy.log.3

View file

@ -1,5 +1,6 @@
# @TEST-EXEC: bro -b %INPUT
# @TEST-EXEC: btest-diff notice.log
# The "Test_Notice" should be logged twice
# @TEST-EXEC: test `grep Test_Notice notice.log | wc -l` -eq 2
@load base/frameworks/notice
@ -9,8 +10,16 @@ redef enum Notice::Type += {
redef Notice::not_suppressed_types += { Test_Notice };
# The second notice needs to be scheduled due to how the notice framework
# uses the event queue.
event second_notice()
{
NOTICE([$note=Test_Notice, $msg="another test", $identifier="static"]);
}
event bro_init()
{
NOTICE([$note=Test_Notice, $msg="test", $identifier="static"]);
NOTICE([$note=Test_Notice, $msg="another test", $identifier="static"]);
}
schedule 1msec { second_notice() };
}