mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
btest/control: Use Broker explicitly
At least the control/controller script looks as if it always intended to peer with just one node in a cluster using Broker. The controllee script will start listening for such connections if the selected backend is actually Broker, so explicitly switch to that here.
This commit is contained in:
parent
2f89d59aa5
commit
777a05fd0d
5 changed files with 13 additions and 0 deletions
|
@ -13,6 +13,9 @@ const test_var = "ORIGINAL VALUE (this should be printed out first)" &redef;
|
||||||
redef test_var = "NEW VALUE (this should be printed out second)";
|
redef test_var = "NEW VALUE (this should be printed out second)";
|
||||||
# @TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
|
# This ensures the controllee script starts listening using Broker.
|
||||||
|
redef Cluster::backend = Cluster::CLUSTER_BACKEND_BROKER;
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
print test_var;
|
print test_var;
|
||||||
|
|
|
@ -20,6 +20,9 @@ const test_var = "Original value" &redef;
|
||||||
redef test_var = "This is the value from the controllee";
|
redef test_var = "This is the value from the controllee";
|
||||||
# @TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
|
# This ensures the controllee script starts listening using Broker.
|
||||||
|
redef Cluster::backend = Cluster::CLUSTER_BACKEND_BROKER;
|
||||||
|
|
||||||
event Control::id_value_response(id: string, val: string)
|
event Control::id_value_response(id: string, val: string)
|
||||||
{
|
{
|
||||||
print fmt("Got an id_value_response(%s, %s) event", id, val);
|
print fmt("Got an id_value_response(%s, %s) event", id, val);
|
||||||
|
|
|
@ -4,3 +4,5 @@
|
||||||
# @TEST-EXEC: btest-bg-run controller ZEEKPATH=$ZEEKPATH:.. zeek -b %INPUT frameworks/control/controller Control::host=127.0.0.1 Control::host_port=$BROKER_PORT Control::cmd=shutdown
|
# @TEST-EXEC: btest-bg-run controller ZEEKPATH=$ZEEKPATH:.. zeek -b %INPUT frameworks/control/controller Control::host=127.0.0.1 Control::host_port=$BROKER_PORT Control::cmd=shutdown
|
||||||
# @TEST-EXEC: btest-bg-wait 20
|
# @TEST-EXEC: btest-bg-wait 20
|
||||||
|
|
||||||
|
# This ensures the controllee script starts listening using Broker.
|
||||||
|
redef Cluster::backend = Cluster::CLUSTER_BACKEND_BROKER;
|
||||||
|
|
|
@ -38,6 +38,9 @@ redef Log::max_log_record_size = 1024 * 1024;
|
||||||
|
|
||||||
redef Broker::disable_ssl = T;
|
redef Broker::disable_ssl = T;
|
||||||
|
|
||||||
|
# Pass log record from logging manager to broker.
|
||||||
|
redef Cluster::backend = Cluster::CLUSTER_BACKEND_BROKER;
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
Log::create_stream(LOG, [$columns=Info, $path="test"]);
|
Log::create_stream(LOG, [$columns=Info, $path="test"]);
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
# @TEST-EXEC: btest-diff manager/services.out
|
# @TEST-EXEC: btest-diff manager/services.out
|
||||||
|
|
||||||
# @TEST-START-FILE cluster-layout.zeek
|
# @TEST-START-FILE cluster-layout.zeek
|
||||||
|
redef Cluster::backend = Cluster::CLUSTER_BACKEND_BROKER;
|
||||||
|
|
||||||
redef Cluster::nodes = {
|
redef Cluster::nodes = {
|
||||||
["manager"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_MANAGER_PORT")), $metrics_port=to_port(getenv("METRICS_PORT1"))],
|
["manager"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_MANAGER_PORT")), $metrics_port=to_port(getenv("METRICS_PORT1"))],
|
||||||
["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_LOGGER1_PORT")), $manager="manager", $metrics_port=to_port(getenv("METRICS_PORT2"))],
|
["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_LOGGER1_PORT")), $manager="manager", $metrics_port=to_port(getenv("METRICS_PORT2"))],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue