btest: Avoid loading ZeroMQ if not compiled in

...at the same time, add some `TEST-REQUIRES: have-zeromq` which
unfortunately means that developers will usually want libzmq
installed on their system.
This commit is contained in:
Arne Welzel 2024-12-11 17:58:31 +01:00
parent c6c6d88b4c
commit 85189ca918
6 changed files with 10 additions and 2 deletions

View file

@ -11,9 +11,11 @@
# @load frameworks/control/controllee.zeek # @load frameworks/control/controllee.zeek
# @load frameworks/control/controller.zeek # @load frameworks/control/controller.zeek
@ifdef ( Cluster::CLUSTER_BACKEND_ZEROMQ )
@load frameworks/cluster/backend/zeromq/__load__.zeek @load frameworks/cluster/backend/zeromq/__load__.zeek
# @load frameworks/cluster/backend/zeromq/connect.zeek # @load frameworks/cluster/backend/zeromq/connect.zeek
@load frameworks/cluster/backend/zeromq/main.zeek @load frameworks/cluster/backend/zeromq/main.zeek
@endif
@load frameworks/cluster/experimental.zeek @load frameworks/cluster/experimental.zeek
# Loaded via the above through test-all-policy-cluster.test # Loaded via the above through test-all-policy-cluster.test
# when running as a manager, creates cluster.log entries # when running as a manager, creates cluster.log entries

View file

@ -2,7 +2,9 @@
# Scripts which are commented out in test-all-policy.zeek. # Scripts which are commented out in test-all-policy.zeek.
@load protocols/ssl/decryption.zeek @load protocols/ssl/decryption.zeek
@ifdef ( Cluster::CLUSTER_BACKEND_ZEROMQ )
@load frameworks/cluster/backend/zeromq/connect.zeek @load frameworks/cluster/backend/zeromq/connect.zeek
@endif
@load frameworks/cluster/nodes-experimental/manager.zeek @load frameworks/cluster/nodes-experimental/manager.zeek
@load frameworks/control/controllee.zeek @load frameworks/control/controllee.zeek
@load frameworks/control/controller.zeek @load frameworks/control/controller.zeek

View file

@ -9,6 +9,7 @@
# below does. Don't ask. :-) # below does. Don't ask. :-)
# @TEST-REQUIRES: $SCRIPTS/have-spicy # This test logs loaded scripts, so disable it if Spicy and it associated plugin is unavailable. # @TEST-REQUIRES: $SCRIPTS/have-spicy # This test logs loaded scripts, so disable it if Spicy and it associated plugin is unavailable.
# @TEST-REQUIRES: have-zeromq # Require ZeroMQ so that the plugin's bif file is loaded.
# @TEST-REQUIRES: ! have-spicy-ssl # Enabling Spicy SSL changes the loaded scripts, skip in this case # @TEST-REQUIRES: ! have-spicy-ssl # Enabling Spicy SSL changes the loaded scripts, skip in this case
# @TEST-EXEC: zeek -b misc/loaded-scripts # @TEST-EXEC: zeek -b misc/loaded-scripts
# @TEST-EXEC: test -e loaded_scripts.log # @TEST-EXEC: test -e loaded_scripts.log

View file

@ -6,6 +6,7 @@
# #
# Require Spicy, otherwise its scripts cannot be loaded. # Require Spicy, otherwise its scripts cannot be loaded.
# @TEST-REQUIRES: have-spicy # @TEST-REQUIRES: have-spicy
# @TEST-REQUIRES: have-zeromq
# #
# @TEST-EXEC: test -d $DIST/scripts # @TEST-EXEC: test -d $DIST/scripts
# @TEST-EXEC: for script in `find $DIST/scripts/ -name \*\.zeek`; do zeek -b --parse-only $script >>errors 2>&1; done # @TEST-EXEC: for script in `find $DIST/scripts/ -name \*\.zeek`; do zeek -b --parse-only $script >>errors 2>&1; done

View file

@ -7,7 +7,8 @@
# prefix to make the test work everywhere. That's what the sed magic # prefix to make the test work everywhere. That's what the sed magic
# below does. Don't ask. :-) # below does. Don't ask. :-)
# @TEST-REQUIRES: ${SCRIPTS}/have-spicy # @TEST-REQUIRES: have-spicy
# @TEST-REQUIRES: have-zeromq
# @TEST-REQUIRES: ! have-spicy-ssl # Enabling Spicy SSL changes the loaded scripts, skip in this case # @TEST-REQUIRES: ! have-spicy-ssl # Enabling Spicy SSL changes the loaded scripts, skip in this case
# @TEST-EXEC: zeek misc/loaded-scripts # @TEST-EXEC: zeek misc/loaded-scripts
# @TEST-EXEC: test -e loaded_scripts.log # @TEST-EXEC: test -e loaded_scripts.log

View file

@ -1,5 +1,6 @@
# @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1" # @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1"
# @TEST-REQUIRES: ${SCRIPTS}/have-spicy # This test logs loaded scripts, so disable it if Spicy and the associated plugin are unavailable. # @TEST-REQUIRES: have-spicy # This test logs loaded scripts, so disable it if Spicy and the associated plugin are unavailable.
# @TEST-REQUIRES: have-zeromq # This test logs loaded scripts, so disable it if ZeroMQ isn't available.
# @TEST-REQUIRES: ! have-spicy-ssl # Enabling Spicy SSL changes baselines and thus changes raised events. Skip in this case. # @TEST-REQUIRES: ! have-spicy-ssl # Enabling Spicy SSL changes baselines and thus changes raised events. Skip in this case.
# @TEST-EXEC: ${DIST}/auxil/zeek-aux/plugin-support/init-plugin -u . Demo Hooks # @TEST-EXEC: ${DIST}/auxil/zeek-aux/plugin-support/init-plugin -u . Demo Hooks
# @TEST-EXEC: cp -r %DIR/hooks-plugin/* . # @TEST-EXEC: cp -r %DIR/hooks-plugin/* .