mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Tighten the scripts.base.frameworks.logging.hooks test
This avoids interference from other log streams in the policy hook test cases, which could cause deviations in output vs baselines depending on build configuration.
This commit is contained in:
parent
b5c8421ac2
commit
f8dbf70e3b
2 changed files with 4 additions and 4 deletions
|
@ -5,4 +5,3 @@ foo
|
||||||
Log::log_stream_policy
|
Log::log_stream_policy
|
||||||
bar
|
bar
|
||||||
bar
|
bar
|
||||||
Log::log_stream_policy
|
|
||||||
|
|
|
@ -237,12 +237,12 @@ global output = open("output");
|
||||||
|
|
||||||
hook Log::log_stream_policy(rec: any, id: Log::ID)
|
hook Log::log_stream_policy(rec: any, id: Log::ID)
|
||||||
{
|
{
|
||||||
print output, "Log::log_stream_policy";
|
|
||||||
|
|
||||||
if ( id == Test::LOG )
|
if ( id == Test::LOG )
|
||||||
{
|
{
|
||||||
local r: Test::Info = rec;
|
local r: Test::Info = rec;
|
||||||
|
|
||||||
|
print output, "Log::log_stream_policy";
|
||||||
|
|
||||||
if ( r$status == "foo" )
|
if ( r$status == "foo" )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,8 @@ hook Test::log_policy(rec: Test::Info, id: Log::ID, filter: Log::Filter)
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local filter: Log::Filter = [$name="other"];
|
# An unrelated filter whose log we ignore:
|
||||||
|
local filter: Log::Filter = [$name="yetanother", $path="yetanother"];
|
||||||
Log::add_filter(Test::LOG, filter);
|
Log::add_filter(Test::LOG, filter);
|
||||||
|
|
||||||
Log::write(Test::LOG, [$t=network_time(), $status="foo"]);
|
Log::write(Test::LOG, [$t=network_time(), $status="foo"]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue