More bro-to-zeek renaming in the unit tests

This commit is contained in:
Daniel Thayer 2019-05-16 00:01:21 -05:00
parent 72b46268f7
commit 3f9e7138bd
71 changed files with 141 additions and 136 deletions

View file

@ -3990,7 +3990,7 @@ function lookup_location%(a: addr%) : geo_location
if ( ! missing_geoip_reported ) if ( ! missing_geoip_reported )
{ {
builtin_error("Bro was not configured for GeoIP support"); builtin_error("Zeek was not configured for GeoIP support");
missing_geoip_reported = 1; missing_geoip_reported = 1;
} }
#endif #endif
@ -4047,7 +4047,7 @@ function lookup_asn%(a: addr%) : count
if ( ! missing_geoip_reported ) if ( ! missing_geoip_reported )
{ {
builtin_error("Bro was not configured for GeoIP ASN support"); builtin_error("Zeek was not configured for GeoIP ASN support");
missing_geoip_reported = 1; missing_geoip_reported = 1;
} }
#endif #endif

View file

@ -1,13 +1,13 @@
This directory contains suites for testing for Bro's correct This directory contains suites for testing for Zeek's correct
operation: operation:
btest/ btest/
An ever-growing set of small unit tests testing Bro's An ever-growing set of small unit tests testing Zeek's
functionality. functionality.
external/ external/
A framework for downloading additional test sets that run more A framework for downloading additional test sets that run more
complex Bro configuration on larger traces files. Due to their complex Zeek configuration on larger traces files. Due to their
size, these are not included directly. See the README for more size, these are not included directly. See the README for more
information. information.

View file

@ -1 +1 @@
error in /Users/johanna/corelight/bro/testing/btest/.tmp/core.option-runtime-errors/option-runtime-errors.zeek, line 8: Could not find ID named 'B' (Option::set(B, 6, )) error in /Users/johanna/corelight/bro/testing/btest/.tmp/core.option-runtime-errors/option-runtime-errors.zeek, line 9: Could not find ID named 'B' (Option::set(B, 6, ))

View file

@ -1 +1 @@
1389719059.311687 warning in /Users/jsiwek/Projects/bro/bro/scripts/base/misc/find-filtered-trace.zeek, line 48: The analyzed trace file was determined to contain only TCP control packets, which may indicate it's been pre-filtered. By default, Bro reports the missing segments for this type of trace, but the 'detect_filtered_trace' option may be toggled if that's not desired. 1389719059.311687 warning in /Users/jsiwek/Projects/bro/bro/scripts/base/misc/find-filtered-trace.zeek, line 48: The analyzed trace file was determined to contain only TCP control packets, which may indicate it's been pre-filtered. By default, Zeek reports the missing segments for this type of trace, but the 'detect_filtered_trace' option may be toggled if that's not desired.

View file

@ -1,4 +1,4 @@
This a test suite of small "unit tests" that verify individual pieces of Bro This a test suite of small "unit tests" that verify individual pieces of Zeek
functionality. They all utilize BTest, a simple framework/driver for functionality. They all utilize BTest, a simple framework/driver for
writing unit tests. More information about BTest can be found at writing unit tests. More information about BTest can be found at
https://github.com/zeek/btest https://github.com/zeek/btest
@ -20,14 +20,14 @@ Significant Subdirectories
Packet captures utilized by the various BTest tests. Packet captures utilized by the various BTest tests.
* scripts/ * scripts/
This hierarchy of tests emulates the hierarchy of the Bro scripts/ This hierarchy of tests emulates the hierarchy of the Zeek scripts/
directory. directory.
* coverage/ * coverage/
This collection of tests relates to checking whether we're covering This collection of tests relates to checking whether we're covering
everything we want to in terms of tests, documentation, and which everything we want to in terms of tests, documentation, and which
scripts get loaded in different Bro configurations. These tests are scripts get loaded in different Zeek configurations. These tests are
more prone to fail as new Bro scripts are developed and added to the more prone to fail as new Zeek scripts are developed and added to the
distribution -- checking the individual test's comments is the best distribution -- checking the individual test's comments is the best
place to check for more details on what exactly the test is checking place to check for more details on what exactly the test is checking
and hints on how to fix it when it fails. and hints on how to fix it when it fails.
@ -48,7 +48,7 @@ run ``btest`` directly with desired options/arguments. Examples:
You can specify a directory on the command line to run just the You can specify a directory on the command line to run just the
tests contained in that directory. This is useful if you wish to tests contained in that directory. This is useful if you wish to
run all of a given type of test, without running all the tests run all of a given type of test, without running all the tests
there are. For example, "btest scripts" will run all of the Bro there are. For example, "btest scripts" will run all of the Zeek
script unit tests. script unit tests.

View file

@ -6,7 +6,7 @@
# @TEST-EXEC: btest-diff 2.hex # @TEST-EXEC: btest-diff 2.hex
# Note that the hex output will contain global pcap header information, # Note that the hex output will contain global pcap header information,
# including Bro's snaplen setting (so maybe check that out in the case # including Zeek's snaplen setting (so maybe check that out in the case
# you are reading this message due to this test failing in the future). # you are reading this message due to this test failing in the future).
global i: count = 0; global i: count = 0;

View file

