zeek/testing/btest/core/event-groups/hooks-basic.zeek
Arne Welzel 2ad609cbbb Reintroduce event groups
This started with reverting commit 52cd02173d
and then rewriting it to be per handler rather than handler identifier
and adding support for hooks as well as adding implicit module groups.
2022-10-25 18:03:26 +02:00

33 lines
661 B
Text

# @TEST-DOC: Hooks can be annotated with &group and work.
# @TEST-EXEC: zeek %INPUT > output
# @TEST-EXEC: btest-diff output
global the_hook: hook(c: count);
event zeek_init()
{
hook the_hook(1);
print "=== disable_event_group(my-group1)";
disable_event_group("my-group1");
hook the_hook(2);
}
hook the_hook(c: count)
{
print "the_hook without group", c;
}
hook the_hook(c: count) &group="my-group1"
{
print "the_hook with my-group1", c;
}
hook the_hook(c: count) &group="my-group2"
{
print "the_hook with my-group2", c;
}
hook the_hook(c: count) &group="my-group1" &group="my-group2"
{
print "the_hook with my-group1 and my-group2", c;
}