mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +00:00

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.
49 lines
928 B
Text
49 lines
928 B
Text
# @TEST-DOC: Very basic testing of event groups for modules. The MyModule event group is disabled.
|
|
# @TEST-EXEC: zeek %INPUT > output
|
|
# @TEST-EXEC: btest-diff output
|
|
|
|
module MyModule;
|
|
|
|
event zeek_done()
|
|
{
|
|
print "FAIL: zeek_done within MyModule";
|
|
}
|
|
|
|
module My::Nested::Module;
|
|
|
|
event zeek_done()
|
|
{
|
|
print "FAIL: zeek_done within My::Nested::Module";
|
|
}
|
|
|
|
module MyOtherModule;
|
|
|
|
event zeek_done()
|
|
{
|
|
print "zeek_done within MyOtherModule";
|
|
}
|
|
|
|
event zeek_done() &group="MyModule"
|
|
{
|
|
# continues to run because &group="MyModule" isn't the same
|
|
# as the "MyModule" module group.
|
|
print "zeek_done within MyOtherModule (&group=MyModule)";
|
|
}
|
|
|
|
module GLOBAL;
|
|
|
|
event zeek_init()
|
|
{
|
|
print "zeek_init";
|
|
|
|
disable_module_events("MyModule");
|
|
disable_module_events("My::Nested::Module");
|
|
}
|
|
|
|
# Re-open the MyModule module here once more.
|
|
module MyModule;
|
|
|
|
event zeek_done()
|
|
{
|
|
print "FAIL: Another zeek_done() within MyModule";
|
|
}
|