mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08:20 +00:00
btest/plugin: Test for PublishEventHook()
This commit is contained in:
parent
53236a184a
commit
0bf3417d4c
5 changed files with 142 additions and 0 deletions
24
testing/btest/plugins/publish-event-hook.zeek
Normal file
24
testing/btest/plugins/publish-event-hook.zeek
Normal file
|
@ -0,0 +1,24 @@
|
|||
# @TEST-EXEC: ${DIST}/auxil/zeek-aux/plugin-support/init-plugin -u . Demo PublishEvent
|
||||
# @TEST-EXEC: cp -r %DIR/publish-event-hook-plugin/* .
|
||||
# @TEST-EXEC: ./configure --zeek-dist=${DIST} && make
|
||||
# @TEST-EXEC: ZEEK_PLUGIN_PATH=`pwd` zeek -b Demo::PublishEvent %INPUT > output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
redef allow_network_time_forward = F;
|
||||
|
||||
|
||||
module App;
|
||||
|
||||
export {
|
||||
global test_event: event(c: count);
|
||||
|
||||
global topic: string = "/test/topic";
|
||||
|
||||
global do_not_publish_topic: string = "/do/not/publish";
|
||||
}
|
||||
|
||||
event zeek_init() &priority=10
|
||||
{
|
||||
Cluster::publish(topic, test_event, 42);
|
||||
Cluster::publish(do_not_publish_topic, test_event, 9999);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue