updates for gen-C++ maintenance, including skipping some inappropriate tests

This commit is contained in:
Vern Paxson 2022-08-01 16:47:17 -07:00
parent c034dc68ed
commit 7a41170a59
36 changed files with 200 additions and 53 deletions

View file

@ -495,7 +495,7 @@ void CPPCompile::GenForOverTable(const ExprPtr& tbl, const IDPtr& value_var,
StartBlock(); StartBlock();
Emit("auto k__CPP = lve__CPP.GetHashKey();"); Emit("auto k__CPP = lve__CPP.GetHashKey();");
Emit("auto* current_tev__CPP = lve__CPP.GetValue<TableEntryVal*>();"); Emit("auto* current_tev__CPP = lve__CPP.value;");
Emit("auto ind_lv__CPP = tv__CPP->RecreateIndex(*k__CPP);"); Emit("auto ind_lv__CPP = tv__CPP->RecreateIndex(*k__CPP);");
if ( value_var ) if ( value_var )

View file

@ -15,7 +15,7 @@ The maintenance workflow:
to check in updates to the list of how the compiler currently fares to check in updates to the list of how the compiler currently fares
on various btests (see end of this doc): on various btests (see end of this doc):
Thu May 12 12:54:10 PDT 2022 Mon Aug 1 16:39:05 PDT 2022
2. Run "find-test-files.sh" to generate a list (to stdout) of all of the 2. Run "find-test-files.sh" to generate a list (to stdout) of all of the
possible Zeek source files found in the test suite. possible Zeek source files found in the test suite.
@ -57,17 +57,27 @@ These BTests won't successfully run due to the indicated issue:
command-line-error - a deliberate command-line error command-line-error - a deliberate command-line error
complex-to-debug - hard-to-figure-out failure complex-to-debug - hard-to-figure-out failure
deprecated - uses features deprecated for -O C++ deprecated - uses features deprecated for -O C++
error-handling - behavior in face of an error differs
needs-plugin - requires knowing how to build an associated plugin
no-script - there's no actual script to compile no-script - there's no actual script to compile
ZAM - meant specifically for -O ZAM ZAM - meant specifically for -O ZAM
Consider migrating these to have @TEST-REQUIRES clauses so we don't have
to maintain this list.
../testing/btest/core/negative-time.test no-script ../testing/btest/core/negative-time.test no-script
../testing/btest/core/pcap/dumper.zeek no-script ../testing/btest/core/pcap/dumper.zeek no-script
../testing/btest/core/pcap/input-error.zeek command-line-error ../testing/btest/core/pcap/input-error.zeek command-line-error
../testing/btest/core/proc-status-file.zeek no-script ../testing/btest/core/proc-status-file.zeek no-script
../testing/btest/core/scalar-vector.zeek deprecated
../testing/btest/language/at-if-event.zeek @if ../testing/btest/language/at-if-event.zeek @if
../testing/btest/language/at-if.zeek @if ../testing/btest/language/at-if.zeek @if
../testing/btest/language/at-ifdef.zeek @if ../testing/btest/language/at-ifdef.zeek @if
../testing/btest/language/at-ifndef.zeek @if ../testing/btest/language/at-ifndef.zeek @if
../testing/btest/language/incr-vec-expr.test deprecated
../testing/btest/language/uninitialized-local2.zeek error-handling
../testing/btest/language/vector-deprecated.zeek deprecated
../testing/btest/language/vector-in-operator.zeek
../testing/btest/language/vector-in-operator.zeek deprecated ../testing/btest/language/vector-in-operator.zeek deprecated
../testing/btest/language/when-aggregates.zeek bad-when ../testing/btest/language/when-aggregates.zeek bad-when
../testing/btest/opt/opt-files.zeek ZAM ../testing/btest/opt/opt-files.zeek ZAM
@ -76,6 +86,7 @@ These BTests won't successfully run due to the indicated issue:
../testing/btest/opt/opt-func.zeek ZAM ../testing/btest/opt/opt-func.zeek ZAM
../testing/btest/opt/opt-func2.zeek ZAM ../testing/btest/opt/opt-func2.zeek ZAM
../testing/btest/opt/opt-func3.zeek ZAM ../testing/btest/opt/opt-func3.zeek ZAM
../testing/btest/plugins/packet-protocol.zeek needs-plugin
../testing/btest/scripts/base/protocols/dhcp/dhcp-ack-msg-types.zeek no-script ../testing/btest/scripts/base/protocols/dhcp/dhcp-ack-msg-types.zeek no-script
../testing/btest/scripts/base/protocols/dhcp/dhcp-all-msg-types.zeek no-script ../testing/btest/scripts/base/protocols/dhcp/dhcp-all-msg-types.zeek no-script
../testing/btest/scripts/base/protocols/dhcp/dhcp-discover-msg-types.zeek no-script ../testing/btest/scripts/base/protocols/dhcp/dhcp-discover-msg-types.zeek no-script

View file

@ -1,8 +1,19 @@
#! /bin/sh #! /bin/sh
out=out.$(echo $1 | sed 's,\.\./,,;s,/,#,g') abbr=$(echo $1 | sed 's,\.\./,,;s,/,#,g')
out=CPP-test/out.$abbr
gen_out=CPP-test/gen.$abbr
( (
/bin/echo -n $1" " /bin/echo -n $1" "
(src/zeek -O gen-C++ --optimize-files=testing/btest --optimize-func="<global-stmts>" $1 >&/dev/null && echo "success") || echo "fail" if ! src/zeek -O gen-C++ --optimize-files=testing/btest $1 >&$gen_out 2>&1; then
) >CPP-test/$out 2>&1 echo "fail"
exit 1
fi
if grep -E -q 'deprecated|skipping|cannot compile|no matching functions' $gen_out; then
echo "fail"
exit 1
fi
echo "success"
exit 0
) >$out 2>&1

View file

@ -1,11 +1,22 @@
#! /bin/sh #! /bin/sh
rm -f CPP-gen.cc rm -f CPP-gen.cc
cp zeek.HOLD src/zeek || ( cp zeek.HOLD src/zeek || (
echo Need to create clean zeek.HOLD echo Need to create clean zeek.HOLD
exit 1 exit 1
) || exit 1 ) || exit 1
if [ "$1" == "-U" ]; then
btest_opt=-U
shift
elif [ "$1" == "-d" ]; then
btest_opt=-d
shift
else
btest_opt=-d
fi
base=$(echo $1 | sed 's,\.\./,,;s,/,#,g') base=$(echo $1 | sed 's,\.\./,,;s,/,#,g')
rel_test=$(echo $1 | sed 's,.*testing/btest/,,') rel_test=$(echo $1 | sed 's,.*testing/btest/,,')
@ -26,5 +37,5 @@ ninja
( (
cd ../testing/btest cd ../testing/btest
../../auxil/btest/btest -a cpp -d -f ../../build/CPP-test/diag.$base $rel_test ../../auxil/btest/btest -a cpp $btest_opt -f ../../build/CPP-test/diag.$base $rel_test
) )

View file

@ -1,8 +1,10 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
--- Backtrace --- --- Backtrace ---
#0: zeek_init()
--- Backtrace --- --- Backtrace ---
| #0: zeek_init() |
--- Backtrace --- --- Backtrace ---
#0: zeek_init()

View file

@ -0,0 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
proto confirm, AllAnalyzers::ANALYZER_ANALYZER_HTTP
http_request, GET, /style/enhanced.css
T
total http messages, {
[[orig_h=192.168.1.104, orig_p=1673/tcp, resp_h=63.245.209.11, resp_p=80/tcp]] = 1
}

View file

@ -5,16 +5,16 @@ type aliases for 'MyRec val': MyRec MyRecAlias
type aliases for 'MyRecAlias val': MyRec MyRecAlias type aliases for 'MyRecAlias val': MyRec MyRecAlias
type aliases for 'MyRec type': MyRec MyRecAlias type aliases for 'MyRec type': MyRec MyRecAlias
type aliases for 'MyRecalias type': MyRec MyRecAlias type aliases for 'MyRecalias type': MyRec MyRecAlias
type aliases for 'MyString val': MyString AnotherString type aliases for 'MyString val': it's just a 'string'
type aliases for 'MyString type': MyString AnotherString type aliases for 'MyString type': MyString AnotherString
type aliases for 'MyOtherString type': MyOtherString type aliases for 'MyOtherString type': MyOtherString
type aliases for 'AnotherString type': MyString AnotherString type aliases for 'AnotherString type': MyString AnotherString
type aliases for 'string literal value': MyString AnotherString type aliases for 'string literal value': it's just a 'string'
type aliases for 'count literal value': it's just a 'count' type aliases for 'count literal value': it's just a 'count'
type aliases for 'MyTable value': MyTable2 MyTable3 MyTable MyTable4 type aliases for 'MyTable value': it's just a 'table[count] of string'
type aliases for 'MyTable2 value': MyTable2 MyTable3 MyTable MyTable4 type aliases for 'MyTable2 value': it's just a 'table[count] of string'
type aliases for 'MyTable3 value': MyTable2 MyTable3 MyTable MyTable4 type aliases for 'MyTable3 value': it's just a 'table[count] of string'
type aliases for 'MyTable4 value': MyTable2 MyTable3 MyTable MyTable4 type aliases for 'MyTable4 value': it's just a 'table[count] of string'
type aliases for 'MyTable type': MyTable2 MyTable3 MyTable MyTable4 type aliases for 'MyTable type': MyTable2 MyTable3 MyTable MyTable4
type aliases for 'MyTable2 type': MyTable2 MyTable3 MyTable MyTable4 type aliases for 'MyTable2 type': MyTable2 MyTable3 MyTable MyTable4
type aliases for 'MyTable3 type': MyTable2 MyTable3 MyTable MyTable4 type aliases for 'MyTable3 type': MyTable2 MyTable3 MyTable MyTable4

View file

@ -0,0 +1,11 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <...>/main.zeek, lines 498-499: Failed to attach master store backend_failure: (Option::set_change_handler(Broker::metrics_export_prefixes, to_any_coerceBroker::update_metrics_export_prefixes, (coerce 0 to int)))
error in <...>/main.zeek, lines 498-499: Could not create Broker master store '../fail' (Option::set_change_handler(Broker::metrics_export_prefixes, to_any_coerceBroker::update_metrics_export_prefixes, (coerce 0 to int)))
error in <no location>: invalid Broker store handle (broker::store::{})
error in <no location>: invalid Broker store handle (broker::store::{})
error in <no location>: invalid Broker store handle (broker::store::{})
error in <no location>: invalid Broker store handle (broker::store::{})
error in <no location>: invalid Broker store handle (broker::store::{})
error in <no location>: invalid Broker store handle (broker::store::{})
error in <no location>: invalid Broker store handle (broker::store::{})
received termination signal

View file

@ -0,0 +1,21 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
T
F
F
F
m1 keys result: [status=Broker::FAILURE, result=[data=<uninitialized>]]
m2 keys result: [status=Broker::SUCCESS, result=[data=broker::data{{}}]]
c2 keys result: [status=Broker::SUCCESS, result=[data=broker::data{{}}]]
T
F
F
F
T
T
T
T
m1 keys result: [status=Broker::FAILURE, result=[data=<uninitialized>]]
c1 keys result: [status=Broker::FAILURE, result=[data=<uninitialized>]]
m2 keys result: [status=Broker::FAILURE, result=[data=<uninitialized>]]
c2 keys result: [status=Broker::FAILURE, result=[data=<uninitialized>]]
c1 timeout

View file

@ -0,0 +1 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.

View file

@ -1,7 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
reporter_info|init test-info||XXXXXXXXXX.XXXXXX reporter_info|init test-info|<...>/main.zeek, lines 498-499|XXXXXXXXXX.XXXXXX
reporter_warning|init test-warning||XXXXXXXXXX.XXXXXX reporter_warning|init test-warning|<...>/main.zeek, lines 498-499|XXXXXXXXXX.XXXXXX
reporter_error|init test-error||XXXXXXXXXX.XXXXXX reporter_error|init test-error|<...>/main.zeek, lines 498-499|XXXXXXXXXX.XXXXXX
reporter_info|done test-info||XXXXXXXXXX.XXXXXX reporter_info|done test-info||XXXXXXXXXX.XXXXXX
reporter_warning|done test-warning||XXXXXXXXXX.XXXXXX reporter_warning|done test-warning||XXXXXXXXXX.XXXXXX
reporter_error|done test-error||XXXXXXXXXX.XXXXXX reporter_error|done test-error||XXXXXXXXXX.XXXXXX

View file

@ -2,9 +2,9 @@
pre test-info pre test-info
warning: pre test-warning warning: pre test-warning
error: pre test-error error: pre test-error
init test-info <...>/main.zeek, lines 498-499: init test-info
warning: init test-warning warning in <...>/main.zeek, lines 498-499: init test-warning
error: init test-error error in <...>/main.zeek, lines 498-499: init test-error
done test-info done test-info
warning: done test-warning warning: done test-warning
error: done test-error error: done test-error

View file

@ -0,0 +1,15 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
### NOTE: This file has been sorted with diff-sort.
[f(F)]
[f(T)]
[zeek_init()]
f() done, no exception, T
g() done, no exception, T
received termination signal
runtime error in compiled code: field value missing
runtime error in compiled code: field value missing
runtime error in compiled code: field value missing
runtime error in compiled code: field value missing
timeout
timeout g(), F
timeout g(), T

View file

@ -9,5 +9,5 @@ orig=/^?(.*PATTERN.*)$?/ (pattern) clone=/^?(.*PATTERN.*)$?/ (pattern) same_obje
orig=2,5,3,4,1 (set[count]) clone=2,5,3,4,1 (set[count]) equal=T same_object=F (ok) orig=2,5,3,4,1 (set[count]) clone=2,5,3,4,1 (set[count]) equal=T same_object=F (ok)
orig=[1, 2, 3, 4, 5] (vector of count) clone=[1, 2, 3, 4, 5] (vector of count) equal=T same_object=F (ok) orig=[1, 2, 3, 4, 5] (vector of count) clone=[1, 2, 3, 4, 5] (vector of count) equal=T same_object=F (ok)
orig=a=va;b=vb (table[string] of string) clone=a=va;b=vb (table[string] of string) equal=T same_object=F (ok) orig=a=va;b=vb (table[string] of string) clone=a=va;b=vb (table[string] of string) equal=T same_object=F (ok)
orig=ENUMME (enum MyEnum) clone=ENUMME (enum MyEnum) equal=T same_object=F (FAIL1) orig=ENUMME (MyEnum) clone=ENUMME (MyEnum) equal=T same_object=F (FAIL1)
orig=[s1=s1, s2=s2, i1=[a=a], i2=[a=a], donotset=<uninitialized>, def=5] (record { s1:string; s2:string; i1:record { a:string; }; i2:record { a:string; } &optional; donotset:record { a:string; } &optional; def:count &default=5, &optional; }) clone=[s1=s1, s2=s2, i1=[a=a], i2=[a=a], donotset=<uninitialized>, def=5] (record { s1:string; s2:string; i1:record { a:string; }; i2:record { a:string; } &optional; donotset:record { a:string; } &optional; def:count &default=5, &optional; }) equal=T same_object=F (ok) orig=[s1=s1, s2=s2, i1=[a=a], i2=[a=a], donotset=<uninitialized>, def=5] (TestRecord) clone=[s1=s1, s2=s2, i1=[a=a], i2=[a=a], donotset=<uninitialized>, def=5] (TestRecord) equal=T same_object=F (ok)

View file

@ -1,6 +1,6 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
runtime error in compiled code: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=<uninitialized>] runtime error in <...>/queue.zeek, line 152: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=<uninitialized>], expression: Queue::ret[Queue::j], call stack:
runtime error in compiled code: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=<uninitialized>] #0 Queue::get_vector([initialized=T, vals={[2] = test,[3] = [a=T, b=hi, c=<uninitialized>],[5] = 3,[0] = hello,[6] = jkl;,[4] = asdf,[1] = goodbye}, settings=[max_len=<uninitialized>], top=7, bottom=0, size=0], [hello, goodbye, test]) at <...>/main.zeek:498
runtime error in compiled code: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=<uninitialized>] #1 zeek_init()
runtime error in compiled code: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=<uninitialized>]
runtime error in compiled code: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=<uninitialized>]

