mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
btest/frameworks/config: Use generic cluster-layout.zeek
This commit is contained in:
parent
f9ff396acf
commit
e114b0e371
9 changed files with 30 additions and 48 deletions
|
@ -1,27 +1,21 @@
|
||||||
# @TEST-PORT: BROKER_PORT1
|
# @TEST-PORT: BROKER_MANAGER_PORT
|
||||||
# @TEST-PORT: BROKER_PORT2
|
# @TEST-PORT: BROKER_WORKER1_PORT
|
||||||
# @TEST-PORT: BROKER_PORT3
|
# @TEST-PORT: BROKER_WORKER2_PORT
|
||||||
#
|
#
|
||||||
# @TEST-EXEC: btest-bg-run manager-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=manager-1 zeek -b %INPUT
|
# @TEST-EXEC: cp $FILES/broker/cluster-layout.zeek .
|
||||||
|
#
|
||||||
|
# @TEST-EXEC: btest-bg-run manager ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=manager zeek -b %INPUT
|
||||||
# @TEST-EXEC: btest-bg-run worker-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-1 zeek -b %INPUT
|
# @TEST-EXEC: btest-bg-run worker-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-1 zeek -b %INPUT
|
||||||
# @TEST-EXEC: btest-bg-run worker-2 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-2 zeek -b %INPUT
|
# @TEST-EXEC: btest-bg-run worker-2 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-2 zeek -b %INPUT
|
||||||
# @TEST-EXEC: btest-bg-wait 45
|
# @TEST-EXEC: btest-bg-wait 45
|
||||||
# @TEST-EXEC: btest-diff manager-1/.stdout
|
# @TEST-EXEC: btest-diff manager/.stdout
|
||||||
# @TEST-EXEC: btest-diff worker-1/.stdout
|
# @TEST-EXEC: btest-diff worker-1/.stdout
|
||||||
# @TEST-EXEC: btest-diff worker-2/.stdout
|
# @TEST-EXEC: btest-diff worker-2/.stdout
|
||||||
# @TEST-EXEC: btest-diff manager-1/config.log
|
# @TEST-EXEC: btest-diff manager/config.log
|
||||||
|
|
||||||
@load base/frameworks/config
|
@load base/frameworks/config
|
||||||
@load policy/frameworks/cluster/experimental
|
@load policy/frameworks/cluster/experimental
|
||||||
|
|
||||||
# @TEST-START-FILE cluster-layout.zeek
|
|
||||||
redef Cluster::nodes = {
|
|
||||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
|
||||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"],
|
|
||||||
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"],
|
|
||||||
};
|
|
||||||
# @TEST-END-FILE
|
|
||||||
|
|
||||||
redef Log::default_rotation_interval = 0secs;
|
redef Log::default_rotation_interval = 0secs;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
# @TEST-PORT: BROKER_PORT1
|
# @TEST-PORT: BROKER_MANAGER_PORT
|
||||||
# @TEST-PORT: BROKER_PORT2
|
# @TEST-PORT: BROKER_WORKER1_PORT
|
||||||
# @TEST-PORT: BROKER_PORT3
|
# @TEST-PORT: BROKER_WORKER2_PORT
|
||||||
#
|
#
|
||||||
# @TEST-EXEC: btest-bg-run manager-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=manager-1 zeek -b %INPUT
|
# @TEST-EXEC: cp $FILES/broker/cluster-layout.zeek .
|
||||||
|
#
|
||||||
|
# @TEST-EXEC: btest-bg-run manager ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=manager zeek -b %INPUT
|
||||||
# @TEST-EXEC: btest-bg-run worker-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-1 zeek -b %INPUT
|
# @TEST-EXEC: btest-bg-run worker-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-1 zeek -b %INPUT
|
||||||
# @TEST-EXEC: $SCRIPTS/wait-for-file manager-1/ready 30 || (btest-bg-wait -k 1 && false)
|
# @TEST-EXEC: $SCRIPTS/wait-for-file manager/ready 30 || (btest-bg-wait -k 1 && false)
|
||||||
# @TEST-EXEC: btest-bg-run worker-2 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-2 zeek -b %INPUT
|
# @TEST-EXEC: btest-bg-run worker-2 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-2 zeek -b %INPUT
|
||||||
# @TEST-EXEC: btest-bg-wait 60
|
# @TEST-EXEC: btest-bg-wait 60
|
||||||
# @TEST-EXEC: btest-diff manager-1/.stdout
|
# @TEST-EXEC: btest-diff manager/.stdout
|
||||||
# @TEST-EXEC: btest-diff worker-1/.stdout
|
# @TEST-EXEC: btest-diff worker-1/.stdout
|
||||||
# @TEST-EXEC: btest-diff worker-2/.stdout
|
# @TEST-EXEC: btest-diff worker-2/.stdout
|
||||||
# @TEST-EXEC: btest-diff manager-1/config.log
|
# @TEST-EXEC: btest-diff manager/config.log
|
||||||
|
|
||||||
# In this test we check if values get updated on a worker, even if they were set before the
|
# In this test we check if values get updated on a worker, even if they were set before the
|
||||||
# worker is present.
|
# worker is present.
|
||||||
|
@ -18,14 +20,6 @@
|
||||||
@load base/frameworks/config
|
@load base/frameworks/config
|
||||||
|
|
||||||
|
|
||||||
# @TEST-START-FILE cluster-layout.zeek
|
|
||||||
redef Cluster::nodes = {
|
|
||||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
|
||||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"],
|
|
||||||
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"],
|
|
||||||
};
|
|
||||||
# @TEST-END-FILE
|
|
||||||
|
|
||||||
redef Log::default_rotation_interval = 0secs;
|
redef Log::default_rotation_interval = 0secs;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
@ -51,7 +45,7 @@ function option_changed(ID: string, new_value: any, location: string): any
|
||||||
++option_changed_count;
|
++option_changed_count;
|
||||||
print "option changed", ID, new_value, location;
|
print "option changed", ID, new_value, location;
|
||||||
|
|
||||||
if ( Cluster::node == "manager-1" && option_changed_count == 3 )
|
if ( Cluster::node == "manager" && option_changed_count == 3 )
|
||||||
system("touch ready");
|
system("touch ready");
|
||||||
|
|
||||||
if ( Cluster::node == "worker-2" && option_changed_count == 3 )
|
if ( Cluster::node == "worker-2" && option_changed_count == 3 )
|
||||||
|
|
|
@ -3,19 +3,21 @@
|
||||||
# lines (and sets) being displayed in a different order due to different
|
# lines (and sets) being displayed in a different order due to different
|
||||||
# hash function seedings (though probably -D would control for that).
|
# hash function seedings (though probably -D would control for that).
|
||||||
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
|
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
|
||||||
# @TEST-PORT: BROKER_PORT1
|
# @TEST-PORT: BROKER_MANAGER_PORT
|
||||||
# @TEST-PORT: BROKER_PORT2
|
# @TEST-PORT: BROKER_WORKER1_PORT
|
||||||
# @TEST-PORT: BROKER_PORT3
|
# @TEST-PORT: BROKER_WORKER2_PORT
|
||||||
#
|
#
|
||||||
# @TEST-EXEC: btest-bg-run manager-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=manager-1 zeek -b %INPUT
|
# @TEST-EXEC: cp $FILES/broker/cluster-layout.zeek .
|
||||||
|
#
|
||||||
|
# @TEST-EXEC: btest-bg-run manager ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=manager zeek -b %INPUT
|
||||||
# @TEST-EXEC: sleep 1
|
# @TEST-EXEC: sleep 1
|
||||||
# @TEST-EXEC: btest-bg-run worker-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-1 zeek -b %INPUT
|
# @TEST-EXEC: btest-bg-run worker-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-1 zeek -b %INPUT
|
||||||
# @TEST-EXEC: btest-bg-run worker-2 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-2 zeek -b %INPUT
|
# @TEST-EXEC: btest-bg-run worker-2 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-2 zeek -b %INPUT
|
||||||
# @TEST-EXEC: btest-bg-wait 30
|
# @TEST-EXEC: btest-bg-wait 30
|
||||||
# @TEST-EXEC: btest-diff manager-1/.stdout
|
# @TEST-EXEC: btest-diff manager/.stdout
|
||||||
# @TEST-EXEC: btest-diff worker-1/.stdout
|
# @TEST-EXEC: btest-diff worker-1/.stdout
|
||||||
# @TEST-EXEC: btest-diff worker-2/.stdout
|
# @TEST-EXEC: btest-diff worker-2/.stdout
|
||||||
# @TEST-EXEC: btest-diff manager-1/config.log
|
# @TEST-EXEC: btest-diff manager/config.log
|
||||||
|
|
||||||
@load base/frameworks/config
|
@load base/frameworks/config
|
||||||
@load base/frameworks/cluster
|
@load base/frameworks/cluster
|
||||||
|
@ -23,14 +25,6 @@
|
||||||
@load base/protocols/conn
|
@load base/protocols/conn
|
||||||
|
|
||||||
|
|
||||||
# @TEST-START-FILE cluster-layout.zeek
|
|
||||||
redef Cluster::nodes = {
|
|
||||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
|
||||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"],
|
|
||||||
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"],
|
|
||||||
};
|
|
||||||
# @TEST-END-FILE
|
|
||||||
|
|
||||||
# @TEST-START-FILE configfile
|
# @TEST-START-FILE configfile
|
||||||
testbool F
|
testbool F
|
||||||
testcount 1
|
testcount 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue