Test for input framework failing to find a file.

The output isn't the nicest yet ...
This commit is contained in:
Robin Sommer 2012-07-26 16:38:03 -07:00
parent 743fc1680d
commit 86ae7d8b7c
2 changed files with 35 additions and 0 deletions

View file

@ -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

View 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");
}