From 328e663060e408828f30a4af2829ccec6e71d824 Mon Sep 17 00:00:00 2001 From: Christian Kreibich Date: Fri, 13 May 2022 15:50:52 -0700 Subject: [PATCH] Management framework: update agent-checkin test to reflect recent changes This keeps logs produced locally and without rotation, and adopts the simpler stdout/sterr file naming. --- ...ntroller.stdout => zeek.nodes.controller.stdout} | 0 .../management/controller/agent-checkin.zeek | 13 ++++++------- 2 files changed, 6 insertions(+), 7 deletions(-) rename testing/btest/Baseline/scripts.policy.frameworks.management.controller.agent-checkin/{zeek.controller.stdout => zeek.nodes.controller.stdout} (100%) 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.