From 90eb22ce73720fdc0ec35b67dfe04e868712e7f9 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 30 Apr 2025 16:28:54 +0200 Subject: [PATCH] ZAM-bif-tracking: Remove ZeroMQ dependency Vern didn't have ZeroMQ installed and the test was skipped for him. Generally would recommend anyone working on core Zeek to install libzmq-dev or the equivalent for their environment, but until it is a real required dependency, loosen the requirements on the test. --- testing/btest/Baseline/opt.ZAM-bif-tracking/output | 2 +- testing/btest/opt/ZAM-bif-tracking.zeek | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/testing/btest/Baseline/opt.ZAM-bif-tracking/output b/testing/btest/Baseline/opt.ZAM-bif-tracking/output index 67cc8f4838..c20efb9801 100644 --- a/testing/btest/Baseline/opt.ZAM-bif-tracking/output +++ b/testing/btest/Baseline/opt.ZAM-bif-tracking/output @@ -1,2 +1,2 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -559 seen BiFs, 0 unseen BiFs (), 0 new BiFs () +558 seen BiFs, 0 unseen BiFs (), 0 new BiFs () diff --git a/testing/btest/opt/ZAM-bif-tracking.zeek b/testing/btest/opt/ZAM-bif-tracking.zeek index 5184cd68a6..8ad644ac5a 100644 --- a/testing/btest/opt/ZAM-bif-tracking.zeek +++ b/testing/btest/opt/ZAM-bif-tracking.zeek @@ -1,7 +1,6 @@ # @TEST-DOC: ZAM maintenance script for tracking changes in BiFs. # # @TEST-REQUIRES: have-spicy -# @TEST-REQUIRES: have-zeromq # # @TEST-EXEC: zeek -b %INPUT >output # @TEST-EXEC: btest-diff output @@ -213,7 +212,6 @@ global known_BiFs = set( "Telemetry::__histogram_observe", "Telemetry::__histogram_sum", "WebSocket::__configure_analyzer", - "Cluster::Backend::ZeroMQ::spawn_zmq_proxy_thread", "__init_primary_bifs", "__init_secondary_bifs", "active_file", @@ -585,6 +583,13 @@ function fmt_str_set(s: set[string]): string return set_str; } + +const ignored_module_patterns: table[pattern] of bool = { + # ZeroMQ is only an optional dependency and the BiFs it + # provides aren't performance critical, ignore it. + [/^Cluster::Backend::ZeroMQ.*/] = T, +}; + event zeek_init() { local unseen_bifs = known_BiFs; @@ -597,6 +602,9 @@ event zeek_init() # format to that plus their body. fmt("%s", gi$value) == gn ) { + if ( |ignored_module_patterns[gn]| > 0 ) + next; + if ( gn in unseen_bifs ) { add seen_bifs[gn];