diff --git a/aux/btest b/aux/btest index f2cfd177f7..4a7bb0f6d6 160000 --- a/aux/btest +++ b/aux/btest @@ -1 +1 @@ -Subproject commit f2cfd177f7ab6a9d78abf2254f382ae72ec393e2 +Subproject commit 4a7bb0f6d6c14175f6c7c63fd39f30b5f369e1cf diff --git a/testing/btest/Baseline/broker.ssl_auth_failure/send.send.out b/testing/btest/Baseline/broker.ssl_auth_failure/send.send.out index af1061d460..057a0f3d8e 100644 --- a/testing/btest/Baseline/broker.ssl_auth_failure/send.send.out +++ b/testing/btest/Baseline/broker.ssl_auth_failure/send.send.out @@ -1 +1 @@ -sender error: code=Broker::PEER_UNAVAILABLE msg=(invalid-node, *127.0.0.1:9999, "remote endpoint unavailable") +sender error: code=Broker::PEER_UNAVAILABLE msg=(invalid-node, *, "remote endpoint unavailable") diff --git a/testing/btest/Baseline/scripts.base.frameworks.netcontrol.acld-hook/send.send.out b/testing/btest/Baseline/scripts.base.frameworks.netcontrol.acld-hook/send.send.out index b348f04fc0..acd91c327a 100644 --- a/testing/btest/Baseline/scripts.base.frameworks.netcontrol.acld-hook/send.send.out +++ b/testing/btest/Baseline/scripts.base.frameworks.netcontrol.acld-hook/send.send.out @@ -1,4 +1,4 @@ -Broker peer added, [address=127.0.0.1, bound_port=9999/tcp] +Broker peer added, 127.0.0.1, T rule added, [ty=NetControl::FLOW, conn=, flow=[src_h=192.168.18.50/32, src_p=, dst_h=74.125.239.97/32, dst_p=, src_m=, dst_m=], ip=, mac=], NetControl::DROP rule added, [ty=NetControl::FLOW, conn=, flow=[src_h=, src_p=, dst_h=, dst_p=443/tcp, src_m=, dst_m=], ip=, mac=], NetControl::DROP rule added, [ty=NetControl::ADDRESS, conn=, flow=, ip=192.168.18.50/32, mac=], NetControl::DROP diff --git a/testing/btest/Baseline/scripts.base.frameworks.netcontrol.acld/send.send.out b/testing/btest/Baseline/scripts.base.frameworks.netcontrol.acld/send.send.out index 1e24b1ae3a..2c0b479dad 100644 --- a/testing/btest/Baseline/scripts.base.frameworks.netcontrol.acld/send.send.out +++ b/testing/btest/Baseline/scripts.base.frameworks.netcontrol.acld/send.send.out @@ -1,4 +1,4 @@ -Broker peer added, [address=127.0.0.1, bound_port=9999/tcp] +Broker peer added, 127.0.0.1, T rule added, [ty=NetControl::FLOW, conn=, flow=[src_h=192.168.18.50/32, src_p=, dst_h=74.125.239.97/32, dst_p=, src_m=, dst_m=], ip=, mac=], NetControl::DROP rule exists, [ty=NetControl::FLOW, conn=, flow=[src_h=, src_p=, dst_h=, dst_p=443/tcp, src_m=, dst_m=], ip=, mac=], NetControl::DROP rule added, [ty=NetControl::ADDRESS, conn=, flow=, ip=192.168.18.50/32, mac=], NetControl::DROP diff --git a/testing/btest/Baseline/scripts.base.frameworks.netcontrol.broker/send.send.out b/testing/btest/Baseline/scripts.base.frameworks.netcontrol.broker/send.send.out index 920fdd8085..4b46d2487c 100644 --- a/testing/btest/Baseline/scripts.base.frameworks.netcontrol.broker/send.send.out +++ b/testing/btest/Baseline/scripts.base.frameworks.netcontrol.broker/send.send.out @@ -1,4 +1,4 @@ -Broker peer added, [address=127.0.0.1, bound_port=9999/tcp] +Broker peer added, 127.0.0.1, T rule exists, [ty=NetControl::FLOW, conn=, flow=[src_h=10.10.1.4/32, src_p=1470/tcp, dst_h=74.53.140.153/32, dst_p=25/tcp, src_m=, dst_m=], ip=, mac=], NetControl::DROP rule timeout, [ty=NetControl::FLOW, conn=, flow=[src_h=10.10.1.4/32, src_p=1470/tcp, dst_h=74.53.140.153/32, dst_p=25/tcp, src_m=, dst_m=], ip=, mac=], NetControl::DROP, [duration=, packet_count=, byte_count=] rule added, [ty=NetControl::ADDRESS, conn=, flow=, ip=10.10.1.4/32, mac=], NetControl::DROP diff --git a/testing/btest/Baseline/scripts.base.frameworks.openflow.broker-basic/send.send.out b/testing/btest/Baseline/scripts.base.frameworks.openflow.broker-basic/send.send.out index ec860918ba..a416783950 100644 --- a/testing/btest/Baseline/scripts.base.frameworks.openflow.broker-basic/send.send.out +++ b/testing/btest/Baseline/scripts.base.frameworks.openflow.broker-basic/send.send.out @@ -1,4 +1,4 @@ -Broker peer added, [address=127.0.0.1, bound_port=9999/tcp] +Broker peer added, 127.0.0.1, T Flow_mod_success Flow_mod_failure connection established diff --git a/testing/btest/broker/connect-on-retry.bro b/testing/btest/broker/connect-on-retry.bro index 200dc5abd6..56e479b7ea 100644 --- a/testing/btest/broker/connect-on-retry.bro +++ b/testing/btest/broker/connect-on-retry.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # # @TEST-EXEC: btest-bg-run recv "bro -B broker -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -B broker -b ../send.bro >send.out" @@ -20,7 +20,7 @@ event bro_init() { Broker::subscribe("bro/event/my_topic"); Broker::auto_publish("bro/event/my_topic", ping); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } function send_event() @@ -62,7 +62,7 @@ global pong: event(msg: string, c: count); event delayed_listen() { - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event bro_init() diff --git a/testing/btest/broker/disconnect.bro b/testing/btest/broker/disconnect.bro index 3dd2dc45d4..08d80f0441 100644 --- a/testing/btest/broker/disconnect.bro +++ b/testing/btest/broker/disconnect.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-EXEC: btest-bg-run recv "bro -B broker -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -B broker -b ../send.bro >send.out" @@ -27,7 +27,7 @@ event my_event(i: count) event bro_init() { Broker::subscribe(test_topic); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) @@ -63,7 +63,7 @@ event my_event(i: count) event bro_init() { Broker::subscribe(test_topic); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/broker/error.bro b/testing/btest/broker/error.bro index af94e28019..aa413ea2ac 100644 --- a/testing/btest/broker/error.bro +++ b/testing/btest/broker/error.bro @@ -1,5 +1,3 @@ -# @TEST-SERIALIZE: comm -# # @TEST-EXEC: bro -B main-loop,broker -b send.bro >send.out # @TEST-EXEC: btest-diff send.out # diff --git a/testing/btest/broker/remote_event.bro b/testing/btest/broker/remote_event.bro index 1cb6fbd1ae..a9e22ec25f 100644 --- a/testing/btest/broker/remote_event.bro +++ b/testing/btest/broker/remote_event.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # # @TEST-EXEC: btest-bg-run recv "bro -B broker -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -B broker -b ../send.bro >send.out" @@ -18,7 +18,7 @@ global ping: event(msg: string, c: count); event bro_init() { Broker::subscribe("bro/event/my_topic"); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); print "is_remote should be F, and is", is_remote_event(); } @@ -67,7 +67,7 @@ global pong: event(msg: string, c: count); event bro_init() { Broker::subscribe("bro/event/my_topic"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/broker/remote_event_any.bro b/testing/btest/broker/remote_event_any.bro index a71261f889..b45e5017ef 100644 --- a/testing/btest/broker/remote_event_any.bro +++ b/testing/btest/broker/remote_event_any.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # # @TEST-EXEC: btest-bg-run recv "bro -B broker -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -B broker -b ../send.bro >send.out" @@ -18,7 +18,7 @@ global ping: event(msg: string, c: any); event bro_init() { Broker::subscribe("bro/event/my_topic"); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); print "is_remote should be F, and is", is_remote_event(); } @@ -70,7 +70,7 @@ global pong: event(msg: string, c: any); event bro_init() { Broker::subscribe("bro/event/my_topic"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/broker/remote_event_auto.bro b/testing/btest/broker/remote_event_auto.bro index ec060b4cf5..04570b9e6d 100644 --- a/testing/btest/broker/remote_event_auto.bro +++ b/testing/btest/broker/remote_event_auto.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # # @TEST-EXEC: btest-bg-run recv "bro -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -b ../send.bro >send.out" @@ -19,7 +19,7 @@ event bro_init() { Broker::subscribe("bro/event/my_topic"); Broker::auto_publish("bro/event/my_topic", ping); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } function send_event() @@ -63,7 +63,7 @@ event bro_init() { Broker::subscribe("bro/event/my_topic"); Broker::auto_publish("bro/event/my_topic", pong); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/broker/remote_event_ssl_auth.bro b/testing/btest/broker/remote_event_ssl_auth.bro index 0c9335d803..2422638416 100644 --- a/testing/btest/broker/remote_event_ssl_auth.bro +++ b/testing/btest/broker/remote_event_ssl_auth.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # # @TEST-EXEC: btest-bg-run recv "bro -B broker -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -B broker -b ../send.bro >send.out" @@ -177,7 +177,7 @@ global ping: event(msg: string, c: count); event bro_init() { Broker::subscribe("bro/event/my_topic"); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } function send_event() @@ -228,7 +228,7 @@ global pong: event(msg: string, c: count); event bro_init() { Broker::subscribe("bro/event/my_topic"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/broker/remote_event_vector_any.bro b/testing/btest/broker/remote_event_vector_any.bro index 25ac8cf5a2..6f03d97c56 100644 --- a/testing/btest/broker/remote_event_vector_any.bro +++ b/testing/btest/broker/remote_event_vector_any.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # # @TEST-EXEC: btest-bg-run recv "bro -B broker -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -B broker -b ../send.bro >send.out" @@ -23,7 +23,7 @@ global bar: event(x: any); event bro_init() { Broker::subscribe("test"); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) @@ -94,7 +94,7 @@ event bar(x: any) event bro_init() { Broker::subscribe("test"); - Broker::listen(); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/broker/remote_id.bro b/testing/btest/broker/remote_id.bro index bf73e7e125..62cddb9f25 100644 --- a/testing/btest/broker/remote_id.bro +++ b/testing/btest/broker/remote_id.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # # @TEST-EXEC: btest-bg-run recv "bro -B broker -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -B broker -b ../send.bro test_var=newval >send.out" @@ -12,7 +12,7 @@ const test_var = "init" &redef; event bro_init() { - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) @@ -48,7 +48,7 @@ event bro_init() { print "intial val", test_var; Broker::subscribe("bro/ids"); - Broker::listen(); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/broker/remote_log.bro b/testing/btest/broker/remote_log.bro index 0f20ab7542..dae89d42b2 100644 --- a/testing/btest/broker/remote_log.bro +++ b/testing/btest/broker/remote_log.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-EXEC: btest-bg-run recv "bro -B broker -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -B broker -b ../send.bro >send.out" @@ -45,7 +45,7 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) event bro_init() { Broker::subscribe("bro/"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string) @@ -63,7 +63,7 @@ event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string) event bro_init() { - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } global n = 0; diff --git a/testing/btest/broker/remote_log_late_join.bro b/testing/btest/broker/remote_log_late_join.bro index 8f2eae45b5..aea7846996 100644 --- a/testing/btest/broker/remote_log_late_join.bro +++ b/testing/btest/broker/remote_log_late_join.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-EXEC: btest-bg-run recv "bro -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -b ../send.bro >send.out" @@ -45,7 +45,7 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) event bro_init() { Broker::subscribe("bro/"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string) @@ -63,7 +63,7 @@ event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string) event doconnect() { - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } global n = 0; diff --git a/testing/btest/broker/remote_log_types.bro b/testing/btest/broker/remote_log_types.bro index b965e0928a..8bbc66eaa2 100644 --- a/testing/btest/broker/remote_log_types.bro +++ b/testing/btest/broker/remote_log_types.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-EXEC: btest-bg-run recv "bro -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -b ../send.bro >send.out" @@ -61,7 +61,7 @@ event bro_init() &priority=5 event bro_init() { Broker::subscribe("bro/"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event quit_receiver() @@ -79,7 +79,7 @@ event quit_receiver() event bro_init() { - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event quit_sender() diff --git a/testing/btest/broker/ssl_auth_failure.bro b/testing/btest/broker/ssl_auth_failure.bro index d78edd0ac3..bc90d86298 100644 --- a/testing/btest/broker/ssl_auth_failure.bro +++ b/testing/btest/broker/ssl_auth_failure.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # # @TEST-EXEC: btest-bg-run recv "bro -B broker -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -B broker -b ../send.bro >send.out" @@ -106,7 +106,7 @@ event do_terminate() event bro_init() { Broker::subscribe("bro/event/my_topic"); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); schedule 5secs { do_terminate() }; } @@ -123,7 +123,7 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) event Broker::error(code: Broker::ErrorCode, msg: string) { - print fmt("sender error: code=%s msg=%s", code, msg); + print fmt("sender error: code=%s msg=%s", code, gsub(msg, /127.0.0.1:[0-9]+/, "")); terminate(); } @@ -147,7 +147,7 @@ event do_terminate() event bro_init() { - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); schedule 10secs { do_terminate() }; } diff --git a/testing/btest/broker/store/clone.bro b/testing/btest/broker/store/clone.bro index 0865e55923..5620303410 100644 --- a/testing/btest/broker/store/clone.bro +++ b/testing/btest/broker/store/clone.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # # @TEST-EXEC: btest-bg-run clone "bro -B broker -b ../clone-main.bro >clone.out" # @TEST-EXEC: btest-bg-run master "bro -B broker -b ../master-main.bro >master.out" @@ -58,7 +58,7 @@ event bro_init() Broker::put(h, "two", 223); Broker::put(h, vector(1,2), 1947/tcp); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event insert_more() @@ -133,7 +133,7 @@ event bro_init() { Broker::auto_publish("bro/events", inserted); Broker::subscribe("bro/"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/broker/unpeer.bro b/testing/btest/broker/unpeer.bro index 1165799488..b591815955 100644 --- a/testing/btest/broker/unpeer.bro +++ b/testing/btest/broker/unpeer.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # # @TEST-EXEC: btest-bg-run recv "bro -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -b ../send.bro >send.out" @@ -38,7 +38,7 @@ event bro_init() { Broker::subscribe("bro/event/my_topic"); Broker::auto_publish("bro/event/my_topic", print_something); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) @@ -68,7 +68,7 @@ event print_something(i: int) event bro_init() { Broker::subscribe("bro/event/my_topic"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); schedule 10secs { do_terminate() }; } diff --git a/testing/btest/core/leaks/basic-cluster.bro b/testing/btest/core/leaks/basic-cluster.bro index 57552c54af..fa73fb9a96 100644 --- a/testing/btest/core/leaks/basic-cluster.bro +++ b/testing/btest/core/leaks/basic-cluster.bro @@ -1,6 +1,8 @@ # Needs perftools support. # -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # @TEST-GROUP: leaks # # @TEST-REQUIRES: bro --help 2>&1 | grep -q mem-leaks @@ -12,9 +14,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/core/leaks/broker/clone_store.bro b/testing/btest/core/leaks/broker/clone_store.bro index 2cd728c631..68235c7bab 100644 --- a/testing/btest/core/leaks/broker/clone_store.bro +++ b/testing/btest/core/leaks/broker/clone_store.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-REQUIRES: bro --help 2>&1 | grep -q mem-leaks # @TEST-GROUP: leaks @@ -59,7 +59,7 @@ event bro_init() Broker::put(h, "two", 223); Broker::put(h, vector(1,2), 1947/tcp); - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event insert_more() @@ -131,7 +131,7 @@ event bro_init() { Broker::auto_publish("bro/events", inserted); Broker::subscribe("bro/"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/core/leaks/broker/remote_event.test b/testing/btest/core/leaks/broker/remote_event.test index b788f3ee79..e11d083db3 100644 --- a/testing/btest/core/leaks/broker/remote_event.test +++ b/testing/btest/core/leaks/broker/remote_event.test @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-REQUIRES: bro --help 2>&1 | grep -q mem-leaks # @TEST-GROUP: leaks @@ -20,7 +20,7 @@ event bro_init() { Broker::subscribe("bro/event/"); Broker::auto_publish("bro/event/my_topic", auto_event_handler); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } global event_count = 0; @@ -53,7 +53,7 @@ global auto_event_handler: event(msg: string, c: count); event bro_init() { Broker::subscribe("bro/event/my_topic"); - Broker::peer("127.0.0.1", Broker::default_port, 1secs); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT")), 1secs); } global event_count = 0; diff --git a/testing/btest/core/leaks/broker/remote_log.test b/testing/btest/core/leaks/broker/remote_log.test index a2b1d8793e..4d55705e4a 100644 --- a/testing/btest/core/leaks/broker/remote_log.test +++ b/testing/btest/core/leaks/broker/remote_log.test @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-REQUIRES: bro --help 2>&1 | grep -q mem-leaks # @TEST-GROUP: leaks @@ -46,7 +46,7 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) event bro_init() { Broker::subscribe("bro/"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string) @@ -62,7 +62,7 @@ event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string) event bro_init() { - Broker::peer("127.0.0.1"); + Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT"))); } global n = 0; diff --git a/testing/btest/core/leaks/hll_cluster.bro b/testing/btest/core/leaks/hll_cluster.bro index 8b96c991b3..e565778fbc 100644 --- a/testing/btest/core/leaks/hll_cluster.bro +++ b/testing/btest/core/leaks/hll_cluster.bro @@ -1,6 +1,8 @@ # Needs perftools support. # -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # @TEST-GROUP: leaks # # @TEST-REQUIRES: bro --help 2>&1 | grep -q mem-leaks @@ -17,9 +19,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1"], + ["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 diff --git a/testing/btest/doc/broxygen/all_scripts.test b/testing/btest/doc/broxygen/all_scripts.test index dc009044da..238ba3a4f3 100644 --- a/testing/btest/doc/broxygen/all_scripts.test +++ b/testing/btest/doc/broxygen/all_scripts.test @@ -4,8 +4,8 @@ # This must be serialized with communication tests because it does load # listen.bro in order to document it. -# @TEST-SERIALIZE: comm -# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -X broxygen.config broxygen DumpEvents::include=/NOTHING_MATCHES/ +# @TEST-PORT: BROKER_PORT +# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -X broxygen.config broxygen DumpEvents::include=/NOTHING_MATCHES/ Broker::default_port=$BROKER_PORT # @TEST-EXEC: btest-diff .stdout # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr diff --git a/testing/btest/doc/broxygen/identifier.bro b/testing/btest/doc/broxygen/identifier.bro index 9225ab8db0..ae49d812a0 100644 --- a/testing/btest/doc/broxygen/identifier.bro +++ b/testing/btest/doc/broxygen/identifier.bro @@ -1,5 +1,5 @@ -# @TEST-SERIALIZE: comm -# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X broxygen.config %INPUT +# @TEST-PORT: BROKER_PORT +# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X broxygen.config %INPUT Broker::default_port=$BROKER_PORT # @TEST-EXEC: btest-diff test.rst @TEST-START-FILE broxygen.config diff --git a/testing/btest/doc/broxygen/package.bro b/testing/btest/doc/broxygen/package.bro index 0d8d790361..6a9957804a 100644 --- a/testing/btest/doc/broxygen/package.bro +++ b/testing/btest/doc/broxygen/package.bro @@ -1,5 +1,5 @@ -# @TEST-SERIALIZE: comm -# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X broxygen.config %INPUT +# @TEST-PORT: BROKER_PORT +# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X broxygen.config %INPUT Broker::default_port=$BROKER_PORT # @TEST-EXEC: btest-diff test.rst @TEST-START-FILE broxygen.config diff --git a/testing/btest/doc/broxygen/package_index.bro b/testing/btest/doc/broxygen/package_index.bro index 4b98290f20..49c367aa48 100644 --- a/testing/btest/doc/broxygen/package_index.bro +++ b/testing/btest/doc/broxygen/package_index.bro @@ -1,5 +1,5 @@ -# @TEST-SERIALIZE: comm -# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X broxygen.config %INPUT +# @TEST-PORT: BROKER_PORT +# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X broxygen.config %INPUT Broker::default_port=$BROKER_PORT # @TEST-EXEC: btest-diff test.rst @TEST-START-FILE broxygen.config diff --git a/testing/btest/doc/broxygen/script_index.bro b/testing/btest/doc/broxygen/script_index.bro index c987c005be..ab257ad35d 100644 --- a/testing/btest/doc/broxygen/script_index.bro +++ b/testing/btest/doc/broxygen/script_index.bro @@ -1,5 +1,5 @@ -# @TEST-SERIALIZE: comm -# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X broxygen.config %INPUT +# @TEST-PORT: BROKER_PORT +# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X broxygen.config %INPUT Broker::default_port=$BROKER_PORT # @TEST-EXEC: btest-diff test.rst @TEST-START-FILE broxygen.config diff --git a/testing/btest/doc/broxygen/script_summary.bro b/testing/btest/doc/broxygen/script_summary.bro index 7fc89c3735..a517a08072 100644 --- a/testing/btest/doc/broxygen/script_summary.bro +++ b/testing/btest/doc/broxygen/script_summary.bro @@ -1,5 +1,5 @@ -# @TEST-SERIALIZE: comm -# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X broxygen.config %INPUT +# @TEST-PORT: BROKER_PORT +# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; bro -b -X broxygen.config %INPUT Broker::default_port=$BROKER_PORT # @TEST-EXEC: btest-diff test.rst @TEST-START-FILE broxygen.config diff --git a/testing/btest/language/when.bro b/testing/btest/language/when.bro index 795552a422..a2bad6a620 100644 --- a/testing/btest/language/when.bro +++ b/testing/btest/language/when.bro @@ -1,4 +1,3 @@ -# @TEST-SERIALIZE: comm # @TEST-EXEC: btest-bg-run test1 bro %INPUT # @TEST-EXEC: btest-bg-wait 10 # @TEST-EXEC: mv test1/.stdout out diff --git a/testing/btest/scripts/base/frameworks/cluster/custom_pool_exclusivity.bro b/testing/btest/scripts/base/frameworks/cluster/custom_pool_exclusivity.bro index 224b259e20..dc2558f2a4 100644 --- a/testing/btest/scripts/base/frameworks/cluster/custom_pool_exclusivity.bro +++ b/testing/btest/scripts/base/frameworks/cluster/custom_pool_exclusivity.bro @@ -1,4 +1,8 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# @TEST-PORT: BROKER_PORT4 +# @TEST-PORT: BROKER_PORT5 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run proxy-1 BROPATH=$BROPATH:.. CLUSTER_NODE=proxy-1 bro %INPUT @@ -8,11 +12,11 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37758/tcp, $manager="manager-1"], - ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37759/tcp, $manager="manager-1"], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))], + ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"], + ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"], + ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4")), $manager="manager-1", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT5")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/cluster/custom_pool_limits.bro b/testing/btest/scripts/base/frameworks/cluster/custom_pool_limits.bro index f5a9fed5b3..08202bd727 100644 --- a/testing/btest/scripts/base/frameworks/cluster/custom_pool_limits.bro +++ b/testing/btest/scripts/base/frameworks/cluster/custom_pool_limits.bro @@ -1,4 +1,8 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# @TEST-PORT: BROKER_PORT4 +# @TEST-PORT: BROKER_PORT5 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run proxy-1 BROPATH=$BROPATH:.. CLUSTER_NODE=proxy-1 bro %INPUT @@ -8,11 +12,11 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37758/tcp, $manager="manager-1"], - ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37759/tcp, $manager="manager-1"], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))], + ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"], + ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"], + ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4")), $manager="manager-1", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT5")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/cluster/forwarding.bro b/testing/btest/scripts/base/frameworks/cluster/forwarding.bro index db60b48a05..e62a2ced66 100644 --- a/testing/btest/scripts/base/frameworks/cluster/forwarding.bro +++ b/testing/btest/scripts/base/frameworks/cluster/forwarding.bro @@ -1,4 +1,8 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# @TEST-PORT: BROKER_PORT4 +# @TEST-PORT: BROKER_PORT5 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run proxy-1 BROPATH=$BROPATH:.. CLUSTER_NODE=proxy-1 bro %INPUT @@ -14,11 +18,11 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37758/tcp, $manager="manager-1"], - ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37759/tcp, $manager="manager-1"], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))], + ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"], + ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"], + ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4")), $manager="manager-1", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT5")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/cluster/log_distribution.bro b/testing/btest/scripts/base/frameworks/cluster/log_distribution.bro index bfdddc9497..199e265674 100644 --- a/testing/btest/scripts/base/frameworks/cluster/log_distribution.bro +++ b/testing/btest/scripts/base/frameworks/cluster/log_distribution.bro @@ -1,4 +1,7 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# @TEST-PORT: BROKER_PORT4 # # @TEST-EXEC: btest-bg-run logger-1 BROPATH=$BROPATH:.. CLUSTER_NODE=logger-1 bro %INPUT # @TEST-EXEC: btest-bg-run logger-2 BROPATH=$BROPATH:.. CLUSTER_NODE=logger-2 bro %INPUT @@ -12,10 +15,10 @@ redef Cluster::manager_is_logger = F; redef Cluster::nodes = { - ["manager"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager", $interface="eth0"], - ["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=37762/tcp, $manager="manager"], - ["logger-2"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=37763/tcp, $manager="manager"] + ["manager"] = [$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", $interface="eth0"], + ["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager"], + ["logger-2"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4")), $manager="manager"] }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/cluster/start-it-up-logger.bro b/testing/btest/scripts/base/frameworks/cluster/start-it-up-logger.bro index 164eb0c1cb..d94875e858 100644 --- a/testing/btest/scripts/base/frameworks/cluster/start-it-up-logger.bro +++ b/testing/btest/scripts/base/frameworks/cluster/start-it-up-logger.bro @@ -1,4 +1,9 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# @TEST-PORT: BROKER_PORT4 +# @TEST-PORT: BROKER_PORT5 +# @TEST-PORT: BROKER_PORT6 # # @TEST-EXEC: btest-bg-run logger-1 CLUSTER_NODE=logger-1 BROPATH=$BROPATH:.. bro %INPUT # @TEST-EXEC: btest-bg-run manager-1 CLUSTER_NODE=manager-1 BROPATH=$BROPATH:.. bro %INPUT @@ -17,12 +22,12 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::manager_is_logger = F; redef Cluster::nodes = { - ["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=37757/tcp], - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37758/tcp], - ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37759/tcp, $manager="manager-1"], - ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1"], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37762/tcp, $manager="manager-1", $interface="eth1"], + ["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))], + ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2"))], + ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"], + ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4")), $manager="manager-1"], + ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT5")), $manager="manager-1", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT6")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/cluster/start-it-up.bro b/testing/btest/scripts/base/frameworks/cluster/start-it-up.bro index aa4bcb45e4..eee6c29215 100644 --- a/testing/btest/scripts/base/frameworks/cluster/start-it-up.bro +++ b/testing/btest/scripts/base/frameworks/cluster/start-it-up.bro @@ -1,4 +1,8 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# @TEST-PORT: BROKER_PORT4 +# @TEST-PORT: BROKER_PORT5 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run proxy-1 BROPATH=$BROPATH:.. CLUSTER_NODE=proxy-1 bro %INPUT @@ -14,11 +18,11 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37758/tcp, $manager="manager-1"], - ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37759/tcp, $manager="manager-1"], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))], + ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"], + ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"], + ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4")), $manager="manager-1", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT5")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/cluster/topic_distribution.bro b/testing/btest/scripts/base/frameworks/cluster/topic_distribution.bro index 0116d6c231..317a38fbaa 100644 --- a/testing/btest/scripts/base/frameworks/cluster/topic_distribution.bro +++ b/testing/btest/scripts/base/frameworks/cluster/topic_distribution.bro @@ -1,4 +1,8 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# @TEST-PORT: BROKER_PORT4 +# @TEST-PORT: BROKER_PORT5 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run proxy-1 BROPATH=$BROPATH:.. CLUSTER_NODE=proxy-1 bro %INPUT @@ -8,11 +12,11 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37758/tcp, $manager="manager-1"], - ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37759/tcp, $manager="manager-1"], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))], + ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"], + ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"], + ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4")), $manager="manager-1", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT5")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/cluster/topic_distribution_bifs.bro b/testing/btest/scripts/base/frameworks/cluster/topic_distribution_bifs.bro index b9dd87e560..35ed52f883 100644 --- a/testing/btest/scripts/base/frameworks/cluster/topic_distribution_bifs.bro +++ b/testing/btest/scripts/base/frameworks/cluster/topic_distribution_bifs.bro @@ -1,4 +1,8 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# @TEST-PORT: BROKER_PORT4 +# @TEST-PORT: BROKER_PORT5 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run proxy-1 BROPATH=$BROPATH:.. CLUSTER_NODE=proxy-1 bro %INPUT @@ -10,11 +14,11 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37758/tcp, $manager="manager-1"], - ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37759/tcp, $manager="manager-1"], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))], + ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"], + ["proxy-2"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"], + ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4")), $manager="manager-1", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT5")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/config/basic_cluster.bro b/testing/btest/scripts/base/frameworks/config/basic_cluster.bro index 6423773b26..99f1de8aeb 100644 --- a/testing/btest/scripts/base/frameworks/config/basic_cluster.bro +++ b/testing/btest/scripts/base/frameworks/config/basic_cluster.bro @@ -1,5 +1,7 @@ -# @TEST-SERIALIZE: comm -# +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: sleep 1 # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -15,9 +17,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/config/cluster_resend.bro b/testing/btest/scripts/base/frameworks/config/cluster_resend.bro index e5c871a578..c66d5b2ba2 100644 --- a/testing/btest/scripts/base/frameworks/config/cluster_resend.bro +++ b/testing/btest/scripts/base/frameworks/config/cluster_resend.bro @@ -1,5 +1,7 @@ -# @TEST-SERIALIZE: comm -# +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: sleep 1 # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -19,9 +21,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/config/read_config_cluster.bro b/testing/btest/scripts/base/frameworks/config/read_config_cluster.bro index ea806fc18c..3f77a0fdc3 100644 --- a/testing/btest/scripts/base/frameworks/config/read_config_cluster.bro +++ b/testing/btest/scripts/base/frameworks/config/read_config_cluster.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: sleep 1 @@ -15,9 +17,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/control/configuration_update.bro b/testing/btest/scripts/base/frameworks/control/configuration_update.bro index d6f229d7a7..e90151bcbb 100644 --- a/testing/btest/scripts/base/frameworks/control/configuration_update.bro +++ b/testing/btest/scripts/base/frameworks/control/configuration_update.bro @@ -1,7 +1,7 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # -# @TEST-EXEC: btest-bg-run controllee BROPATH=$BROPATH:.. bro -Bbroker %INPUT frameworks/control/controllee Broker::default_port=65531/tcp -# @TEST-EXEC: btest-bg-run controller BROPATH=$BROPATH:.. bro -Bbroker %INPUT test-redef frameworks/control/controller Control::host=127.0.0.1 Control::host_port=65531/tcp Control::cmd=configuration_update +# @TEST-EXEC: btest-bg-run controllee BROPATH=$BROPATH:.. bro -Bbroker %INPUT frameworks/control/controllee Broker::default_port=$BROKER_PORT +# @TEST-EXEC: btest-bg-run controller BROPATH=$BROPATH:.. bro -Bbroker %INPUT test-redef frameworks/control/controller Control::host=127.0.0.1 Control::host_port=$BROKER_PORT Control::cmd=configuration_update # @TEST-EXEC: btest-bg-wait 10 # @TEST-EXEC: btest-diff controllee/.stdout diff --git a/testing/btest/scripts/base/frameworks/control/id_value.bro b/testing/btest/scripts/base/frameworks/control/id_value.bro index 13cf1c5548..2528b28c25 100644 --- a/testing/btest/scripts/base/frameworks/control/id_value.bro +++ b/testing/btest/scripts/base/frameworks/control/id_value.bro @@ -1,7 +1,7 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # -# @TEST-EXEC: btest-bg-run controllee BROPATH=$BROPATH:.. bro %INPUT only-for-controllee frameworks/control/controllee Broker::default_port=65532/tcp -# @TEST-EXEC: btest-bg-run controller BROPATH=$BROPATH:.. bro %INPUT frameworks/control/controller Control::host=127.0.0.1 Control::host_port=65532/tcp Control::cmd=id_value Control::arg=test_var +# @TEST-EXEC: btest-bg-run controllee BROPATH=$BROPATH:.. bro %INPUT only-for-controllee frameworks/control/controllee Broker::default_port=$BROKER_PORT +# @TEST-EXEC: btest-bg-run controller BROPATH=$BROPATH:.. bro %INPUT frameworks/control/controller Control::host=127.0.0.1 Control::host_port=$BROKER_PORT Control::cmd=id_value Control::arg=test_var # @TEST-EXEC: btest-bg-wait -k 10 # @TEST-EXEC: btest-diff controller/.stdout diff --git a/testing/btest/scripts/base/frameworks/control/shutdown.bro b/testing/btest/scripts/base/frameworks/control/shutdown.bro index cec965974a..a8089bf08a 100644 --- a/testing/btest/scripts/base/frameworks/control/shutdown.bro +++ b/testing/btest/scripts/base/frameworks/control/shutdown.bro @@ -1,6 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # -# @TEST-EXEC: btest-bg-run controllee BROPATH=$BROPATH:.. bro %INPUT frameworks/control/controllee Broker::default_port=65530/tcp -# @TEST-EXEC: btest-bg-run controller BROPATH=$BROPATH:.. bro %INPUT frameworks/control/controller Control::host=127.0.0.1 Control::host_port=65530/tcp Control::cmd=shutdown +# @TEST-EXEC: btest-bg-run controllee BROPATH=$BROPATH:.. bro %INPUT frameworks/control/controllee Broker::default_port=$BROKER_PORT +# @TEST-EXEC: btest-bg-run controller BROPATH=$BROPATH:.. bro %INPUT frameworks/control/controller Control::host=127.0.0.1 Control::host_port=$BROKER_PORT Control::cmd=shutdown # @TEST-EXEC: btest-bg-wait 10 diff --git a/testing/btest/scripts/base/frameworks/intel/cluster-transparency-with-proxy.bro b/testing/btest/scripts/base/frameworks/intel/cluster-transparency-with-proxy.bro index bf6ed644ed..b81cac9bac 100644 --- a/testing/btest/scripts/base/frameworks/intel/cluster-transparency-with-proxy.bro +++ b/testing/btest/scripts/base/frameworks/intel/cluster-transparency-with-proxy.bro @@ -1,4 +1,7 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# @TEST-PORT: BROKER_PORT4 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run proxy-1 BROPATH=$BROPATH:.. CLUSTER_NODE=proxy-1 bro %INPUT @@ -12,10 +15,10 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1"], - ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=37762/tcp, $manager="manager-1"], + ["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"], + ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4")), $manager="manager-1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/intel/cluster-transparency.bro b/testing/btest/scripts/base/frameworks/intel/cluster-transparency.bro index 62aabf6888..5362886cd7 100644 --- a/testing/btest/scripts/base/frameworks/intel/cluster-transparency.bro +++ b/testing/btest/scripts/base/frameworks/intel/cluster-transparency.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -11,9 +13,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1"], + ["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 diff --git a/testing/btest/scripts/base/frameworks/intel/read-file-dist-cluster.bro b/testing/btest/scripts/base/frameworks/intel/read-file-dist-cluster.bro index be1a526f1c..a4becfb2b3 100644 --- a/testing/btest/scripts/base/frameworks/intel/read-file-dist-cluster.bro +++ b/testing/btest/scripts/base/frameworks/intel/read-file-dist-cluster.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -11,9 +13,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1"], + ["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 diff --git a/testing/btest/scripts/base/frameworks/intel/remove-item-cluster.bro b/testing/btest/scripts/base/frameworks/intel/remove-item-cluster.bro index 6cc0fbdea0..5241231e1f 100644 --- a/testing/btest/scripts/base/frameworks/intel/remove-item-cluster.bro +++ b/testing/btest/scripts/base/frameworks/intel/remove-item-cluster.bro @@ -1,4 +1,5 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -9,8 +10,8 @@ # @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1"], + ["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"], }; # @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/logging/field-extension-cluster-error.bro b/testing/btest/scripts/base/frameworks/logging/field-extension-cluster-error.bro index 57dca60afc..dd30ad4c6f 100644 --- a/testing/btest/scripts/base/frameworks/logging/field-extension-cluster-error.bro +++ b/testing/btest/scripts/base/frameworks/logging/field-extension-cluster-error.bro @@ -1,4 +1,5 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 # # @TEST-EXEC: btest-bg-run manager-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=manager-1 bro %INPUT" # @TEST-EXEC: btest-bg-run worker-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=worker-1 bro --pseudo-realtime -C -r $TRACES/wikipedia.trace %INPUT" @@ -10,8 +11,8 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], + ["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", $interface="eth0"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/logging/field-extension-cluster.bro b/testing/btest/scripts/base/frameworks/logging/field-extension-cluster.bro index 066c1983e7..d38b5b744b 100644 --- a/testing/btest/scripts/base/frameworks/logging/field-extension-cluster.bro +++ b/testing/btest/scripts/base/frameworks/logging/field-extension-cluster.bro @@ -1,4 +1,5 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 # # @TEST-EXEC: btest-bg-run manager-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=manager-1 bro %INPUT" # @TEST-EXEC: btest-bg-run worker-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=worker-1 bro --pseudo-realtime -C -r $TRACES/wikipedia.trace %INPUT" @@ -8,8 +9,8 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], + ["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", $interface="eth0"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/netcontrol/acld-hook.bro b/testing/btest/scripts/base/frameworks/netcontrol/acld-hook.bro index a0ce9c44d6..9e0db8531a 100644 --- a/testing/btest/scripts/base/frameworks/netcontrol/acld-hook.bro +++ b/testing/btest/scripts/base/frameworks/netcontrol/acld-hook.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-EXEC: btest-bg-run recv "bro -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -b -r $TRACES/tls/ecdhe.pcap --pseudo-realtime ../send.bro >send.out" @@ -21,7 +21,7 @@ event bro_init() event NetControl::init() { - local netcontrol_acld = NetControl::create_acld(NetControl::AcldConfig($acld_host=127.0.0.1, $acld_port=Broker::default_port, $acld_topic="bro/event/netcontroltest")); + local netcontrol_acld = NetControl::create_acld(NetControl::AcldConfig($acld_host=127.0.0.1, $acld_port=to_port(getenv("BROKER_PORT")), $acld_topic="bro/event/netcontroltest")); NetControl::activate(netcontrol_acld, 0); } @@ -35,7 +35,7 @@ event NetControl::init_done() event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) { - print "Broker peer added", endpoint$network; + print "Broker peer added", endpoint$network$address, endpoint$network$bound_port == to_port(getenv("BROKER_PORT")); have_peer = T; if ( did_init && have_peer ) @@ -104,7 +104,7 @@ event die() event bro_init() { Broker::subscribe("bro/event/netcontroltest"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/scripts/base/frameworks/netcontrol/acld.bro b/testing/btest/scripts/base/frameworks/netcontrol/acld.bro index 7593790013..243e5e9b7c 100644 --- a/testing/btest/scripts/base/frameworks/netcontrol/acld.bro +++ b/testing/btest/scripts/base/frameworks/netcontrol/acld.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-EXEC: btest-bg-run recv "bro -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -b -r $TRACES/tls/ecdhe.pcap --pseudo-realtime ../send.bro >send.out" @@ -22,13 +22,13 @@ event bro_init() event NetControl::init() { - local netcontrol_acld = NetControl::create_acld(NetControl::AcldConfig($acld_host=127.0.0.1, $acld_port=Broker::default_port, $acld_topic="bro/event/netcontroltest")); + local netcontrol_acld = NetControl::create_acld(NetControl::AcldConfig($acld_host=127.0.0.1, $acld_port=to_port(getenv("BROKER_PORT")), $acld_topic="bro/event/netcontroltest")); NetControl::activate(netcontrol_acld, 0); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) { - print "Broker peer added", endpoint$network; + print "Broker peer added", endpoint$network$address, endpoint$network$bound_port == to_port(getenv("BROKER_PORT")); have_peer = T; if ( did_init && have_peer ) @@ -109,7 +109,7 @@ event die() event bro_init() { Broker::subscribe("bro/event/netcontroltest"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/scripts/base/frameworks/netcontrol/basic-cluster.bro b/testing/btest/scripts/base/frameworks/netcontrol/basic-cluster.bro index 0193e780d4..50c04433ad 100644 --- a/testing/btest/scripts/base/frameworks/netcontrol/basic-cluster.bro +++ b/testing/btest/scripts/base/frameworks/netcontrol/basic-cluster.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=manager-1 bro %INPUT" # @TEST-EXEC: btest-bg-run worker-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=worker-1 bro --pseudo-realtime -C -r $TRACES/tls/ecdhe.pcap %INPUT" @@ -12,9 +14,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth0"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth0"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/netcontrol/broker.bro b/testing/btest/scripts/base/frameworks/netcontrol/broker.bro index 9e8bb65476..4d232c3325 100644 --- a/testing/btest/scripts/base/frameworks/netcontrol/broker.bro +++ b/testing/btest/scripts/base/frameworks/netcontrol/broker.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-EXEC: btest-bg-run recv "bro -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -b -r $TRACES/smtp.trace --pseudo-realtime ../send.bro >send.out" @@ -22,7 +22,7 @@ event bro_init() event NetControl::init() { - local netcontrol_broker = NetControl::create_broker(NetControl::BrokerConfig($host=127.0.0.1, $bport=Broker::default_port, $topic="bro/event/netcontroltest"), T); + local netcontrol_broker = NetControl::create_broker(NetControl::BrokerConfig($host=127.0.0.1, $bport=to_port(getenv("BROKER_PORT")), $topic="bro/event/netcontroltest"), T); NetControl::activate(netcontrol_broker, 0); } @@ -36,7 +36,7 @@ event NetControl::init_done() event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) { - print "Broker peer added", endpoint$network; + print "Broker peer added", endpoint$network$address, endpoint$network$bound_port == to_port(getenv("BROKER_PORT")); have_peer = T; if ( did_init && have_peer ) @@ -93,7 +93,7 @@ event die() event bro_init() { Broker::subscribe("bro/event/netcontroltest"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/scripts/base/frameworks/notice/cluster.bro b/testing/btest/scripts/base/frameworks/notice/cluster.bro index 9e04764d68..69d1ac8364 100644 --- a/testing/btest/scripts/base/frameworks/notice/cluster.bro +++ b/testing/btest/scripts/base/frameworks/notice/cluster.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run proxy-1 BROPATH=$BROPATH:.. CLUSTER_NODE=proxy-1 bro %INPUT @@ -8,9 +10,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=27757/tcp], - ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=27758/tcp, $manager="manager-1"], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27760/tcp, $manager="manager-1", $interface="eth0"], + ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))], + ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"], + ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth0"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/notice/suppression-cluster.bro b/testing/btest/scripts/base/frameworks/notice/suppression-cluster.bro index a201c5f976..e9b31e1756 100644 --- a/testing/btest/scripts/base/frameworks/notice/suppression-cluster.bro +++ b/testing/btest/scripts/base/frameworks/notice/suppression-cluster.bro @@ -1,4 +1,7 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 +# @TEST-PORT: BROKER_PORT4 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run proxy-1 BROPATH=$BROPATH:.. CLUSTER_NODE=proxy-1 bro %INPUT @@ -9,10 +12,10 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=27757/tcp], - ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=27758/tcp, $manager="manager-1"], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27760/tcp, $manager="manager-1"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27761/tcp, $manager="manager-1"], + ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))], + ["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"], + ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4")), $manager="manager-1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/openflow/broker-basic.bro b/testing/btest/scripts/base/frameworks/openflow/broker-basic.bro index 83f83c15b4..9d43089b93 100644 --- a/testing/btest/scripts/base/frameworks/openflow/broker-basic.bro +++ b/testing/btest/scripts/base/frameworks/openflow/broker-basic.bro @@ -1,4 +1,4 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT # @TEST-EXEC: btest-bg-run recv "bro -b ../recv.bro >recv.out" # @TEST-EXEC: btest-bg-run send "bro -b -r $TRACES/smtp.trace --pseudo-realtime ../send.bro >send.out" @@ -18,12 +18,12 @@ global of_controller: OpenFlow::Controller; event bro_init() { suspend_processing(); - of_controller = OpenFlow::broker_new("broker1", 127.0.0.1, Broker::default_port, "bro/openflow", 42); + of_controller = OpenFlow::broker_new("broker1", 127.0.0.1, to_port(getenv("BROKER_PORT")), "bro/openflow", 42); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) { - print "Broker peer added", endpoint$network; + print "Broker peer added", endpoint$network$address, endpoint$network$bound_port == to_port(getenv("BROKER_PORT")); } event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) @@ -83,7 +83,7 @@ event die() event bro_init() { Broker::subscribe("bro/openflow"); - Broker::listen("127.0.0.1"); + Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT"))); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/scripts/base/frameworks/openflow/log-cluster.bro b/testing/btest/scripts/base/frameworks/openflow/log-cluster.bro index 5742a49d1d..33f20f8ce5 100644 --- a/testing/btest/scripts/base/frameworks/openflow/log-cluster.bro +++ b/testing/btest/scripts/base/frameworks/openflow/log-cluster.bro @@ -1,4 +1,5 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 # # @TEST-EXEC: btest-bg-run manager-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=manager-1 bro %INPUT" # @TEST-EXEC: btest-bg-run worker-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=worker-1 bro --pseudo-realtime -C -r $TRACES/smtp.trace %INPUT" @@ -7,8 +8,8 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], + ["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", $interface="eth0"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/sumstats/basic-cluster.bro b/testing/btest/scripts/base/frameworks/sumstats/basic-cluster.bro index 9f665ef960..8f4bd26ef1 100644 --- a/testing/btest/scripts/base/frameworks/sumstats/basic-cluster.bro +++ b/testing/btest/scripts/base/frameworks/sumstats/basic-cluster.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -9,9 +11,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/sumstats/cluster-intermediate-update.bro b/testing/btest/scripts/base/frameworks/sumstats/cluster-intermediate-update.bro index 5d8bff1e03..949fcb3644 100644 --- a/testing/btest/scripts/base/frameworks/sumstats/cluster-intermediate-update.bro +++ b/testing/btest/scripts/base/frameworks/sumstats/cluster-intermediate-update.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -8,9 +10,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/sumstats/on-demand-cluster.bro b/testing/btest/scripts/base/frameworks/sumstats/on-demand-cluster.bro index 14027f95ad..bb429a52cb 100644 --- a/testing/btest/scripts/base/frameworks/sumstats/on-demand-cluster.bro +++ b/testing/btest/scripts/base/frameworks/sumstats/on-demand-cluster.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -10,9 +12,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/sumstats/sample-cluster.bro b/testing/btest/scripts/base/frameworks/sumstats/sample-cluster.bro index 811cad3b96..227313635a 100644 --- a/testing/btest/scripts/base/frameworks/sumstats/sample-cluster.bro +++ b/testing/btest/scripts/base/frameworks/sumstats/sample-cluster.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -8,9 +10,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/sumstats/topk-cluster.bro b/testing/btest/scripts/base/frameworks/sumstats/topk-cluster.bro index 6f371ba815..8a3a9bcf1b 100644 --- a/testing/btest/scripts/base/frameworks/sumstats/topk-cluster.bro +++ b/testing/btest/scripts/base/frameworks/sumstats/topk-cluster.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -9,9 +11,9 @@ # @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE diff --git a/testing/btest/scripts/policy/misc/weird-stats-cluster.bro b/testing/btest/scripts/policy/misc/weird-stats-cluster.bro index a0652ed05b..140bb3b006 100644 --- a/testing/btest/scripts/policy/misc/weird-stats-cluster.bro +++ b/testing/btest/scripts/policy/misc/weird-stats-cluster.bro @@ -1,4 +1,6 @@ -# @TEST-SERIALIZE: comm +# @TEST-PORT: BROKER_PORT1 +# @TEST-PORT: BROKER_PORT2 +# @TEST-PORT: BROKER_PORT3 # # @TEST-EXEC: btest-bg-run manager-1 BROPATH=$BROPATH:.. CLUSTER_NODE=manager-1 bro %INPUT # @TEST-EXEC: btest-bg-run worker-1 BROPATH=$BROPATH:.. CLUSTER_NODE=worker-1 bro %INPUT @@ -9,9 +11,9 @@ @TEST-START-FILE cluster-layout.bro redef Cluster::nodes = { - ["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp], - ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"], - ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37761/tcp, $manager="manager-1", $interface="eth1"], + ["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", $interface="eth0"], + ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1", $interface="eth1"], }; @TEST-END-FILE