@ -13,7 +13,7 @@ type R2: record {
event zeek_init() event zeek_init()
{ {
### Print every broker data type ### Print every Broker data type
print Broker::data_type(Broker::data(T)); print Broker::data_type(Broker::data(T));
print Broker::data_type(Broker::data(+1)); print Broker::data_type(Broker::data(+1));
print Broker::data_type(Broker::data(1)); print Broker::data_type(Broker::data(1));
@ -33,7 +33,7 @@ event zeek_init()
print "***************************"; print "***************************";
### Convert a Bro value to a broker value, then print the result ### Convert a Zeek value to a Broker value, then print the result
print (Broker::data(T) as bool); print (Broker::data(T) as bool);
print (Broker::data(F) as bool); print (Broker::data(F) as bool);

View file

@ -1,4 +1,5 @@
# @TEST-REQUIRES: grep -q "#undef ENABLE_MOBILE_IPV6" $BUILD/bro-config.h # @TEST-REQUIRES: grep -q "#undef ENABLE_MOBILE_IPV6" $BUILD/zeek-config.h
#
# @TEST-EXEC: zeek -r $TRACES/mobile-ipv6/mip6_back.trace %INPUT # @TEST-EXEC: zeek -r $TRACES/mobile-ipv6/mip6_back.trace %INPUT
# @TEST-EXEC: btest-diff weird.log # @TEST-EXEC: btest-diff weird.log

View file

@ -1,5 +1,5 @@
# Expressions in an event handler that raise interpreter exceptions # Expressions in an event handler that raise interpreter exceptions
# shouldn't abort Bro entirely, but just return from the function body. # shouldn't abort Zeek entirely, but just return from the function body.
# #
# @TEST-EXEC: zeek -r $TRACES/wikipedia.trace %INPUT >output # @TEST-EXEC: zeek -r $TRACES/wikipedia.trace %INPUT >output
# @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath | $SCRIPTS/diff-remove-timestamps" btest-diff reporter.log # @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath | $SCRIPTS/diff-remove-timestamps" btest-diff reporter.log

View file

@ -1,5 +1,5 @@
# This test has a trace that was generated from fuzzing which used to cause # This test has a trace that was generated from fuzzing which used to cause
# OOB reads in Bro. It has a number of packets broken in weird ways. # OOB reads in Zeek. It has a number of packets broken in weird ways.
# #
# @TEST-EXEC: gunzip -c $TRACES/trunc/mpls-6in6-broken.pcap.gz | zeek -C -b -r - %INPUT # @TEST-EXEC: gunzip -c $TRACES/trunc/mpls-6in6-broken.pcap.gz | zeek -C -b -r - %INPUT
# @TEST-EXEC: btest-diff weird.log # @TEST-EXEC: btest-diff weird.log

View file

@ -110,7 +110,7 @@ if ( did_it ) return;
did_it = T; did_it = T;
### Print every broker data type ### Print every Broker data type
print Broker::data_type(Broker::data(T)); print Broker::data_type(Broker::data(T));
print Broker::data_type(Broker::data(+1)); print Broker::data_type(Broker::data(+1));
@ -134,7 +134,7 @@ print Broker::data_type(Broker::data(r));
print "***************************"; print "***************************";
### Convert a Bro value to a broker value, then print the result ### Convert a Zeek value to a Broker value, then print the result
print (Broker::data(T)) as bool; print (Broker::data(T)) as bool;
print (Broker::data(F)) as bool; print (Broker::data(F)) as bool;
@ -175,7 +175,7 @@ print broker_to_bro_record(cr);
print "***************************"; print "***************************";
### Test the broker set BIFs ### Test the Broker set BIFs
cs = Broker::set_create(); cs = Broker::set_create();
print Broker::set_size(cs); print Broker::set_size(cs);
@ -197,7 +197,7 @@ print broker_to_bro_set(cs);
print "***************************"; print "***************************";
### Test the broker table BIFs ### Test the Broker table BIFs
ct = Broker::table_create(); ct = Broker::table_create();
print Broker::table_size(ct); print Broker::table_size(ct);
@ -221,7 +221,7 @@ print broker_to_bro_table(ct);
print "***************************"; print "***************************";
### Test the broker vector BIFs ### Test the Broker vector BIFs
cv = Broker::vector_create(); cv = Broker::vector_create();
print Broker::vector_size(cv); print Broker::vector_size(cv);
@ -244,7 +244,7 @@ print broker_to_bro_vector(cv);
print "***************************"; print "***************************";
### Test the broker record BIFs ### Test the Broker record BIFs
cr = Broker::record_create(3); cr = Broker::record_create(3);
print Broker::record_size(cr); print Broker::record_size(cr);

View file

@ -4,9 +4,9 @@
# #
# @TEST-GROUP: leaks # @TEST-GROUP: leaks
# #
# @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local btest-bg-run bro1 zeek -m -b -r $TRACES/tunnels/6in6.pcap %INPUT # @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local btest-bg-run zeek1 zeek -m -b -r $TRACES/tunnels/6in6.pcap %INPUT
# @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local btest-bg-run bro2 zeek -m -b -r $TRACES/tunnels/6in6in6.pcap %INPUT # @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local btest-bg-run zeek2 zeek -m -b -r $TRACES/tunnels/6in6in6.pcap %INPUT
# @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local btest-bg-run bro3 zeek -m -b -r $TRACES/tunnels/6in6-tunnel-change.pcap %INPUT # @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local btest-bg-run zeek3 zeek -m -b -r $TRACES/tunnels/6in6-tunnel-change.pcap %INPUT
# @TEST-EXEC: btest-bg-wait 60 # @TEST-EXEC: btest-bg-wait 60
event new_connection(c: connection) event new_connection(c: connection)

View file

@ -1,15 +1,15 @@
# This tests bro's mechanism to prevent duplicate script loading. # This tests Zeek's mechanism to prevent duplicate script loading.
# #
# @TEST-EXEC: mkdir -p foo/bar # @TEST-EXEC: mkdir -p foo/bar
# @TEST-EXEC: echo "@load bar/test" >loader.bro # @TEST-EXEC: echo "@load bar/test" >loader.zeek
# @TEST-EXEC: cp %INPUT foo/bar/test.bro # @TEST-EXEC: cp %INPUT foo/bar/test.zeek
# @TEST-EXEC: cp %INPUT foo/bar/test2.bro # @TEST-EXEC: cp %INPUT foo/bar/test2.zeek
# #
# @TEST-EXEC: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader bar/test # @TEST-EXEC: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader bar/test
# @TEST-EXEC: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader bar/test.bro # @TEST-EXEC: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader bar/test.zeek
# @TEST-EXEC: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader foo/bar/test # @TEST-EXEC: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader foo/bar/test
# @TEST-EXEC: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader foo/bar/test.bro # @TEST-EXEC: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader foo/bar/test.zeek
# @TEST-EXEC: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader `pwd`/foo/bar/test.bro # @TEST-EXEC: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader `pwd`/foo/bar/test.zeek
# @TEST-EXEC-FAIL: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader bar/test2 # @TEST-EXEC-FAIL: BROPATH=$BROPATH:.:./foo zeek -b misc/loaded-scripts loader bar/test2
global pi = 3.14; global pi = 3.14;

View file

@ -1,4 +1,5 @@
# @TEST-REQUIRES: grep -q "#define ENABLE_MOBILE_IPV6" $BUILD/bro-config.h # @TEST-REQUIRES: grep -q "#define ENABLE_MOBILE_IPV6" $BUILD/zeek-config.h
#
# @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/ipv6-mobile-hoa.trace %INPUT >output # @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/ipv6-mobile-hoa.trace %INPUT >output
# @TEST-EXEC: btest-diff output # @TEST-EXEC: btest-diff output

View file

@ -1,4 +1,5 @@
# @TEST-REQUIRES: grep -q "#define ENABLE_MOBILE_IPV6" $BUILD/bro-config.h # @TEST-REQUIRES: grep -q "#define ENABLE_MOBILE_IPV6" $BUILD/zeek-config.h
#
# @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/ipv6-mobile-routing.trace %INPUT >output # @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/ipv6-mobile-routing.trace %INPUT >output
# @TEST-EXEC: btest-diff output # @TEST-EXEC: btest-diff output

View file

@ -1,4 +1,5 @@
# @TEST-REQUIRES: grep -q "#define ENABLE_MOBILE_IPV6" $BUILD/bro-config.h # @TEST-REQUIRES: grep -q "#define ENABLE_MOBILE_IPV6" $BUILD/zeek-config.h
#
# @TEST-EXEC: zeek -r $TRACES/chksums/mip6-bad-mh-chksum.pcap # @TEST-EXEC: zeek -r $TRACES/chksums/mip6-bad-mh-chksum.pcap
# @TEST-EXEC: mv weird.log bad.out # @TEST-EXEC: mv weird.log bad.out
# @TEST-EXEC: zeek -r $TRACES/chksums/ip6-hoa-tcp-bad-chksum.pcap # @TEST-EXEC: zeek -r $TRACES/chksums/ip6-hoa-tcp-bad-chksum.pcap

View file

@ -1,4 +1,5 @@
# @TEST-REQUIRES: grep -q "#define ENABLE_MOBILE_IPV6" $BUILD/bro-config.h # @TEST-REQUIRES: grep -q "#define ENABLE_MOBILE_IPV6" $BUILD/zeek-config.h
#
# @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/mip6_back.trace %INPUT >output # @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/mip6_back.trace %INPUT >output
# @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/mip6_be.trace %INPUT >>output # @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/mip6_be.trace %INPUT >>output
# @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/mip6_brr.trace %INPUT >>output # @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/mip6_brr.trace %INPUT >>output

View file

@ -1,4 +1,4 @@
# Bro shouldn't crash when doing nothing, nor outputting anything. # Zeek shouldn't crash when doing nothing, nor outputting anything.
# #
# @TEST-EXEC: cat /dev/null | zeek >output 2>&1 # @TEST-EXEC: cat /dev/null | zeek >output 2>&1
# @TEST-EXEC: btest-diff output # @TEST-EXEC: btest-diff output

View file

@ -1,8 +1,9 @@
# @TEST-EXEC: zeek %INPUT # @TEST-EXEC: zeek %INPUT
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
# Errors that happen during runtime. At least at the moment we are not checking these early enough # Errors that happen during runtime. At least at the moment we are not
# that Bro will bail out during startup. Perhaps we want to change this later. # checking these early enough that Zeek will bail out during startup. Perhaps
# we want to change this later.
option A = 5; option A = 5;
Option::set("B", 6); Option::set("B", 6);

View file

@ -2,7 +2,7 @@
# @TEST-EXEC: btest-diff output # @TEST-EXEC: btest-diff output
# In old version, the event would keep triggering endlessely, with the network # In old version, the event would keep triggering endlessely, with the network
# time not moving forward and Bro not terminating. # time not moving forward and Zeek not terminating.
# #
# Note that the output will not be 20 because we still execute two rounds # Note that the output will not be 20 because we still execute two rounds
# of events every time we drain and also at startup several (currently 3) # of events every time we drain and also at startup several (currently 3)

View file

@ -1,7 +1,7 @@
# @TEST-EXEC: touch reporter.log && chmod -w reporter.log # @TEST-EXEC: touch reporter.log && chmod -w reporter.log
# @TEST-EXEC: zeek %INPUT >out 2>&1 # @TEST-EXEC: zeek %INPUT >out 2>&1
# Output doesn't really matter, but we just want to know that Bro shutdowns # Output doesn't really matter, but we just want to know that Zeek shutdowns
# without crashing in such scenarios (reporter log not writable # without crashing in such scenarios (reporter log not writable
# and also reporter errors being emitting during shutdown). # and also reporter errors being emitting during shutdown).

View file

@ -3,7 +3,7 @@
event tcp_packet(c: connection, is_orig: bool, flags: string, seq: count, ack: count, len: count, payload: string) event tcp_packet(c: connection, is_orig: bool, flags: string, seq: count, ack: count, len: count, payload: string)
{ {
# Just having this handler used to crash Bro on this trace. # Just having this handler used to crash Zeek on this trace.
print network_time(), c$id; print network_time(), c$id;
} }

View file

@ -8,7 +8,7 @@
# @TEST-EXEC: cat weird.log >> output # @TEST-EXEC: cat weird.log >> output
# If an ICMP packet's payload is truncated due to too small snaplen, # If an ICMP packet's payload is truncated due to too small snaplen,
# the checksum calculation is bypassed (and Bro doesn't crash, of course). # the checksum calculation is bypassed (and Zeek doesn't crash, of course).
# @TEST-EXEC: rm -f weird.log # @TEST-EXEC: rm -f weird.log
# @TEST-EXEC: zeek -r $TRACES/trunc/icmp-payload-trunc.pcap # @TEST-EXEC: zeek -r $TRACES/trunc/icmp-payload-trunc.pcap

View file

@ -10,5 +10,3 @@
# @TEST-EXEC: btest-diff output # @TEST-EXEC: btest-diff output
@load base/frameworks/notice/weird.bro

View file

@ -2,7 +2,7 @@
# This regression test checks a special case in the vector code. In this case # This regression test checks a special case in the vector code. In this case
# UnaryExpr will be called with a Type() of any. Tests succeeds if it does not # UnaryExpr will be called with a Type() of any. Tests succeeds if it does not
# crash Bro. # crash Zeek.
type OptionCacheValue: record { type OptionCacheValue: record {
val: any; val: any;

View file

@ -1,6 +1,6 @@
# @TEST-EXEC: zeek -b %INPUT # @TEST-EXEC: zeek -b %INPUT
# To support documentation of type aliases, Bro clones declared types # To support documentation of type aliases, Zeek clones declared types
# (see add_type() in Var.cc) in order to keep track of type names and aliases. # (see add_type() in Var.cc) in order to keep track of type names and aliases.
# This test makes sure that the cloning is done in a way that's compatible # This test makes sure that the cloning is done in a way that's compatible
# with adding fields to a record type -- we want to be sure that cloning # with adding fields to a record type -- we want to be sure that cloning

View file

@ -53,5 +53,5 @@ event zeek_init()
test_case("keys that are tuples", s1 == "1 2 hi"); test_case("keys that are tuples", s1 == "1 2 hi");
# Tests for key value for loop are in key-value-for.bro # Note: Tests for key value "for" loop are in key-value-for.zeek
} }

View file

@ -1,7 +1,7 @@
# @TEST-EXEC: zeek -b %INPUT secondtestfile >out # @TEST-EXEC: zeek -b %INPUT secondtestfile >out
# @TEST-EXEC: btest-diff out # @TEST-EXEC: btest-diff out
# This is the same test as "module.bro", but here we omit the module definition # This is the same test as "module.zeek", but here we omit the module definition
global num: count = 123; global num: count = 123;

View file

@ -1,7 +1,7 @@
# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1 # @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
# At least shouldn't crash Bro, just report the invalid record ctor. # At least shouldn't crash Zeek, just report the invalid record ctor.
global asdfasdf; global asdfasdf;
const blah = [$ports=asdfasdf]; const blah = [$ports=asdfasdf];

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Foo # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Demo Foo
# @TEST-EXEC: bash %INPUT # @TEST-EXEC: bash %INPUT
# @TEST-EXEC: ./configure --bro-dist=${DIST} --install-root=`pwd`/test-install # @TEST-EXEC: ./configure --bro-dist=${DIST} --install-root=`pwd`/test-install
# @TEST-EXEC: make # @TEST-EXEC: make

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Foo # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Demo Foo
# @TEST-EXEC: bash %INPUT # @TEST-EXEC: bash %INPUT
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output # @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Foo # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Demo Foo
# @TEST-EXEC: cp -r %DIR/file-plugin/* . # @TEST-EXEC: cp -r %DIR/file-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output # @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Hooks # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Demo Hooks
# @TEST-EXEC: cp -r %DIR/hooks-plugin/* . # @TEST-EXEC: cp -r %DIR/hooks-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_ACTIVATE="Demo::Hooks" BRO_PLUGIN_PATH=`pwd` zeek -b -r $TRACES/http/get.trace %INPUT 2>&1 | $SCRIPTS/diff-remove-abspath | sort | uniq >output # @TEST-EXEC: BRO_PLUGIN_ACTIVATE="Demo::Hooks" BRO_PLUGIN_PATH=`pwd` zeek -b -r $TRACES/http/get.trace %INPUT 2>&1 | $SCRIPTS/diff-remove-abspath | sort | uniq >output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Foo # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Demo Foo
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output # @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output
# @TEST-EXEC: echo === >>output # @TEST-EXEC: echo === >>output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Log Hooks # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Log Hooks
# @TEST-EXEC: cp -r %DIR/logging-hooks-plugin/* . # @TEST-EXEC: cp -r %DIR/logging-hooks-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_ACTIVATE="Log::Hooks" BRO_PLUGIN_PATH=`pwd` zeek -b %INPUT 2>&1 | $SCRIPTS/diff-remove-abspath | sort | uniq >output # @TEST-EXEC: BRO_PLUGIN_ACTIVATE="Log::Hooks" BRO_PLUGIN_PATH=`pwd` zeek -b %INPUT 2>&1 | $SCRIPTS/diff-remove-abspath | sort | uniq >output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Foo # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Demo Foo
# @TEST-EXEC: cp -r %DIR/pktdumper-plugin/* . # @TEST-EXEC: cp -r %DIR/pktdumper-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output # @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Foo # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Demo Foo
# @TEST-EXEC: cp -r %DIR/pktsrc-plugin/* . # @TEST-EXEC: cp -r %DIR/pktsrc-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output # @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Testing NoPatchVersion # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Testing NoPatchVersion
# @TEST-EXEC: cp -r %DIR/plugin-nopatchversion-plugin/* . # @TEST-EXEC: cp -r %DIR/plugin-nopatchversion-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=$(pwd) zeek -N Testing::NoPatchVersion >> output # @TEST-EXEC: BRO_PLUGIN_PATH=$(pwd) zeek -N Testing::NoPatchVersion >> output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Testing WithPatchVersion # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Testing WithPatchVersion
# @TEST-EXEC: cp -r %DIR/plugin-withpatchversion-plugin/* . # @TEST-EXEC: cp -r %DIR/plugin-withpatchversion-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=$(pwd) zeek -N Testing::WithPatchVersion >> output # @TEST-EXEC: BRO_PLUGIN_PATH=$(pwd) zeek -N Testing::WithPatchVersion >> output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Foo # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Demo Foo
# @TEST-EXEC: cp -r %DIR/protocol-plugin/* . # @TEST-EXEC: cp -r %DIR/protocol-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output # @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Foo # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Demo Foo
# @TEST-EXEC: cp -r %DIR/reader-plugin/* . # @TEST-EXEC: cp -r %DIR/reader-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output # @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Reporter Hook # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Reporter Hook
# @TEST-EXEC: cp -r %DIR/reporter-hook-plugin/* . # @TEST-EXEC: cp -r %DIR/reporter-hook-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_ACTIVATE="Reporter::Hook" BRO_PLUGIN_PATH=`pwd` zeek -b %INPUT 2>&1 | $SCRIPTS/diff-remove-abspath | sort | uniq >output # @TEST-EXEC: BRO_PLUGIN_ACTIVATE="Reporter::Hook" BRO_PLUGIN_PATH=`pwd` zeek -b %INPUT 2>&1 | $SCRIPTS/diff-remove-abspath | sort | uniq >output

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Foo # @TEST-EXEC: ${DIST}/aux/zeek-aux/plugin-support/init-plugin -u . Demo Foo
# @TEST-EXEC: cp -r %DIR/writer-plugin/* . # @TEST-EXEC: cp -r %DIR/writer-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make # @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output # @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output

View file

@ -1,7 +1,7 @@
# @TEST-EXEC: btest-bg-run broproc zeek %INPUT # @TEST-EXEC: btest-bg-run zeekproc zeek %INPUT
# @TEST-EXEC: btest-bg-wait -k 21 # @TEST-EXEC: btest-bg-wait -k 21
# @TEST-EXEC: cat broproc/intel.log > output # @TEST-EXEC: cat zeekproc/intel.log > output
# @TEST-EXEC: cat broproc/.stdout >> output # @TEST-EXEC: cat zeekproc/.stdout >> output
# @TEST-EXEC: btest-diff output # @TEST-EXEC: btest-diff output
# @TEST-START-FILE intel.dat # @TEST-START-FILE intel.dat

View file

@ -1,7 +1,7 @@
# @TEST-EXEC: btest-bg-run broproc zeek %INPUT # @TEST-EXEC: btest-bg-run zeekproc zeek %INPUT
# @TEST-EXEC: btest-bg-wait -k 5 # @TEST-EXEC: btest-bg-wait -k 5
# @TEST-EXEC: btest-diff broproc/intel.log # @TEST-EXEC: btest-diff zeekproc/intel.log
@TEST-START-FILE intel.dat @TEST-START-FILE intel.dat
#fields indicator indicator_type meta.source meta.desc meta.url #fields indicator indicator_type meta.source meta.desc meta.url

View file

@ -1,7 +1,7 @@
# @TEST-EXEC: btest-bg-run broproc zeek %INPUT # @TEST-EXEC: btest-bg-run zeekproc zeek %INPUT
# @TEST-EXEC: btest-bg-wait -k 5 # @TEST-EXEC: btest-bg-wait -k 5
# @TEST-EXEC: btest-diff broproc/intel.log # @TEST-EXEC: btest-diff zeekproc/intel.log
@TEST-START-FILE intel.dat @TEST-START-FILE intel.dat
#fields indicator indicator_type meta.source meta.desc meta.url #fields indicator indicator_type meta.source meta.desc meta.url

View file

@ -1,7 +1,7 @@
# @TEST-EXEC: btest-bg-run broproc zeek %INPUT # @TEST-EXEC: btest-bg-run zeekproc zeek %INPUT
# @TEST-EXEC: btest-bg-wait -k 5 # @TEST-EXEC: btest-bg-wait -k 5
# @TEST-EXEC: cat broproc/intel.log > output # @TEST-EXEC: cat zeekproc/intel.log > output
# @TEST-EXEC: cat broproc/.stdout >> output # @TEST-EXEC: cat zeekproc/.stdout >> output
# @TEST-EXEC: btest-diff output # @TEST-EXEC: btest-diff output
# @TEST-START-FILE intel.dat # @TEST-START-FILE intel.dat

View file

@ -1,7 +1,7 @@
# @TEST-EXEC: btest-bg-run broproc zeek %INPUT # @TEST-EXEC: btest-bg-run zeekproc zeek %INPUT
# @TEST-EXEC: btest-bg-wait -k 5 # @TEST-EXEC: btest-bg-wait -k 5
# @TEST-EXEC: cat broproc/reporter.log > output # @TEST-EXEC: cat zeekproc/reporter.log > output
# @TEST-EXEC: cat broproc/.stdout >> output # @TEST-EXEC: cat zeekproc/.stdout >> output
# @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath | $SCRIPTS/diff-remove-timestamps" btest-diff output # @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath | $SCRIPTS/diff-remove-timestamps" btest-diff output
# @TEST-START-FILE intel.dat # @TEST-START-FILE intel.dat

View file

@ -1,6 +1,6 @@
# #
# @TEST-EXEC: zeek -b -r ${TRACES}/rotation.trace %INPUT >bro.out 2>&1 # @TEST-EXEC: zeek -b -r ${TRACES}/rotation.trace %INPUT >zeek.out 2>&1
# @TEST-EXEC: grep "test" bro.out | sort >out # @TEST-EXEC: grep "test" zeek.out | sort >out
# @TEST-EXEC: for i in `ls test.*.log | sort`; do printf '> %s\n' $i; cat $i; done >>out # @TEST-EXEC: for i in `ls test.*.log | sort`; do printf '> %s\n' $i; cat $i; done >>out
# @TEST-EXEC: btest-diff out # @TEST-EXEC: btest-diff out

View file

@ -21,7 +21,7 @@ print Version::parse("12.5");
print Version::parse("1.12-beta-drunk"); print Version::parse("1.12-beta-drunk");
print Version::parse("JustARandomString"); print Version::parse("JustARandomString");
# check that current running version of Bro parses without error # check that current running version of Zeek parses without error
Version::parse(bro_version()); Version::parse(bro_version());
@TEST-START-NEXT @TEST-START-NEXT

View file

@ -2,7 +2,7 @@
# Kerberos analyzer can open the AD ticket in the Negociate # Kerberos analyzer can open the AD ticket in the Negociate
# Protocol Request and find the user. # Protocol Request and find the user.
# #
# @TEST-REQUIRES: grep -q "#define USE_KRB5" $BUILD/bro-config.h # @TEST-REQUIRES: grep -q "#define USE_KRB5" $BUILD/zeek-config.h
# #
# @TEST-COPY-FILE: ${TRACES}/krb/smb2_krb.keytab # @TEST-COPY-FILE: ${TRACES}/krb/smb2_krb.keytab
# @TEST-EXEC: zeek -b -C -r $TRACES/krb/smb2_krb.pcap %INPUT # @TEST-EXEC: zeek -b -C -r $TRACES/krb/smb2_krb.pcap %INPUT

View file

@ -1,7 +1,7 @@
# This test verifies that without a keytab file no entries are # This test verifies that without a keytab file no entries are
# created and no errors happen. # created and no errors happen.
# #
# @TEST-REQUIRES: grep -q "#define USE_KRB5" $BUILD/bro-config.h # @TEST-REQUIRES: grep -q "#define USE_KRB5" $BUILD/zeek-config.h
# #
# @TEST-COPY-FILE: ${TRACES}/krb/smb2_krb.keytab # @TEST-COPY-FILE: ${TRACES}/krb/smb2_krb.keytab
# @TEST-EXEC: zeek -C -r $TRACES/krb/smb2_krb.pcap %INPUT # @TEST-EXEC: zeek -C -r $TRACES/krb/smb2_krb.pcap %INPUT

View file

@ -5,4 +5,4 @@
# the binpac-generated analyzer code to throw a binpac::ExceptionOutOfBound. # the binpac-generated analyzer code to throw a binpac::ExceptionOutOfBound.
# This should be correctly caught as a type of binpac::Exception and the # This should be correctly caught as a type of binpac::Exception and the
# binpac::ModbusTCP::Exception type that's defined as part of the analyzer # binpac::ModbusTCP::Exception type that's defined as part of the analyzer
# shouldn't interfere with that handling and definitely shouldn't crash bro. # shouldn't interfere with that handling and definitely shouldn't crash Zeek.

View file

@ -1,8 +1,9 @@
# This tests how Bro deals with encrypted connections. Right now, it doesn't log them as it # This tests how Zeek deals with encrypted connections. Right now, it
# can't parse much of value. We're testing for an empty mysql.log file. # doesn't log them as it can't parse much of value. We're testing for an
# empty mysql.log file.
# @TEST-EXEC: touch mysql.log # @TEST-EXEC: touch mysql.log
# @TEST-EXEC: zeek -b -r $TRACES/mysql/encrypted.trace %INPUT # @TEST-EXEC: zeek -b -r $TRACES/mysql/encrypted.trace %INPUT
# @TEST-EXEC: btest-diff mysql.log # @TEST-EXEC: btest-diff mysql.log
@load base/protocols/mysql @load base/protocols/mysql

View file

@ -1,4 +1,4 @@
# This tests if Bro does not crash when exposed to CVE-2015-3194 # This tests if Zeek does not crash when exposed to CVE-2015-3194
# @TEST-EXEC: zeek -r $TRACES/tls/CVE-2015-3194.pcap %INPUT # @TEST-EXEC: zeek -r $TRACES/tls/CVE-2015-3194.pcap %INPUT
# @TEST-EXEC: btest-diff ssl.log # @TEST-EXEC: btest-diff ssl.log

View file

@ -1,7 +1,7 @@
# @TEST-EXEC: btest-bg-run broproc zeek %INPUT # @TEST-EXEC: btest-bg-run zeekproc zeek %INPUT
# @TEST-EXEC: btest-bg-wait -k 5 # @TEST-EXEC: btest-bg-wait -k 5
# @TEST-EXEC: btest-diff broproc/intel.log # @TEST-EXEC: btest-diff zeekproc/intel.log
@TEST-START-FILE intel.dat @TEST-START-FILE intel.dat
#fields indicator indicator_type meta.source meta.remove #fields indicator indicator_type meta.source meta.remove

View file

@ -1,14 +1,14 @@
# @TEST-EXEC: zeek local-`cat $DIST/VERSION | sed 's/\([0-9].[0-9]\).*/\1/g'`.bro # @TEST-EXEC: zeek local-`cat $DIST/VERSION | sed 's/\([0-9].[0-9]\).*/\1/g'`.bro
# This tests the compatibility of the past release's site/local.bro # This tests the compatibility of the past release's site/local.bro
# script with the current version of Bro. If the test fails because # script with the current version of Zeek. If the test fails because
# it doesn't find the right file, that means everything stayed # it doesn't find the right file, that means everything stayed
# compatibile between releases, so just add a TEST-START-FILE with # compatibile between releases, so just add a TEST-START-FILE with
# the contents the latest Bro version's site/local.zeek script. # the contents the latest Zeek version's site/local.zeek script.
# If the test fails while loading the old local.bro, it usually # If the test fails while loading the old local.bro, it usually
# indicates a note will need to be made in NEWS explaining to users # indicates a note will need to be made in NEWS explaining to users
# how to migrate to the new version and this test's TEST-START-FILE # how to migrate to the new version and this test's TEST-START-FILE
# should be updated with the latest contents of site/local.bro. # should be updated with the latest contents of site/local.zeek.
@TEST-START-FILE local-2.6.bro @TEST-START-FILE local-2.6.bro
##! Local site policy. Customize as appropriate. ##! Local site policy. Customize as appropriate.

View file

@ -1,5 +1,5 @@
On a Bro build configured with --enable-coverage, this script produces a code On a Zeek build configured with --enable-coverage, this script produces a code
coverage report after Bro has been invoked. The intended application of this coverage report after Zeek has been invoked. The intended application of this
script is after the btest testsuite has run. This combination (btests first, script is after the btest testsuite has run. This combination (btests first,
coverage computation afterward) happens automatically when running "make" in coverage computation afterward) happens automatically when running "make" in
the testing directory. This script puts .gcov files (which are included in the testing directory. This script puts .gcov files (which are included in

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# On a Bro build configured with --enable-coverage, this script # On a Zeek build configured with --enable-coverage, this script
# produces a code coverage report after Bro has been invoked. The # produces a code coverage report after Zeek has been invoked. The
# intended application of this script is after the btest testsuite has # intended application of this script is after the btest testsuite has
# run. This combination (btests first, coverage computation afterward) # run. This combination (btests first, coverage computation afterward)
# happens automatically when running "make" in the testing directory. # happens automatically when running "make" in the testing directory.
@ -12,7 +12,7 @@
# 1. Run test suite # 1. Run test suite
# 2. Check for .gcda files existing. # 2. Check for .gcda files existing.
# 3a. Run gcov (-p to preserve path) # 3a. Run gcov (-p to preserve path)
# 3b. Prune .gcov files for objects outside of the Bro tree # 3b. Prune .gcov files for objects outside of the Zeek tree
# 4a. Analyze .gcov files generated and create summary file # 4a. Analyze .gcov files generated and create summary file
# 4b. Send .gcov files to appropriate path # 4b. Send .gcov files to appropriate path
# #
@ -52,7 +52,7 @@ function check_file_coverage {
function check_group_coverage { function check_group_coverage {
DATA="$1" # FILE CONTAINING COVERAGE DATA DATA="$1" # FILE CONTAINING COVERAGE DATA
SRC_FOLDER="$2" # WHERE BRO WAS COMPILED SRC_FOLDER="$2" # WHERE ZEEK WAS COMPILED
OUTPUT="$3" OUTPUT="$3"
# Prints all the relevant directories # Prints all the relevant directories
@ -117,9 +117,9 @@ else
exit 1 exit 1
fi fi
# 3b. Prune gcov files that fall outside of the Bro tree: # 3b. Prune gcov files that fall outside of the Zeek tree:
# Look for files containing gcov's slash substitution character "#" # Look for files containing gcov's slash substitution character "#"
# and remove any that don't contain the Bro path root. # and remove any that don't contain the Zeek path root.
echo -n "Pruning out-of-tree coverage files... " echo -n "Pruning out-of-tree coverage files... "
PREFIX=$(echo "$BASE" | sed 's|/|#|g') PREFIX=$(echo "$BASE" | sed 's|/|#|g')
for i in "$TMP"/*#*.gcov; do for i in "$TMP"/*#*.gcov; do

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# On a Bro build configured with --enable-coverage, this script # On a Zeek build configured with --enable-coverage, this script
# produces a code coverage report in HTML format after Bro has been invoked. The # produces a code coverage report in HTML format after Zeek has been invoked. The
# intended application of this script is after the btest testsuite has run. # intended application of this script is after the btest testsuite has run.
# This depends on lcov to run. # This depends on lcov to run.

View file

@ -2,9 +2,9 @@
Test Suite for Large Trace Files Test Suite for Large Trace Files
================================ ================================
This test-suite runs more complex Bro configurations on larger trace This test-suite runs more complex Zeek configurations on larger trace
files, and compares the results to a pre-established baseline. Due to files, and compares the results to a pre-established baseline. Due to
their size, both traces and baseline are not part of the main Bro their size, both traces and baseline are not part of the main Zeek
repository but kept externally. In addition to the publically provided repository but kept externally. In addition to the publically provided
files, one can also add a local set to the test-suite for running on files, one can also add a local set to the test-suite for running on
private traces. private traces.
@ -60,7 +60,7 @@ To update a test's baseline, first run ``btest`` in update mode:
.. console: .. console:
> cd bro-testing > cd zeek-testing
> btest -u tests/test-you-want-to-update > btest -u tests/test-you-want-to-update
Then use ``git`` to commit the changes and push the changes upstream Then use ``git`` to commit the changes and push the changes upstream

View file

@ -27,7 +27,7 @@ for i in `echo $files_cwd $files_baseline | sort | uniq`; do
if [[ "$i" == "reporter.log" ]]; then if [[ "$i" == "reporter.log" ]]; then
# Do not diff the reporter.log if it only complains about missing # Do not diff the reporter.log if it only complains about missing
# GeoIP support. # GeoIP support.
if ! egrep -v "^#|Bro was not configured for GeoIP support" $i; then if ! egrep -v "^#|Zeek was not configured for GeoIP support" $i; then
continue continue
fi fi
fi fi

View file

@ -5,6 +5,6 @@
# #
# Returns an exit code > 0 if there's a leak. # Returns an exit code > 0 if there's a leak.
cat $1 | sed "s#bro *\"\./#../../../build/src/bro \".tmp/$TEST_NAME/#g" | sed 's/ *--gv//g' >$1.tmp && mv $1.tmp $1 cat $1 | sed "s#zeek *\"\./#../../../build/src/zeek \".tmp/$TEST_NAME/#g" | sed 's/ *--gv//g' >$1.tmp && mv $1.tmp $1
grep -qv "detected leaks of" $1 grep -qv "detected leaks of" $1

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: zcat $TRACES/trace.gz | bro -r - %INPUT # @TEST-EXEC: zcat $TRACES/trace.gz | zeek -r - %INPUT
# @TEST-EXEC: $SCRIPTS/diff-all '*.log' # @TEST-EXEC: $SCRIPTS/diff-all '*.log'
@load testing-setup @load testing-setup

View file

@ -9,6 +9,6 @@
@ifdef ( LogAscii::use_json ) @ifdef ( LogAscii::use_json )
# Don't start logging everything as JSON. # Don't start logging everything as JSON.
# (json-logs.bro activates this). # (json-logs.zeek activates this).
redef LogAscii::use_json = F; redef LogAscii::use_json = F;
@endif @endif

View file

@ -1,12 +1,12 @@
#! /usr/bin/env python #! /usr/bin/env python
# This script aggregates many files containing Bro script coverage information # This script aggregates many files containing Zeek script coverage information
# into a single file and reports the overall coverage information. Usage: # into a single file and reports the overall coverage information. Usage:
# #
# coverage-calc <quoted glob of filenames> <output file> <script dir> # coverage-calc <quoted glob of filenames> <output file> <script dir>
# #
# The last argument is used to point to a root directory containing all # The last argument is used to point to a root directory containing all
# the Bro distribution's scripts. It's used to cull out test scripts # the Zeek distribution's scripts. It's used to cull out test scripts
# that are not part of the distribution and which should not count towards # that are not part of the distribution and which should not count towards
# the coverage calculation. # the coverage calculation.
@ -27,7 +27,7 @@ for filename in glob.glob(inputglob):
# grab file path and line numbers separately # grab file path and line numbers separately
filepath, srclines = parts[1].rsplit(",", 1) filepath, srclines = parts[1].rsplit(",", 1)
filepath = os.path.normpath(filepath) filepath = os.path.normpath(filepath)
# ignore scripts that don't appear to be part of Bro distribution # ignore scripts that don't appear to be part of Zeek distribution
if not filepath.startswith(scriptdir): if not filepath.startswith(scriptdir):
continue continue
# keep only the line number (or line number range) # keep only the line number (or line number range)
@ -56,4 +56,4 @@ for k in stats:
num_covered += 1 num_covered += 1
if len(stats) > 0: if len(stats) > 0:
print("%s/%s (%.1f%%) Bro script statements covered." % (num_covered, len(stats), float(num_covered)/len(stats)*100)) print("%s/%s (%.1f%%) Zeek script statements covered." % (num_covered, len(stats), float(num_covered)/len(stats)*100))

View file

@ -1,6 +1,6 @@
#! /usr/bin/env bash #! /usr/bin/env bash
# #
# Returns true if Bro has been compiled with support for writer type # Returns true if Zeek has been compiled with support for writer type
# $1. The type name must match the plugin name that "zeek -N" prints. # $1. The type name must match the plugin name that "zeek -N" prints.
zeek -N | grep -q $1 >/dev/null zeek -N | grep -q $1 >/dev/null

View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# This script (along with the .travis.yml file) is used by Travis CI to # This script (along with the .travis.yml file) is used by Travis CI to
# build Bro and run the tests. # build Zeek and run the tests.
# #
# This script can also be used outside of Travis (the "all" build step is # This script can also be used outside of Travis (the "all" build step is
# especially convenient in this case). Note that if you use this script # especially convenient in this case). Note that if you use this script
@ -12,7 +12,7 @@ usage() {
echo "usage: $0 CMD DISTRO" echo "usage: $0 CMD DISTRO"
echo " CMD is a build step:" echo " CMD is a build step:"
echo " install: install prereqs" echo " install: install prereqs"
echo " build: build bro" echo " build: build zeek"
echo " run: run the tests" echo " run: run the tests"
echo " all: do all of the above" echo " all: do all of the above"
echo " DISTRO is a Linux distro, 'travis' to run without docker, or 'coverity' to run a coverity scan" echo " DISTRO is a Linux distro, 'travis' to run without docker, or 'coverity' to run a coverity scan"
@ -47,7 +47,7 @@ install_coverity() {
} }
# Build Bro with the coverity tools. # Build Zeek with the coverity tools.
build_coverity() { build_coverity() {
# Cleanup any previous build (this is really only necessary if running this # Cleanup any previous build (this is really only necessary if running this
# outside of Travis). # outside of Travis).
@ -64,7 +64,7 @@ build_coverity() {
# Create a tar file and send it to coverity. # Create a tar file and send it to coverity.
run_coverity() { run_coverity() {
EMAIL=bro-commits-internal@bro.org EMAIL=zeek-commits-internal@zeek.org
FILE=myproject.tgz FILE=myproject.tgz
VER=`cat VERSION` VER=`cat VERSION`
DESC=`git rev-parse HEAD` DESC=`git rev-parse HEAD`
@ -76,7 +76,7 @@ run_coverity() {
} }
# Create a docker container, and install all packages needed to build Bro. # Create a docker container, and install all packages needed to build Zeek.
install_in_docker() { install_in_docker() {
case $distro in case $distro in
centos_7) centos_7)
@ -101,31 +101,31 @@ install_in_docker() {
esac esac
docker_image=`echo $distro | tr '_' ':'` docker_image=`echo $distro | tr '_' ':'`
docker run --name brotest -id -v "`pwd`:/bro" -w /bro ${docker_image} sh docker run --name zeektest -id -v "`pwd`:/zeek" -w /zeek ${docker_image} sh
docker exec brotest sh -c "${distro_cmds}" docker exec zeektest sh -c "${distro_cmds}"
} }
# Build bro in a docker container. # Build Zeek in a docker container.
build_in_docker() { build_in_docker() {
docker exec brotest sh testing/scripts/travis-job build travis docker exec zeektest sh testing/scripts/travis-job build travis
} }
# Run Bro tests in a docker container. # Run Zeek tests in a docker container.
run_in_docker() { run_in_docker() {
docker exec -t -e TRAVIS -e TRAVIS_PULL_REQUEST -e TESTING_PRIVATE_DEPLOYKEY brotest sh testing/scripts/travis-job run travis docker exec -t -e TRAVIS -e TRAVIS_PULL_REQUEST -e TESTING_PRIVATE_DEPLOYKEY zeektest sh testing/scripts/travis-job run travis
} }
# Build Bro. # Build Zeek.
build() { build() {
# Cleanup any previous build (this is really only necessary if running this # Cleanup any previous build (this is really only necessary if running this
# outside of Travis). # outside of Travis).
make distclean > /dev/null make distclean > /dev/null
# Skip building broker tests, python bindings, and zeekctl, as these are # Skip building Broker tests, python bindings, and zeekctl, as these are
# not needed by the bro tests. # not needed by the Zeek tests.
./configure --build-type=Release --disable-broker-tests --disable-python --disable-zeekctl && make -j 2 ./configure --build-type=Release --disable-broker-tests --disable-python --disable-zeekctl && make -j 2
} }
@ -159,7 +159,7 @@ get_private_tests() {
} }
# Run Bro tests. # Run Zeek tests.
run() { run() {
ulimit -c unlimited ulimit -c unlimited
ulimit -a ulimit -a
@ -271,12 +271,12 @@ showdiag() {
# Remove the docker container. # Remove the docker container.
remove_container() { remove_container() {
echo "Removing the docker container..." echo "Removing the docker container..."
docker rm -f brotest > /dev/null docker rm -f zeektest > /dev/null
} }
if [ ! -f testing/scripts/travis-job ]; then if [ ! -f testing/scripts/travis-job ]; then
echo "Error: must change directory to root of bro source tree before running this script." echo "Error: must change directory to root of zeek source tree before running this script."
exit 1 exit 1
fi fi
@ -329,7 +329,7 @@ if [ "${TRAVIS_EVENT_TYPE}" = "cron" ] || [ "$distro" = "coverity" ]; then
run_coverity run_coverity
fi fi
elif [ "$distro" = "travis" ]; then elif [ "$distro" = "travis" ]; then
# Build bro and run tests. # Build Zeek and run tests.
# The "build" and "run" steps are split up into separate steps because the # The "build" and "run" steps are split up into separate steps because the
# build outputs thousands of lines (which are conveniently collapsed into # build outputs thousands of lines (which are conveniently collapsed into
@ -343,7 +343,7 @@ elif [ "$distro" = "travis" ]; then
run run
fi fi
else else
# Build bro and run tests in a docker container. # Build Zeek and run tests in a docker container.
if [ "$step" = "install" ]; then if [ "$step" = "install" ]; then
install_in_docker install_in_docker