mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
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.
This commit is contained in:
parent
93ea03a081
commit
328e663060
2 changed files with 6 additions and 7 deletions
|
@ -1,16 +1,15 @@
|
||||||
# This test verifies basic agent-controller communication in the Management
|
# This test verifies basic agent-controller communication in the Management
|
||||||
# framework. We launch agent and controller via the supervisor, add an extra
|
# framework. We launch agent and controller via the supervisor, add an extra
|
||||||
# handler for the notify_agent_hello event that travels agent -> controller, and
|
# 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: ZEEK_CONTROLLER_PORT
|
||||||
# @TEST-PORT: BROKER_PORT
|
# @TEST-PORT: BROKER_PORT
|
||||||
|
|
||||||
# A bit of a detour to get the port number into the agent configuration
|
# @TEST-EXEC: ZEEK_MANAGEMENT_TESTING=1 btest-bg-run zeek zeek -j %INPUT
|
||||||
# @TEST-EXEC: btest-bg-run zeek zeek -j %INPUT
|
|
||||||
# @TEST-EXEC: btest-bg-wait 10
|
# @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/agent
|
||||||
@load policy/frameworks/management/controller
|
@load policy/frameworks/management/controller
|
||||||
|
@ -34,7 +33,7 @@ event zeek_init()
|
||||||
# We're using the controller to shut everything down once the
|
# We're using the controller to shut everything down once the
|
||||||
# notify_agent_hello event has arrived. The controller doesn't normally
|
# notify_agent_hello event has arrived. The controller doesn't normally
|
||||||
# talk to the supervisor, so connect to it.
|
# 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::peer(getenv("ZEEK_DEFAULT_LISTEN_ADDRESS"), Broker::default_port, Broker::default_listen_retry);
|
||||||
Broker::auto_publish(SupervisorControl::topic_prefix, SupervisorControl::stop_request);
|
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)
|
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
|
# On rare occasion it can happen that we log this twice, which'll need
|
||||||
# investigating. For now we ensure we only do so once.
|
# investigating. For now we ensure we only do so once.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue