diff --git a/testing/btest/Baseline/scripts.policy.frameworks.management.controller.agent-checkin/zeek.controller.stdout b/testing/btest/Baseline/scripts.policy.frameworks.management.controller.agent-checkin/zeek.nodes.controller.stdout similarity index 100% rename from testing/btest/Baseline/scripts.policy.frameworks.management.controller.agent-checkin/zeek.controller.stdout rename to testing/btest/Baseline/scripts.policy.frameworks.management.controller.agent-checkin/zeek.nodes.controller.stdout diff --git a/testing/btest/scripts/policy/frameworks/management/controller/agent-checkin.zeek b/testing/btest/scripts/policy/frameworks/management/controller/agent-checkin.zeek index ecdc3b17ed..3d248848c7 100644 --- a/testing/btest/scripts/policy/frameworks/management/controller/agent-checkin.zeek +++ b/testing/btest/scripts/policy/frameworks/management/controller/agent-checkin.zeek @@ -1,16 +1,15 @@ # This test verifies basic agent-controller communication in the Management # framework. We launch agent and controller via the supervisor, add an extra # handler for the notify_agent_hello event that travels agent -> controller, and -# verify its print output in the controller's stdout log. +# verify that it prints receipt of the event to stdout. -# The following env vars is known to the controller framework +# The following environment variables are known to the controller framework: # @TEST-PORT: ZEEK_CONTROLLER_PORT # @TEST-PORT: BROKER_PORT -# A bit of a detour to get the port number into the agent configuration -# @TEST-EXEC: btest-bg-run zeek zeek -j %INPUT +# @TEST-EXEC: ZEEK_MANAGEMENT_TESTING=1 btest-bg-run zeek zeek -j %INPUT # @TEST-EXEC: btest-bg-wait 10 -# @TEST-EXEC: btest-diff zeek/controller.stdout +# @TEST-EXEC: btest-diff zeek/nodes/controller/stdout @load policy/frameworks/management/agent @load policy/frameworks/management/controller @@ -34,7 +33,7 @@ event zeek_init() # We're using the controller to shut everything down once the # notify_agent_hello event has arrived. The controller doesn't normally # talk to the supervisor, so connect to it. - if ( Supervisor::node()$name == "controller" ) + if ( Management::role == Management::CONTROLLER ) { Broker::peer(getenv("ZEEK_DEFAULT_LISTEN_ADDRESS"), Broker::default_port, Broker::default_listen_retry); Broker::auto_publish(SupervisorControl::topic_prefix, SupervisorControl::stop_request); @@ -43,7 +42,7 @@ event zeek_init() event Management::Agent::API::notify_agent_hello(instance: string, host: addr, api_version: count) { - if ( Supervisor::node()$name == "controller" ) + if ( Management::role == Management::CONTROLLER ) { # On rare occasion it can happen that we log this twice, which'll need # investigating. For now we ensure we only do so once.