mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00

Generally tried to make them more reliable and execute quicker. They all now load the listen script as a trick to make sure input sources are fully read, but also terminate() at appropriate times so that they don't take more time than needed. They're also all serialized with the 'comm' group so listening on a port doesn't interfere with the communication tests.
42 lines
921 B
Text
42 lines
921 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: cat out.tmp | sed 's/^ *//g' >out
|
|
# @TEST-EXEC: btest-diff out
|
|
|
|
@TEST-START-FILE input.log
|
|
sdfkh:KH;fdkncv;ISEUp34:Fkdj;YVpIODhfDF
|
|
DSF"DFKJ"SDFKLh304yrsdkfj@#(*U$34jfDJup3UF
|
|
q3r3057fdf
|
|
sdfs\d
|
|
|
|
dfsdf
|
|
sdf
|
|
3rw43wRRERLlL#RWERERERE.
|
|
@TEST-END-FILE
|
|
|
|
@load frameworks/communication/listen
|
|
|
|
global outfile: file;
|
|
|
|
type Val: record {
|
|
s: string;
|
|
};
|
|
|
|
event line(description: Input::EventDescription, tpe: Input::Event, s: string)
|
|
{
|
|
print outfile, description;
|
|
print outfile, tpe;
|
|
print outfile, s;
|
|
close(outfile);
|
|
terminate();
|
|
}
|
|
|
|
event bro_init()
|
|
{
|
|
outfile = open("../out.tmp");
|
|
Input::add_event([$source="wc -l ../input.log |", $reader=Input::READER_RAW, $name="input", $fields=Val, $ev=line]);
|
|
Input::remove("input");
|
|
}
|