View file

@ -1,11 +1,14 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
| Hook Some Info Reporter::Hook - Exercise Reporter Hook (dynamic, version 1.0.0)
| Hook error An Error Implements Reporter (priority 0)
| Hook error An Error that does not show up in the log
| Hook Some Info <...>/main.zeek, lines 498-499
| Hook error An Error <...>/main.zeek, lines 498-499
| Hook error An Error that does not show up in the log <...>/main.zeek, lines 498-499
| Hook runtime error in compiled code field value missing | Hook runtime error in compiled code field value missing
| Hook warning A warning | Hook warning A warning <...>/main.zeek, lines 498-499
Some Info <...>/main.zeek, lines 498-499: Some Info
error: An Error error in <...>/main.zeek, lines 498-499: An Error
error: An Error that does not show up in the log error in <...>/main.zeek, lines 498-499: An Error that does not show up in the log
runtime error in compiled code: field value missing runtime error in compiled code: field value missing
warning: A warning warning in <...>/main.zeek, lines 498-499: A warning

View file

@ -7,8 +7,8 @@
#open XXXX-XX-XX-XX-XX-XX #open XXXX-XX-XX-XX-XX-XX
#fields ts level message location #fields ts level message location
#types time enum string string #types time enum string string
XXXXXXXXXX.XXXXXX Reporter::INFO Some Info (empty) XXXXXXXXXX.XXXXXX Reporter::INFO Some Info <...>/main.zeek, lines 498-499
XXXXXXXXXX.XXXXXX Reporter::WARNING A warning (empty) XXXXXXXXXX.XXXXXX Reporter::WARNING A warning <...>/main.zeek, lines 498-499
XXXXXXXXXX.XXXXXX Reporter::ERROR An Error (empty) XXXXXXXXXX.XXXXXX Reporter::ERROR An Error <...>/main.zeek, lines 498-499
XXXXXXXXXX.XXXXXX Reporter::ERROR field value missing (empty) XXXXXXXXXX.XXXXXX Reporter::ERROR field value missing (empty)
#close XXXX-XX-XX-XX-XX-XX #close XXXX-XX-XX-XX-XX-XX

