zeek/testing/btest/plugins/publish-event-hook.zeek
Arne Welzel 5a10772b7d btest: Use Broker for Broker specific tests
Now that Cluster::backend defaults to NONE by default, some tests won't
just work anymore for various reasons (mostly due to the logging
framework not sending log writes to broker anymore).

Load the new frameworks/cluster/backend/broker package for these to keep them
functional. Also add the @load to the common broker/cluster-layout.zeek file
to avoid changing all of the files that use that layout.
2025-09-25 19:29:55 +02:00

25 lines
688 B
Text

# @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
@load frameworks/cluster/backend/broker
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);
}