Add pcap_file option to supervised nodes.

This allows to start Supervised nodes with a pcap_file argument
rather than interface.

This is based on changes from @J-Gras.
This commit is contained in:
Jan Grashoefer 2022-07-08 17:31:20 +02:00 committed by Arne Welzel
parent 859ecc7b8b
commit 1882307cf3
7 changed files with 169 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# @TEST-DOC: Creating a node with inteface and pcap_file fails.
# @TEST-EXEC: zeek -j -b %INPUT >out
# @TEST-EXEC: btest-diff out
# Providing interface and pcap_file is an error.
event zeek_init()
{
print "is_supervisor", Supervisor::is_supervisor();
local sn = Supervisor::NodeConfig(
$name="grault",
$interface="lo",
$pcap_file="/dev/null",
);
local res = Supervisor::create(sn);
print res != "" ? "PASS (got error)" : " FAIL (no error)", res;
terminate();
}