zeek/testing/btest/scripts/base/protocols/conn/polling.test
Jon Siwek 59ed5c75f1 FileAnalysis: add unit tests covering current protocol integration.
And had to make various fixes/refinements after scrutinizing results.
2013-03-19 15:50:05 -05:00

20 lines
518 B
Text

# @TEST-EXEC: bro -b -r $TRACES/http/100-continue.trace %INPUT >out1
# @TEST-EXEC: btest-diff out1
# @TEST-EXEC: bro -b -r $TRACES/http/100-continue.trace %INPUT stop_cnt=2 >out2
# @TEST-EXEC: btest-diff out2
@load base/protocols/conn
const stop_cnt = 10 &redef;
function callback(c: connection, cnt: count): interval
{
print "callback", c$id, cnt;
return cnt >= stop_cnt ? -1 sec : .2 sec;
}
event new_connection(c: connection)
{
print "new_connection", c$id;
ConnPolling::watch(c, callback, 0, 0secs);
}