mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Improve control framework id-update/test output
This commit is contained in:
parent
d245513e0a
commit
6215d45f10
2 changed files with 19 additions and 4 deletions
|
@ -126,14 +126,17 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) &priority=
|
|||
{
|
||||
# Send all &redef'able consts to the peer.
|
||||
local ids = configurable_ids();
|
||||
local publish_count = 0;
|
||||
|
||||
for ( id in ids )
|
||||
{
|
||||
local topic = fmt("%s/id/%s", Control::topic_prefix, id);
|
||||
Broker::publish_id(topic, id);
|
||||
|
||||
if ( Broker::publish_id(topic, id) )
|
||||
++publish_count;
|
||||
}
|
||||
|
||||
Reporter::info(fmt("Control framework sent %d IDs", |ids|));
|
||||
Reporter::info(fmt("Control framework sent %d IDs", publish_count));
|
||||
}
|
||||
|
||||
send_control_request();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# @TEST-SERIALIZE: comm
|
||||
#
|
||||
# @TEST-EXEC: btest-bg-run controllee BROPATH=$BROPATH:.. bro %INPUT frameworks/control/controllee Broker::default_port=65531/tcp
|
||||
# @TEST-EXEC: btest-bg-run controller BROPATH=$BROPATH:.. bro %INPUT test-redef frameworks/control/controller Control::host=127.0.0.1 Control::host_port=65531/tcp Control::cmd=configuration_update
|
||||
# @TEST-EXEC: btest-bg-run controllee BROPATH=$BROPATH:.. bro -Bbroker %INPUT frameworks/control/controllee Broker::default_port=65531/tcp
|
||||
# @TEST-EXEC: btest-bg-run controller BROPATH=$BROPATH:.. bro -Bbroker %INPUT test-redef frameworks/control/controller Control::host=127.0.0.1 Control::host_port=65531/tcp Control::cmd=configuration_update
|
||||
# @TEST-EXEC: btest-bg-wait 10
|
||||
# @TEST-EXEC: btest-diff controllee/.stdout
|
||||
|
||||
|
@ -18,14 +18,26 @@ redef test_var = "NEW VALUE (this should be printed out second)";
|
|||
event bro_init()
|
||||
{
|
||||
print test_var;
|
||||
Reporter::info("handle bro_init");
|
||||
}
|
||||
|
||||
event bro_done()
|
||||
{
|
||||
print test_var;
|
||||
Reporter::info("handle bro_done");
|
||||
}
|
||||
|
||||
event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||
{
|
||||
terminate();
|
||||
}
|
||||
|
||||
event Control::configuration_update_request()
|
||||
{
|
||||
Reporter::info("handle Control::configuration_update_request");
|
||||
}
|
||||
|
||||
event Control::configuration_update_response()
|
||||
{
|
||||
Reporter::info("handle Control::configuration_update_response");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue