mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Merge remote-tracking branch 'origin/master' into topic/seth/sumstats-updates
This commit is contained in:
commit
ffe89e9cc0
11 changed files with 48 additions and 30 deletions
|
@ -39,6 +39,5 @@ event bro_init()
|
|||
try = 0;
|
||||
outfile = open("../out");
|
||||
Input::add_event([$source="cat > ../test.txt |", $reader=Input::READER_RAW, $mode=Input::STREAM, $name="input", $fields=Val, $ev=line, $want_record=F, $config=config_strings]);
|
||||
Input::remove("input");
|
||||
Input::add_event([$source="cat |", $reader=Input::READER_RAW, $mode=Input::STREAM, $name="input2", $fields=Val, $ev=line, $want_record=F, $config=config_strings]);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# @TEST-REQUIRES: which httpd
|
||||
# @TEST-REQUIRES: which python
|
||||
#
|
||||
# @TEST-EXEC: btest-bg-run httpd python $SCRIPTS/httpd.py --max 1
|
||||
|
@ -8,7 +7,7 @@
|
|||
# @TEST-EXEC: btest-diff bro/.stdout
|
||||
|
||||
@load base/utils/active-http
|
||||
|
||||
@load base/frameworks/communication # let network-time run. otherwise there are no heartbeats...
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
event bro_init()
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# @TEST-EXEC: btest-bg-run bro bro -b ../dirtest.bro
|
||||
# @TEST-EXEC: btest-bg-wait 10
|
||||
# @TEST-EXEC: btest-bg-wait 15
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-sort btest-diff bro/.stdout
|
||||
|
||||
@TEST-START-FILE dirtest.bro
|
||||
|
||||
@load base/utils/dir
|
||||
|
||||
@load base/frameworks/communication # let network-time run. otherwise there are no heartbeats...
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
global c: count = 0;
|
||||
|
@ -33,14 +33,20 @@ function new_file2(fname: string)
|
|||
event change_things()
|
||||
{
|
||||
system("touch ../testdir/newone");
|
||||
system("rm ../testdir/bye && touch ../testdir/bye");
|
||||
system("rm ../testdir/bye");
|
||||
}
|
||||
|
||||
event change_things2()
|
||||
{
|
||||
system("touch ../testdir/bye");
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
Dir::monitor("../testdir", new_file1, .5sec);
|
||||
Dir::monitor("../testdir", new_file2, 1sec);
|
||||
schedule 1sec { change_things() };
|
||||
schedule 3sec { change_things() };
|
||||
schedule 6sec { change_things2() };
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# @TEST-EXEC: btest-bg-run bro bro -b ../exectest.bro
|
||||
# @TEST-EXEC: btest-bg-wait 10
|
||||
# @TEST-EXEC: btest-bg-wait 15
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-sort btest-diff bro/.stdout
|
||||
|
||||
@TEST-START-FILE exectest.bro
|
||||
|
||||
@load base/utils/exec
|
||||
|
||||
@load base/frameworks/communication # let network-time run. otherwise there are no heartbeats...
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
global c: count = 0;
|
||||
|
@ -14,7 +14,7 @@ function check_exit_condition()
|
|||
{
|
||||
c += 1;
|
||||
|
||||
if ( c == 4 )
|
||||
if ( c == 3 )
|
||||
terminate();
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,8 @@ event bro_init()
|
|||
test_cmd("test1", [$cmd="bash ../somescript.sh",
|
||||
$read_files=set("out1", "out2")]);
|
||||
test_cmd("test2", [$cmd="bash ../nofiles.sh"]);
|
||||
test_cmd("test3", [$cmd="bash ../suicide.sh"]);
|
||||
# Not sure of a portable way to test signals yet.
|
||||
#test_cmd("test3", [$cmd="bash ../suicide.sh"]);
|
||||
test_cmd("test4", [$cmd="bash ../stdin.sh", $stdin="hibye"]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue