Input framework unit test adjustments.

- Generally increased the time allowed before they timeout.

- For tests w/ a clear termination condition (most of them), made
  timeouts result in a test failure.

- Seemed to be a race in some cases between tests generating output and
  the input reader stream getting removed/closed, so moved stream removal
  closer to termination time, when all output should be available.
This commit is contained in:
Jon Siwek 2013-08-14 14:10:04 -05:00
parent d3dad31bdc
commit 85084f2493
44 changed files with 92 additions and 71 deletions

View file

@ -3,7 +3,7 @@
#
# @TEST-EXEC: cat conn.sql | sqlite3 conn.sqlite
# @TEST-EXEC: btest-bg-run bro bro -b %INPUT
# @TEST-EXEC: btest-bg-wait -k 5
# @TEST-EXEC: btest-bg-wait 10
# @TEST-EXEC: btest-diff out
@TEST-START-FILE conn.sql

View file

@ -3,7 +3,7 @@
# @TEST-GROUP: sqlite
#
# @TEST-EXEC: btest-bg-run bro bro -b %INPUT
# @TEST-EXEC: btest-bg-wait -k 5
# @TEST-EXEC: btest-bg-wait 10
# @TEST-EXEC: sed '1d' .stderr | sort > cmpfile
# @TEST-EXEC: btest-diff cmpfile
@ -93,6 +93,6 @@ event bro_init()
Input::add_event([$source="../ssh", $name="ssh", $fields=SSH::Log, $ev=line, $reader=Input::READER_SQLITE, $want_record=T, $config=config_strings]);
Input::add_event([$source="../ssh", $name="ssh2", $fields=SSH::Log, $ev=line, $reader=Input::READER_SQLITE, $want_record=T, $config=config_strings2]);
schedule +1secs { term_me() };
schedule +3secs { term_me() };
}

View file

@ -3,7 +3,7 @@
#
# @TEST-EXEC: cat port.sql | sqlite3 port.sqlite
# @TEST-EXEC: btest-bg-run bro bro -b %INPUT
# @TEST-EXEC: btest-bg-wait -k 5
# @TEST-EXEC: btest-bg-wait 10
# @TEST-EXEC: btest-diff out
@TEST-START-FILE port.sql

View file

@ -3,7 +3,7 @@
# @TEST-GROUP: sqlite
#
# @TEST-EXEC: btest-bg-run bro bro -b %INPUT
# @TEST-EXEC: btest-bg-wait -k 5
# @TEST-EXEC: btest-bg-wait 10
# @TEST-EXEC: btest-diff out
@TEST-START-FILE ssh.sql