mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Use .zeek file suffix in unit tests
This commit is contained in:
parent
93d384adeb
commit
1e57e3f026
862 changed files with 533 additions and 529 deletions
41
testing/btest/core/fake_dns.zeek
Normal file
41
testing/btest/core/fake_dns.zeek
Normal file
|
@ -0,0 +1,41 @@
|
|||
# @TEST-EXEC: BRO_DNS_FAKE=1 bro -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 bro_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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue