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

* origin/fastpath: Add check for curl command to active-http.test I've moved the check from TEST-EXEC to TEST-REQUIRES. I think it's fine to just skip the test if curl is not available.
28 lines
664 B
Text
28 lines
664 B
Text
# @TEST-REQUIRES: which python
|
|
# @TEST-REQUIRES: which curl
|
|
#
|
|
# @TEST-EXEC: btest-bg-run httpd python $SCRIPTS/httpd.py --max 1
|
|
# @TEST-EXEC: sleep 3
|
|
# @TEST-EXEC: btest-bg-run bro bro -b %INPUT
|
|
# @TEST-EXEC: btest-bg-wait 15
|
|
# @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()
|
|
{
|
|
local req = ActiveHTTP::Request($url="localhost:32123");
|
|
|
|
when ( local resp = ActiveHTTP::request(req) )
|
|
{
|
|
print resp;
|
|
terminate();
|
|
}
|
|
timeout 1min
|
|
{
|
|
print "HTTP request timeout";
|
|
terminate();
|
|
}
|
|
}
|