mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
More bro-to-zeek renaming in the unit tests
This commit is contained in:
parent
72b46268f7
commit
3f9e7138bd
71 changed files with 141 additions and 136 deletions
|
@ -3990,7 +3990,7 @@ function lookup_location%(a: addr%) : geo_location
|
|||
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
@ -4047,7 +4047,7 @@ function lookup_asn%(a: addr%) : count
|
|||
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -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:
|
||||
|
||||
btest/
|
||||
An ever-growing set of small unit tests testing Bro's
|
||||
An ever-growing set of small unit tests testing Zeek's
|
||||
functionality.
|
||||
|
||||
external/
|
||||
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
|
||||
information.
|
||||
|
||||
|
|
|
@ -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, ))
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
writing unit tests. More information about BTest can be found at
|
||||
https://github.com/zeek/btest
|
||||
|
@ -20,14 +20,14 @@ Significant Subdirectories
|
|||
Packet captures utilized by the various BTest tests.
|
||||
|
||||
* scripts/
|
||||
This hierarchy of tests emulates the hierarchy of the Bro scripts/
|
||||
This hierarchy of tests emulates the hierarchy of the Zeek scripts/
|
||||
directory.
|
||||
|
||||
* coverage/
|
||||
This collection of tests relates to checking whether we're covering
|
||||
everything we want to in terms of tests, documentation, and which
|
||||
scripts get loaded in different Bro configurations. These tests are
|
||||
more prone to fail as new Bro scripts are developed and added to the
|
||||
scripts get loaded in different Zeek configurations. These tests are
|
||||
more prone to fail as new Zeek scripts are developed and added to the
|
||||
distribution -- checking the individual test's comments is the best
|
||||
place to check for more details on what exactly the test is checking
|
||||
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
|
||||
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
|
||||
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.
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
# @TEST-EXEC: btest-diff 2.hex
|
||||
|
||||
# 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).
|
||||
|
||||
global i: count = 0;
|
||||
|
|
|
@ -13,7 +13,7 @@ type R2: record {
|
|||
|
||||
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(+1));
|
||||
print Broker::data_type(Broker::data(1));
|
||||
|
@ -33,7 +33,7 @@ event zeek_init()
|
|||
|
||||
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(F) as bool);
|
||||
|
|
|
@ -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: btest-diff weird.log
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# 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: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath | $SCRIPTS/diff-remove-timestamps" btest-diff reporter.log
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# 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: btest-diff weird.log
|
||||
|
|
|
@ -110,7 +110,7 @@ if ( did_it ) return;
|
|||
|
||||
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(+1));
|
||||
|
@ -134,7 +134,7 @@ print Broker::data_type(Broker::data(r));
|
|||
|
||||
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(F)) as bool;
|
||||
|
@ -175,7 +175,7 @@ print broker_to_bro_record(cr);
|
|||
|
||||
print "***************************";
|
||||
|
||||
### Test the broker set BIFs
|
||||
### Test the Broker set BIFs
|
||||
|
||||
cs = Broker::set_create();
|
||||
print Broker::set_size(cs);
|
||||
|
@ -197,7 +197,7 @@ print broker_to_bro_set(cs);
|
|||
|
||||
print "***************************";
|
||||
|
||||
### Test the broker table BIFs
|
||||
### Test the Broker table BIFs
|
||||
|
||||
ct = Broker::table_create();
|
||||
print Broker::table_size(ct);
|
||||
|
@ -221,7 +221,7 @@ print broker_to_bro_table(ct);
|
|||
|
||||
print "***************************";
|
||||
|
||||
### Test the broker vector BIFs
|
||||
### Test the Broker vector BIFs
|
||||
|
||||
cv = Broker::vector_create();
|
||||
print Broker::vector_size(cv);
|
||||
|
@ -244,7 +244,7 @@ print broker_to_bro_vector(cv);
|
|||
|
||||
print "***************************";
|
||||
|
||||
### Test the broker record BIFs
|
||||
### Test the Broker record BIFs
|
||||
|
||||
cr = Broker::record_create(3);
|
||||
print Broker::record_size(cr);
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
#
|
||||
# @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 bro2 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 zeek1 zeek -m -b -r $TRACES/tunnels/6in6.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 zeek3 zeek -m -b -r $TRACES/tunnels/6in6-tunnel-change.pcap %INPUT
|
||||
# @TEST-EXEC: btest-bg-wait 60
|
||||
|
||||
event new_connection(c: connection)
|
||||
|
|
|
@ -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: echo "@load bar/test" >loader.bro
|
||||
# @TEST-EXEC: cp %INPUT foo/bar/test.bro
|
||||
# @TEST-EXEC: cp %INPUT foo/bar/test2.bro
|
||||
# @TEST-EXEC: echo "@load bar/test" >loader.zeek
|
||||
# @TEST-EXEC: cp %INPUT foo/bar/test.zeek
|
||||
# @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.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.bro
|
||||
# @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 foo/bar/test.zeek
|
||||
# @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
|
||||
|
||||
global pi = 3.14;
|
||||
|
|
|
@ -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: btest-diff output
|
||||
|
||||
|
|
|
@ -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: btest-diff output
|
||||
|
||||
|
|
|
@ -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: mv weird.log bad.out
|
||||
# @TEST-EXEC: zeek -r $TRACES/chksums/ip6-hoa-tcp-bad-chksum.pcap
|
||||
|
|
|
@ -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_be.trace %INPUT >>output
|
||||
# @TEST-EXEC: zeek -b -r $TRACES/mobile-ipv6/mip6_brr.trace %INPUT >>output
|
||||
|
|
|
@ -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: btest-diff output
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# @TEST-EXEC: zeek %INPUT
|
||||
# @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
|
||||
# that Bro will bail out during startup. Perhaps we want to change this later.
|
||||
# Errors that happen during runtime. At least at the moment we are not
|
||||
# checking these early enough that Zeek will bail out during startup. Perhaps
|
||||
# we want to change this later.
|
||||
|
||||
option A = 5;
|
||||
Option::set("B", 6);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
# 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
|
||||
# of events every time we drain and also at startup several (currently 3)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# @TEST-EXEC: touch reporter.log && chmod -w reporter.log
|
||||
# @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
|
||||
# and also reporter errors being emitting during shutdown).
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# @TEST-EXEC: cat weird.log >> output
|
||||
|
||||
# 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: zeek -r $TRACES/trunc/icmp-payload-trunc.pcap
|
||||
|
|
|
@ -10,5 +10,3 @@
|
|||
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
@load base/frameworks/notice/weird.bro
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# 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
|
||||
# crash Bro.
|
||||
# crash Zeek.
|
||||
|
||||
type OptionCacheValue: record {
|
||||
val: any;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# @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.
|
||||
# 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
|
||||
|
|
|
@ -53,5 +53,5 @@ event zeek_init()
|
|||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# @TEST-EXEC: zeek -b %INPUT secondtestfile >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;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1
|
||||
# @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;
|
||||
const blah = [$ports=asdfasdf];
|
||||
|
|
|
@ -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: ./configure --bro-dist=${DIST} --install-root=`pwd`/test-install
|
||||
# @TEST-EXEC: make
|
||||
|
|
|
@ -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: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output
|
||||
|
|
|
@ -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: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output
|
||||
|
|
|
@ -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: ./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
|
||||
|
|
|
@ -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: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output
|
||||
# @TEST-EXEC: echo === >>output
|
||||
|
|
|
@ -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: ./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
|
||||
|
|
|
@ -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: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output
|
||||
|
|
|
@ -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: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output
|
||||
|
|
|
@ -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: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=$(pwd) zeek -N Testing::NoPatchVersion >> output
|
||||
|
|
|
@ -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: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=$(pwd) zeek -N Testing::WithPatchVersion >> output
|
||||
|
|
|
@ -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: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output
|
||||
|
|
|
@ -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: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output
|
||||
|
|
|
@ -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: ./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
|
||||
|
|
|
@ -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: ./configure --bro-dist=${DIST} && make
|
||||
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` zeek -NN Demo::Foo >>output
|
||||
|
|
|
@ -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: cat broproc/intel.log > output
|
||||
# @TEST-EXEC: cat broproc/.stdout >> output
|
||||
# @TEST-EXEC: cat zeekproc/intel.log > output
|
||||
# @TEST-EXEC: cat zeekproc/.stdout >> output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
# @TEST-START-FILE intel.dat
|
||||
|
|
|
@ -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-diff broproc/intel.log
|
||||
# @TEST-EXEC: btest-diff zeekproc/intel.log
|
||||
|
||||
@TEST-START-FILE intel.dat
|
||||
#fields indicator indicator_type meta.source meta.desc meta.url
|
||||
|
|
|
@ -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-diff broproc/intel.log
|
||||
# @TEST-EXEC: btest-diff zeekproc/intel.log
|
||||
|
||||
@TEST-START-FILE intel.dat
|
||||
#fields indicator indicator_type meta.source meta.desc meta.url
|
||||
|
|
|
@ -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: cat broproc/intel.log > output
|
||||
# @TEST-EXEC: cat broproc/.stdout >> output
|
||||
# @TEST-EXEC: cat zeekproc/intel.log > output
|
||||
# @TEST-EXEC: cat zeekproc/.stdout >> output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
# @TEST-START-FILE intel.dat
|
||||
|
|
|
@ -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: cat broproc/reporter.log > output
|
||||
# @TEST-EXEC: cat broproc/.stdout >> output
|
||||
# @TEST-EXEC: cat zeekproc/reporter.log > output
|
||||
# @TEST-EXEC: cat zeekproc/.stdout >> output
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath | $SCRIPTS/diff-remove-timestamps" btest-diff output
|
||||
|
||||
# @TEST-START-FILE intel.dat
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# @TEST-EXEC: zeek -b -r ${TRACES}/rotation.trace %INPUT >bro.out 2>&1
|
||||
# @TEST-EXEC: grep "test" bro.out | sort >out
|
||||
# @TEST-EXEC: zeek -b -r ${TRACES}/rotation.trace %INPUT >zeek.out 2>&1
|
||||
# @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: btest-diff out
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ print Version::parse("12.5");
|
|||
print Version::parse("1.12-beta-drunk");
|
||||
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());
|
||||
|
||||
@TEST-START-NEXT
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Kerberos analyzer can open the AD ticket in the Negociate
|
||||
# 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-EXEC: zeek -b -C -r $TRACES/krb/smb2_krb.pcap %INPUT
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# This test verifies that without a keytab file no entries are
|
||||
# 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-EXEC: zeek -C -r $TRACES/krb/smb2_krb.pcap %INPUT
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
# the binpac-generated analyzer code to throw a binpac::ExceptionOutOfBound.
|
||||
# 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
|
||||
# shouldn't interfere with that handling and definitely shouldn't crash bro.
|
||||
# shouldn't interfere with that handling and definitely shouldn't crash Zeek.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# This tests how Bro deals with encrypted connections. Right now, it doesn't log them as it
|
||||
# can't parse much of value. We're testing for an empty mysql.log file.
|
||||
# This tests how Zeek deals with encrypted connections. Right now, it
|
||||
# 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: zeek -b -r $TRACES/mysql/encrypted.trace %INPUT
|
||||
|
|
|
@ -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: btest-diff ssl.log
|
||||
|
|
|
@ -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-diff broproc/intel.log
|
||||
# @TEST-EXEC: btest-diff zeekproc/intel.log
|
||||
|
||||
@TEST-START-FILE intel.dat
|
||||
#fields indicator indicator_type meta.source meta.remove
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
# @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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
##! Local site policy. Customize as appropriate.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
On a Bro build configured with --enable-coverage, this script produces a code
|
||||
coverage report after Bro has been invoked. The intended application of this
|
||||
On a Zeek build configured with --enable-coverage, this script produces a code
|
||||
coverage report after Zeek has been invoked. The intended application of this
|
||||
script is after the btest testsuite has run. This combination (btests first,
|
||||
coverage computation afterward) happens automatically when running "make" in
|
||||
the testing directory. This script puts .gcov files (which are included in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# On a Bro build configured with --enable-coverage, this script
|
||||
# produces a code coverage report after Bro has been invoked. The
|
||||
# On a Zeek build configured with --enable-coverage, this script
|
||||
# produces a code coverage report after Zeek has been invoked. The
|
||||
# intended application of this script is after the btest testsuite has
|
||||
# run. This combination (btests first, coverage computation afterward)
|
||||
# happens automatically when running "make" in the testing directory.
|
||||
|
@ -12,7 +12,7 @@
|
|||
# 1. Run test suite
|
||||
# 2. Check for .gcda files existing.
|
||||
# 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
|
||||
# 4b. Send .gcov files to appropriate path
|
||||
#
|
||||
|
@ -52,7 +52,7 @@ function check_file_coverage {
|
|||
|
||||
function check_group_coverage {
|
||||
DATA="$1" # FILE CONTAINING COVERAGE DATA
|
||||
SRC_FOLDER="$2" # WHERE BRO WAS COMPILED
|
||||
SRC_FOLDER="$2" # WHERE ZEEK WAS COMPILED
|
||||
OUTPUT="$3"
|
||||
|
||||
# Prints all the relevant directories
|
||||
|
@ -117,9 +117,9 @@ else
|
|||
exit 1
|
||||
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 "#"
|
||||
# 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... "
|
||||
PREFIX=$(echo "$BASE" | sed 's|/|#|g')
|
||||
for i in "$TMP"/*#*.gcov; do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# On a Bro build configured with --enable-coverage, this script
|
||||
# produces a code coverage report in HTML format after Bro has been invoked. The
|
||||
# On a Zeek build configured with --enable-coverage, this script
|
||||
# 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.
|
||||
|
||||
# This depends on lcov to run.
|
||||
|
|
6
testing/external/README
vendored
6
testing/external/README
vendored
|
@ -2,9 +2,9 @@
|
|||
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
|
||||
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
|
||||
files, one can also add a local set to the test-suite for running on
|
||||
private traces.
|
||||
|
@ -60,7 +60,7 @@ To update a test's baseline, first run ``btest`` in update mode:
|
|||
|
||||
.. console:
|
||||
|
||||
> cd bro-testing
|
||||
> cd zeek-testing
|
||||
> btest -u tests/test-you-want-to-update
|
||||
|
||||
Then use ``git`` to commit the changes and push the changes upstream
|
||||
|
|
2
testing/external/scripts/diff-all
vendored
2
testing/external/scripts/diff-all
vendored
|
@ -27,7 +27,7 @@ for i in `echo $files_cwd $files_baseline | sort | uniq`; do
|
|||
if [[ "$i" == "reporter.log" ]]; then
|
||||
# Do not diff the reporter.log if it only complains about missing
|
||||
# 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
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
#
|
||||
# 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
|
||||
|
|
2
testing/external/scripts/skel/test.skeleton
vendored
2
testing/external/scripts/skel/test.skeleton
vendored
|
@ -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'
|
||||
|
||||
@load testing-setup
|
||||
|
|
2
testing/external/scripts/testing-setup.zeek
vendored
2
testing/external/scripts/testing-setup.zeek
vendored
|
@ -9,6 +9,6 @@
|
|||
|
||||
@ifdef ( LogAscii::use_json )
|
||||
# Don't start logging everything as JSON.
|
||||
# (json-logs.bro activates this).
|
||||
# (json-logs.zeek activates this).
|
||||
redef LogAscii::use_json = F;
|
||||
@endif
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#! /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:
|
||||
#
|
||||
# coverage-calc <quoted glob of filenames> <output file> <script dir>
|
||||
#
|
||||
# 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
|
||||
# the coverage calculation.
|
||||
|
||||
|
@ -27,7 +27,7 @@ for filename in glob.glob(inputglob):
|
|||
# grab file path and line numbers separately
|
||||
filepath, srclines = parts[1].rsplit(",", 1)
|
||||
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):
|
||||
continue
|
||||
# keep only the line number (or line number range)
|
||||
|
@ -56,4 +56,4 @@ for k in stats:
|
|||
num_covered += 1
|
||||
|
||||
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))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#! /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.
|
||||
|
||||
zeek -N | grep -q $1 >/dev/null
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 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
|
||||
# especially convenient in this case). Note that if you use this script
|
||||
|
@ -12,7 +12,7 @@ usage() {
|
|||
echo "usage: $0 CMD DISTRO"
|
||||
echo " CMD is a build step:"
|
||||
echo " install: install prereqs"
|
||||
echo " build: build bro"
|
||||
echo " build: build zeek"
|
||||
echo " run: run the tests"
|
||||
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"
|
||||
|
@ -47,7 +47,7 @@ install_coverity() {
|
|||
}
|
||||
|
||||
|
||||
# Build Bro with the coverity tools.
|
||||
# Build Zeek with the coverity tools.
|
||||
build_coverity() {
|
||||
# Cleanup any previous build (this is really only necessary if running this
|
||||
# outside of Travis).
|
||||
|
@ -64,7 +64,7 @@ build_coverity() {
|
|||
|
||||
# Create a tar file and send it to coverity.
|
||||
run_coverity() {
|
||||
EMAIL=bro-commits-internal@bro.org
|
||||
EMAIL=zeek-commits-internal@zeek.org
|
||||
FILE=myproject.tgz
|
||||
VER=`cat VERSION`
|
||||
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() {
|
||||
case $distro in
|
||||
centos_7)
|
||||
|
@ -101,31 +101,31 @@ install_in_docker() {
|
|||
esac
|
||||
|
||||
docker_image=`echo $distro | tr '_' ':'`
|
||||
docker run --name brotest -id -v "`pwd`:/bro" -w /bro ${docker_image} sh
|
||||
docker exec brotest sh -c "${distro_cmds}"
|
||||
docker run --name zeektest -id -v "`pwd`:/zeek" -w /zeek ${docker_image} sh
|
||||
docker exec zeektest sh -c "${distro_cmds}"
|
||||
}
|
||||
|
||||
|
||||
# Build bro in a docker container.
|
||||
# Build Zeek in a docker container.
|
||||
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() {
|
||||
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() {
|
||||
# Cleanup any previous build (this is really only necessary if running this
|
||||
# outside of Travis).
|
||||
make distclean > /dev/null
|
||||
|
||||
# Skip building broker tests, python bindings, and zeekctl, as these are
|
||||
# not needed by the bro tests.
|
||||
# Skip building Broker tests, python bindings, and zeekctl, as these are
|
||||
# not needed by the Zeek tests.
|
||||
./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() {
|
||||
ulimit -c unlimited
|
||||
ulimit -a
|
||||
|
@ -271,12 +271,12 @@ showdiag() {
|
|||
# Remove the docker container.
|
||||
remove_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
|
||||
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
|
||||
fi
|
||||
|
||||
|
@ -329,7 +329,7 @@ if [ "${TRAVIS_EVENT_TYPE}" = "cron" ] || [ "$distro" = "coverity" ]; then
|
|||
run_coverity
|
||||
fi
|
||||
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
|
||||
# build outputs thousands of lines (which are conveniently collapsed into
|
||||
|
@ -343,7 +343,7 @@ elif [ "$distro" = "travis" ]; then
|
|||
run
|
||||
fi
|
||||
else
|
||||
# Build bro and run tests in a docker container.
|
||||
# Build Zeek and run tests in a docker container.
|
||||
|
||||
if [ "$step" = "install" ]; then
|
||||
install_in_docker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue