zeek/testing/btest/scripts/base/frameworks/input/missing-file.bro
Robin Sommer 86ae7d8b7c Test for input framework failing to find a file.
The output isn't the nicest yet ...
2012-07-26 17:27:56 -07:00

30 lines
621 B
Text

# (uses listen.bro just to ensure input sources are more reliably fully-read).
# @TEST-SERIALIZE: comm
#
# @TEST-EXEC: btest-bg-run bro bro -b %INPUT
# @TEST-EXEC: btest-bg-wait -k 5
# @TEST-EXEC: btest-diff bro/.stderr
@load frameworks/communication/listen
global outfile: file;
global try: count;
module A;
type Val: record {
i: int;
b: bool;
};
event line(description: Input::EventDescription, tpe: Input::Event, i: int, b: bool)
{
}
event bro_init()
{
try = 0;
outfile = open("../out");
Input::add_event([$source="does-not-exist.dat", $name="input", $fields=Val, $ev=line]);
Input::remove("input");
}