View file

@ -0,0 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
all, AllAnalyzers::ANALYZER_ANALYZER_DNS
analyzer, Analyzer::ANALYZER_DNS
all, AllAnalyzers::PACKETANALYZER_ANALYZER_UDP
packet analyzer, PacketAnalyzer::ANALYZER_UDP
all, AllAnalyzers::FILES_ANALYZER_X509
file analyzer, Files::ANALYZER_X509

View file

@ -1,2 +1,3 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error: file ID asdf not a known file error: file ID asdf not a known file
warning: non-void function returning without a value: Files::lookup_file

View file

@ -1,10 +1,10 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
1 <...>/coverage-blacklist.zeek, line 13 print cover me; 1 <...>/coverage-blacklist.zeek, line 10 if (F) { print hello; print world; }
1 <...>/coverage-blacklist.zeek, line 15 if (T) { print always executed; } 1 <...>/coverage-blacklist.zeek, line 16 print cover me;
1 <...>/coverage-blacklist.zeek, line 17 print always executed; 1 <...>/coverage-blacklist.zeek, line 18 if (T) { print always executed; }
1 <...>/coverage-blacklist.zeek, line 22 if (0 + 0 == 1) print impossible; 1 <...>/coverage-blacklist.zeek, line 20 print always executed;
1 <...>/coverage-blacklist.zeek, line 24 if (1 == 0) { print also impossible, but included in code coverage analysis; } 1 <...>/coverage-blacklist.zeek, line 25 if (0 + 0 == 1) print impossible;
0 <...>/coverage-blacklist.zeek, line 26 print also impossible, but included in code coverage analysis; 1 <...>/coverage-blacklist.zeek, line 27 if (1 == 0) { print also impossible, but included in code coverage analysis; }
1 <...>/coverage-blacklist.zeek, line 29 print success; 0 <...>/coverage-blacklist.zeek, line 29 print also impossible, but included in code coverage analysis;
1 <...>/coverage-blacklist.zeek, line 5 print first; 1 <...>/coverage-blacklist.zeek, line 32 print success;
1 <...>/coverage-blacklist.zeek, line 7 if (F) { print hello; print world; } 1 <...>/coverage-blacklist.zeek, line 8 print first;

View file

@ -1,2 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
expression error in <...>/common-mistakes2.zeek, line 16: type-checking failed in vector append (v += ok) expression error in <...>/common-mistakes2.zeek, line 17: type-checking failed in vector append (v += ok)

View file

@ -1,2 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
warning: please_warn assignment unused: please_warn = test; <...>/unused-assignment.zeek, line 7 warning: please_warn assignment unused: please_warn = test; <...>/unused-assignment.zeek, line 10

View file

@ -4,7 +4,11 @@
global cmds = "print \"hello world\";"; global cmds = "print \"hello world\";";
cmds = string_cat(cmds, "\nprint \"foobar\";"); cmds = string_cat(cmds, "\nprint \"foobar\";");
if ( piped_exec("zeek", cmds) != T )
# If we're using generated C++, turn that off for the pipe execution,
# as otherwise we'll get a complaint that there's no corresponding
# C++ bodies found for that zeek instance.
if ( piped_exec("export -n ZEEK_USE_CPP; zeek", cmds) != T )
exit(1); exit(1);
# Test null output. # Test null output.

View file

@ -1,5 +1,8 @@
# This tests Zeek's mechanism to prevent duplicate script loading. # This tests Zeek's mechanism to prevent duplicate script loading.
# #
# Don't run for C++ scripts, since it doesn't actually do anything and that
# leads to complaints that there are no scripts.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-EXEC: mkdir -p foo/bar # @TEST-EXEC: mkdir -p foo/bar
# @TEST-EXEC: echo "@load bar/test" >loader.zeek # @TEST-EXEC: echo "@load bar/test" >loader.zeek
# @TEST-EXEC: cp %INPUT foo/bar/test.zeek # @TEST-EXEC: cp %INPUT foo/bar/test.zeek

View file

@ -1,4 +1,9 @@
# This verifies Zeek's ability to load scripts from stdin. # This verifies Zeek's ability to load scripts from stdin.
#
# Don't run for C++ scripts because the multiple invocations lead to
# some runs having complaints that there are no scripts.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
#
# @TEST-EXEC: echo 'print "stdin";' | zeek -b >output.implicit # @TEST-EXEC: echo 'print "stdin";' | zeek -b >output.implicit
# @TEST-EXEC: echo 'print "stdin";' | zeek -b - >output.explicit # @TEST-EXEC: echo 'print "stdin";' | zeek -b - >output.explicit
# @TEST-EXEC: echo 'print "stdin";' | zeek -b %INPUT >output.nostdin # @TEST-EXEC: echo 'print "stdin";' | zeek -b %INPUT >output.nostdin

View file

@ -3,6 +3,10 @@
# greps to validate that we got a syntax error in the output with the string that we passed # greps to validate that we got a syntax error in the output with the string that we passed
# as a filter. # as a filter.
# Don't run for C++ scripts, since first invocation doesn't use the input
# and hence leads to complaints that there are no scripts.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
#
# @TEST-EXEC-FAIL: zeek -r $TRACES/workshop_2011_browse.trace -f "kaputt" >output 2>&1 # @TEST-EXEC-FAIL: zeek -r $TRACES/workshop_2011_browse.trace -f "kaputt" >output 2>&1
# @TEST-EXEC-FAIL: test -e conn.log # @TEST-EXEC-FAIL: test -e conn.log
# @TEST-EXEC: grep "kaputt" output | grep -q "syntax error" # @TEST-EXEC: grep "kaputt" output | grep -q "syntax error"

View file

@ -1,3 +1,7 @@
# Don't run for C++ scripts, since script invocation of Zeek hashes
# the script differently, leading to complaints that there are no scripts.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-EXEC: printf '#!' > test.zeek # @TEST-EXEC: printf '#!' > test.zeek
# @TEST-EXEC: printf "$BUILD/src/zeek -b --\n" >> test.zeek # @TEST-EXEC: printf "$BUILD/src/zeek -b --\n" >> test.zeek
# @TEST-EXEC: cat %INPUT >> test.zeek # @TEST-EXEC: cat %INPUT >> test.zeek

View file

@ -1,3 +1,6 @@
# Don't run for C++ scripts, since they aren't compatible with interpreter-level
# coverage analysis.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-EXEC: ZEEK_PROFILER_FILE=coverage zeek -b %INPUT # @TEST-EXEC: ZEEK_PROFILER_FILE=coverage zeek -b %INPUT
# @TEST-EXEC: grep %INPUT coverage | sort -k2 >output # @TEST-EXEC: grep %INPUT coverage | sort -k2 >output
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output

View file

@ -1,3 +1,6 @@
# Don't run for C++ scripts, they're not compatible.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# Shouldn't emit any warnings about not being able to document something # Shouldn't emit any warnings about not being able to document something
# that's supplied via command line script. # that's supplied via command line script.

View file

@ -1,9 +1,10 @@
# A companion to language/common-mistakes.zeek. Split off because we skip # A companion to language/common-mistakes.zeek. Split off because we skip
# this test when using ZAM, since it employs a type-checking violation via # this test when using script optimization, since it employs a type-checking
# vector-of-any, which doesn't seem worth going out of our way to support # violation via vector-of-any, which doesn't seem worth going out of our way
# in ZAM (and it isn't dead simple to do so). # to support for script optimization.
# @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1" # @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1"
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-EXEC: zeek -b %INPUT >out 2>err # @TEST-EXEC: zeek -b %INPUT >out 2>err
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out

View file

@ -1,3 +1,6 @@
# Don't run for C++ scripts, they don't do this analysis at run-time.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-EXEC: ZEEK_USAGE_ISSUES=1 zeek -b %INPUT >out 2>&1 # @TEST-EXEC: ZEEK_USAGE_ISSUES=1 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
# @TEST-DOC: The "-u" flag should warn about unused assignments and &is_used suppresses it. # @TEST-DOC: The "-u" flag should warn about unused assignments and &is_used suppresses it.

View file

@ -1,4 +1,7 @@
# # Don't run for C++ scripts because the multiple invocations lead to
# some runs having complaints that there are no scripts.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-EXEC: zeek -b -r ${TRACES}/ssh/ssh-on-port-80.trace %INPUT dpd_buffer_size=0 base/protocols/conn base/protocols/ssh base/frameworks/dpd # @TEST-EXEC: zeek -b -r ${TRACES}/ssh/ssh-on-port-80.trace %INPUT dpd_buffer_size=0 base/protocols/conn base/protocols/ssh base/frameworks/dpd
# @TEST-EXEC: cat conn.log | zeek-cut service | grep -q ssh # @TEST-EXEC: cat conn.log | zeek-cut service | grep -q ssh
# #

View file

@ -1,3 +1,7 @@
# Don't run for C++ scripts because the multiple invocations lead to
# some runs having complaints that there are no scripts.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-EXEC: zeek -b -C -r $TRACES/http/multipart.trace base/protocols/http # @TEST-EXEC: zeek -b -C -r $TRACES/http/multipart.trace base/protocols/http
# @TEST-EXEC: btest-diff http.log # @TEST-EXEC: btest-diff http.log
# @TEST-EXEC: zeek -b -C -r $TRACES/http/multipart.trace base/protocols/http %INPUT >out-limited # @TEST-EXEC: zeek -b -C -r $TRACES/http/multipart.trace base/protocols/http %INPUT >out-limited

View file

@ -1,3 +1,6 @@
# Don't run for C++ scripts because there's no script to compile.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-EXEC: zeek -C -r $TRACES/smb/smb2.delete-on-close-perms-delete-existing.pcap policy/protocols/smb/log-cmds # @TEST-EXEC: zeek -C -r $TRACES/smb/smb2.delete-on-close-perms-delete-existing.pcap policy/protocols/smb/log-cmds
# @TEST-EXEC: btest-diff smb_files.log # @TEST-EXEC: btest-diff smb_files.log
# @TEST-EXEC: btest-diff smb_cmd.log # @TEST-EXEC: btest-diff smb_cmd.log

View file

@ -1,5 +1,8 @@
# A basic test of the known-hosts script's logging and asset_tracking options # A basic test of the known-hosts script's logging and asset_tracking options
# Don't run for C++ scripts because there's no script to compile.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-EXEC: zeek -b -r $TRACES/wikipedia.trace %INPUT Known::host_tracking=LOCAL_HOSTS # @TEST-EXEC: zeek -b -r $TRACES/wikipedia.trace %INPUT Known::host_tracking=LOCAL_HOSTS
# @TEST-EXEC: mv known_hosts.log knownhosts-local.log # @TEST-EXEC: mv known_hosts.log knownhosts-local.log
# @TEST-EXEC: btest-diff knownhosts-local.log # @TEST-EXEC: btest-diff knownhosts-local.log

View file

@ -1,5 +1,8 @@
# A basic test of the known-services script's logging and asset_tracking options # A basic test of the known-services script's logging and asset_tracking options
# Don't run for C++ scripts because there's no script to compile.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-EXEC: zeek -r $TRACES/var-services-std-ports.trace %INPUT Known::service_tracking=LOCAL_HOSTS # @TEST-EXEC: zeek -r $TRACES/var-services-std-ports.trace %INPUT Known::service_tracking=LOCAL_HOSTS
# @TEST-EXEC: mv known_services.log knownservices-local.log # @TEST-EXEC: mv known_services.log knownservices-local.log
# @TEST-EXEC: btest-diff knownservices-local.log # @TEST-EXEC: btest-diff knownservices-local.log