mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Test for input framework failing to find a file.
The output isn't the nicest yet ...
This commit is contained in:
parent
743fc1680d
commit
86ae7d8b7c
2 changed files with 35 additions and 0 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
error: does-not-exist.dat/Input::READER_ASCII: Init: cannot open does-not-exist.dat
|
||||||
|
error: does-not-exist.dat/Input::READER_ASCII: Init failed
|
||||||
|
warning: Stream input is already queued for removal. Ignoring remove.
|
||||||
|
error: does-not-exist.dat/Input::READER_ASCII: terminating thread
|
||||||
|
received termination signal
|
30
testing/btest/scripts/base/frameworks/input/missing-file.bro
Normal file
30
testing/btest/scripts/base/frameworks/input/missing-file.bro
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# (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");
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue