Merge branch 'topic/christian/gh-2134-fix-intel-test-races'

* topic/christian/gh-2134-fix-intel-test-races:
  Expand scripts.base.frameworks.intel.cluster-transparency test
  Fix races in scripts.base.frameworks.intel.cluster-transparency-with-proxy test
  Add Intel::send_store_on_node_up boolean to control min_data_store delivery
This commit is contained in:
Christian Kreibich 2022-06-02 12:19:32 -07:00
commit 1cebdd569d
11 changed files with 106 additions and 35 deletions

View file

@ -11,6 +11,11 @@ module Intel;
global insert_item: event(item: Item) &is_used;
global insert_indicator: event(item: Item) &is_used;
# By default the manager sends its current min_data_store to connecting workers.
# During testing it's handy to suppress this, since receipt of the store
# introduces nondeterminism when mixed with explicit data insertions.
const send_store_on_node_up = T &redef;
# If this process is not a manager process, we don't want the full metadata.
@if ( Cluster::local_node_type() != Cluster::MANAGER )
redef have_full_data = F;
@ -25,9 +30,10 @@ event zeek_init()
# Handling of new worker nodes.
event Cluster::node_up(name: string, id: string)
{
# When a worker connects, send it the complete minimal data store.
# It will be kept up to date after this by the insert_indicator event.
if ( name in Cluster::nodes && Cluster::nodes[name]$node_type == Cluster::WORKER )
# When a worker connects, send it the complete minimal data store unless
# we turned off that feature. The store will be kept up to date after
# this by the insert_indicator event.
if ( send_store_on_node_up && name in Cluster::nodes && Cluster::nodes[name]$node_type == Cluster::WORKER )
{
Broker::publish_id(Cluster::node_topic(name), "Intel::min_data_store");
}