zeek/testing/btest/core/fake_dns.zeek
Robin Sommer 789cb376fd GH-239: Rename bro to zeek, bro-config to zeek-config, and bro-path-dev to zeek-path-dev.
This also installs symlinks from "zeek" and "bro-config" to a wrapper
script that prints a deprecation warning.

The btests pass, but this is still WIP. broctl renaming is still
missing.

#239
2019-05-01 21:43:45 +00:00

41 lines
674 B
Text

# @TEST-EXEC: BRO_DNS_FAKE=1 zeek -b %INPUT >out
# @TEST-EXEC: btest-diff out
redef exit_only_after_terminate = T;
global addrs: set[addr] = {
google.com,
bing.com,
yahoo.com
};
global c: count = 0;
function check_terminate()
{
++c;
if ( c > 2 )
terminate();
}
event zeek_init()
{
print addrs;
when ( local result = lookup_hostname_txt("bro.wp.dg.cx") )
{
print "lookup_hostname_txt", result;
check_terminate();
}
when ( local result2 = lookup_hostname("example.com") )
{
print "lookup_hostname", result2;
check_terminate();
}
when ( local result3 = lookup_addr(1.2.3.4) )
{
print "lookup_addr", result3;
check_terminate();
}
}