From 7a41170a59192b1be061c130a8a1f4b7648293c9 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Mon, 1 Aug 2022 16:47:17 -0700 Subject: [PATCH] updates for gen-C++ maintenance, including skipping some inappropriate tests --- src/script_opt/CPP/Stmts.cc | 2 +- src/script_opt/CPP/maint/README | 13 +++++++++++- src/script_opt/CPP/maint/check-CPP-gen.sh | 17 ++++++++++++--- src/script_opt/CPP/maint/do-CPP-btest.sh | 13 +++++++++++- testing/btest/Baseline.cpp/bifs.backtrace/out | 4 +++- .../Baseline.cpp/bifs.disable_analyzer/out | 7 +++++++ .../btest/Baseline.cpp/bifs.type_aliases/out | 12 +++++------ .../broker.store.create-failure/zeek.err | 11 ++++++++++ .../broker.store.create-failure/zeek.out | 21 +++++++++++++++++++ .../core.parse-only-usage-issues/out | 1 + .../core.reporter/logger-test.log | 6 +++--- .../btest/Baseline.cpp/core.reporter/output | 6 +++--- .../zeek.output | 15 +++++++++++++ .../Baseline.cpp/language.copy-all-types/out | 4 ++-- .../language.index-assignment-invalid/out | 10 ++++----- .../Baseline.cpp/plugins.reporter-hook/output | 19 ++++++++++------- .../plugins.reporter-hook/reporter.log | 6 +++--- .../output | 7 +++++++ .../err | 1 + .../coverage.coverage-blacklist/output | 18 ++++++++-------- .../Baseline/language.common-mistakes2/err | 2 +- .../Baseline/language.unused-assignment/out | 2 +- testing/btest/bifs/piped_exec.zeek | 6 +++++- testing/btest/core/load-duplicates.zeek | 3 +++ testing/btest/core/load-stdin.zeek | 5 +++++ testing/btest/core/pcap/filter-error.zeek | 4 ++++ testing/btest/core/script-args.zeek | 4 ++++ .../btest/coverage/coverage-blacklist.zeek | 3 +++ testing/btest/doc/zeekygen/command_line.zeek | 3 +++ testing/btest/language/common-mistakes2.zeek | 7 ++++--- testing/btest/language/unused-assignment.zeek | 3 +++ .../analyzer/register-for-port.zeek | 5 ++++- .../protocols/http/multipart-file-limit.zeek | 4 ++++ .../smb/smb2-create-delete-on-close.zeek | 3 +++ .../policy/protocols/conn/known-hosts.zeek | 3 +++ .../policy/protocols/conn/known-services.zeek | 3 +++ 36 files changed, 200 insertions(+), 53 deletions(-) create mode 100644 testing/btest/Baseline.cpp/bifs.disable_analyzer/out create mode 100644 testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err create mode 100644 testing/btest/Baseline.cpp/broker.store.create-failure/zeek.out create mode 100644 testing/btest/Baseline.cpp/core.parse-only-usage-issues/out create mode 100644 testing/btest/Baseline.cpp/core.when-interpreter-exceptions/zeek.output create mode 100644 testing/btest/Baseline.cpp/scripts.base.frameworks.analyzer.tags/output diff --git a/src/script_opt/CPP/Stmts.cc b/src/script_opt/CPP/Stmts.cc index 8cc5a5f39c..edef5b0b3a 100644 --- a/src/script_opt/CPP/Stmts.cc +++ b/src/script_opt/CPP/Stmts.cc @@ -495,7 +495,7 @@ void CPPCompile::GenForOverTable(const ExprPtr& tbl, const IDPtr& value_var, StartBlock(); Emit("auto k__CPP = lve__CPP.GetHashKey();"); - Emit("auto* current_tev__CPP = lve__CPP.GetValue();"); + Emit("auto* current_tev__CPP = lve__CPP.value;"); Emit("auto ind_lv__CPP = tv__CPP->RecreateIndex(*k__CPP);"); if ( value_var ) diff --git a/src/script_opt/CPP/maint/README b/src/script_opt/CPP/maint/README index f1383be5f0..366dd40261 100644 --- a/src/script_opt/CPP/maint/README +++ b/src/script_opt/CPP/maint/README @@ -15,7 +15,7 @@ The maintenance workflow: to check in updates to the list of how the compiler currently fares 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 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 complex-to-debug - hard-to-figure-out failure 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 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/pcap/dumper.zeek no-script ../testing/btest/core/pcap/input-error.zeek command-line-error ../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.zeek @if ../testing/btest/language/at-ifdef.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/when-aggregates.zeek bad-when ../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-func2.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-all-msg-types.zeek no-script ../testing/btest/scripts/base/protocols/dhcp/dhcp-discover-msg-types.zeek no-script diff --git a/src/script_opt/CPP/maint/check-CPP-gen.sh b/src/script_opt/CPP/maint/check-CPP-gen.sh index e8c56fbf91..efa52d03a5 100755 --- a/src/script_opt/CPP/maint/check-CPP-gen.sh +++ b/src/script_opt/CPP/maint/check-CPP-gen.sh @@ -1,8 +1,19 @@ #! /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" " - (src/zeek -O gen-C++ --optimize-files=testing/btest --optimize-func="" $1 >&/dev/null && echo "success") || echo "fail" -) >CPP-test/$out 2>&1 + if ! src/zeek -O gen-C++ --optimize-files=testing/btest $1 >&$gen_out 2>&1; then + 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 diff --git a/src/script_opt/CPP/maint/do-CPP-btest.sh b/src/script_opt/CPP/maint/do-CPP-btest.sh index 3146db4997..acd5bc6c1b 100755 --- a/src/script_opt/CPP/maint/do-CPP-btest.sh +++ b/src/script_opt/CPP/maint/do-CPP-btest.sh @@ -1,11 +1,22 @@ #! /bin/sh rm -f CPP-gen.cc + cp zeek.HOLD src/zeek || ( echo Need to create clean zeek.HOLD 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') rel_test=$(echo $1 | sed 's,.*testing/btest/,,') @@ -26,5 +37,5 @@ ninja ( 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 ) diff --git a/testing/btest/Baseline.cpp/bifs.backtrace/out b/testing/btest/Baseline.cpp/bifs.backtrace/out index ceb28402d7..dcf4a006ea 100644 --- a/testing/btest/Baseline.cpp/bifs.backtrace/out +++ b/testing/btest/Baseline.cpp/bifs.backtrace/out @@ -1,8 +1,10 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. --- Backtrace --- +#0: zeek_init() --- Backtrace --- - +| #0: zeek_init() | --- Backtrace --- +#0: zeek_init() diff --git a/testing/btest/Baseline.cpp/bifs.disable_analyzer/out b/testing/btest/Baseline.cpp/bifs.disable_analyzer/out new file mode 100644 index 0000000000..2a4cdae144 --- /dev/null +++ b/testing/btest/Baseline.cpp/bifs.disable_analyzer/out @@ -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 +} diff --git a/testing/btest/Baseline.cpp/bifs.type_aliases/out b/testing/btest/Baseline.cpp/bifs.type_aliases/out index bf28df18e5..dab1c31ead 100644 --- a/testing/btest/Baseline.cpp/bifs.type_aliases/out +++ b/testing/btest/Baseline.cpp/bifs.type_aliases/out @@ -5,16 +5,16 @@ type aliases for 'MyRec val': MyRec MyRecAlias type aliases for 'MyRecAlias val': MyRec MyRecAlias type aliases for 'MyRec 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 'MyOtherString type': MyOtherString 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 'MyTable value': MyTable2 MyTable3 MyTable MyTable4 -type aliases for 'MyTable2 value': MyTable2 MyTable3 MyTable MyTable4 -type aliases for 'MyTable3 value': MyTable2 MyTable3 MyTable MyTable4 -type aliases for 'MyTable4 value': MyTable2 MyTable3 MyTable MyTable4 +type aliases for 'MyTable value': it's just a 'table[count] of string' +type aliases for 'MyTable2 value': it's just a 'table[count] of string' +type aliases for 'MyTable3 value': it's just a 'table[count] of string' +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 'MyTable2 type': MyTable2 MyTable3 MyTable MyTable4 type aliases for 'MyTable3 type': MyTable2 MyTable3 MyTable MyTable4 diff --git a/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err b/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err new file mode 100644 index 0000000000..b539cd1ff9 --- /dev/null +++ b/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err @@ -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 : invalid Broker store handle (broker::store::{}) +error in : invalid Broker store handle (broker::store::{}) +error in : invalid Broker store handle (broker::store::{}) +error in : invalid Broker store handle (broker::store::{}) +error in : invalid Broker store handle (broker::store::{}) +error in : invalid Broker store handle (broker::store::{}) +error in : invalid Broker store handle (broker::store::{}) +received termination signal diff --git a/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.out b/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.out new file mode 100644 index 0000000000..dcf0911820 --- /dev/null +++ b/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.out @@ -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=]] +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=]] +c1 keys result: [status=Broker::FAILURE, result=[data=]] +m2 keys result: [status=Broker::FAILURE, result=[data=]] +c2 keys result: [status=Broker::FAILURE, result=[data=]] +c1 timeout diff --git a/testing/btest/Baseline.cpp/core.parse-only-usage-issues/out b/testing/btest/Baseline.cpp/core.parse-only-usage-issues/out new file mode 100644 index 0000000000..49d861c74c --- /dev/null +++ b/testing/btest/Baseline.cpp/core.parse-only-usage-issues/out @@ -0,0 +1 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. diff --git a/testing/btest/Baseline.cpp/core.reporter/logger-test.log b/testing/btest/Baseline.cpp/core.reporter/logger-test.log index 5af5e97ecc..63a8abaf9d 100644 --- a/testing/btest/Baseline.cpp/core.reporter/logger-test.log +++ b/testing/btest/Baseline.cpp/core.reporter/logger-test.log @@ -1,7 +1,7 @@ ### 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_warning|init test-warning||XXXXXXXXXX.XXXXXX -reporter_error|init test-error||XXXXXXXXXX.XXXXXX +reporter_info|init test-info|<...>/main.zeek, lines 498-499|XXXXXXXXXX.XXXXXX +reporter_warning|init test-warning|<...>/main.zeek, lines 498-499|XXXXXXXXXX.XXXXXX +reporter_error|init test-error|<...>/main.zeek, lines 498-499|XXXXXXXXXX.XXXXXX reporter_info|done test-info||XXXXXXXXXX.XXXXXX reporter_warning|done test-warning||XXXXXXXXXX.XXXXXX reporter_error|done test-error||XXXXXXXXXX.XXXXXX diff --git a/testing/btest/Baseline.cpp/core.reporter/output b/testing/btest/Baseline.cpp/core.reporter/output index 5f77582fab..3e0dc0148f 100644 --- a/testing/btest/Baseline.cpp/core.reporter/output +++ b/testing/btest/Baseline.cpp/core.reporter/output @@ -2,9 +2,9 @@ pre test-info warning: pre test-warning error: pre test-error -init test-info -warning: init test-warning -error: init test-error +<...>/main.zeek, lines 498-499: init test-info +warning in <...>/main.zeek, lines 498-499: init test-warning +error in <...>/main.zeek, lines 498-499: init test-error done test-info warning: done test-warning error: done test-error diff --git a/testing/btest/Baseline.cpp/core.when-interpreter-exceptions/zeek.output b/testing/btest/Baseline.cpp/core.when-interpreter-exceptions/zeek.output new file mode 100644 index 0000000000..224ede9eb8 --- /dev/null +++ b/testing/btest/Baseline.cpp/core.when-interpreter-exceptions/zeek.output @@ -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 diff --git a/testing/btest/Baseline.cpp/language.copy-all-types/out b/testing/btest/Baseline.cpp/language.copy-all-types/out index 7f4e48b9bc..64879eb6ba 100644 --- a/testing/btest/Baseline.cpp/language.copy-all-types/out +++ b/testing/btest/Baseline.cpp/language.copy-all-types/out @@ -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=[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=ENUMME (enum MyEnum) clone=ENUMME (enum MyEnum) equal=T same_object=F (FAIL1) -orig=[s1=s1, s2=s2, i1=[a=a], i2=[a=a], donotset=, 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=, 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=ENUMME (MyEnum) clone=ENUMME (MyEnum) equal=T same_object=F (FAIL1) +orig=[s1=s1, s2=s2, i1=[a=a], i2=[a=a], donotset=, def=5] (TestRecord) clone=[s1=s1, s2=s2, i1=[a=a], i2=[a=a], donotset=, def=5] (TestRecord) equal=T same_object=F (ok) diff --git a/testing/btest/Baseline.cpp/language.index-assignment-invalid/out b/testing/btest/Baseline.cpp/language.index-assignment-invalid/out index 64b64919f2..60950763c1 100644 --- a/testing/btest/Baseline.cpp/language.index-assignment-invalid/out +++ b/testing/btest/Baseline.cpp/language.index-assignment-invalid/out @@ -1,6 +1,6 @@ ### 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=] -runtime error in compiled code: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=] -runtime error in compiled code: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=] -runtime error in compiled code: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=] -runtime error in compiled code: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=] +runtime error in <...>/queue.zeek, line 152: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=], expression: Queue::ret[Queue::j], call stack: + #0 Queue::get_vector([initialized=T, vals={[2] = test,[3] = [a=T, b=hi, c=],[5] = 3,[0] = hello,[6] = jkl;,[4] = asdf,[1] = goodbye}, settings=[max_len=], top=7, bottom=0, size=0], [hello, goodbye, test]) at <...>/main.zeek:498 + #1 zeek_init() + + diff --git a/testing/btest/Baseline.cpp/plugins.reporter-hook/output b/testing/btest/Baseline.cpp/plugins.reporter-hook/output index 5cd10dea1f..90d7998a3e 100644 --- a/testing/btest/Baseline.cpp/plugins.reporter-hook/output +++ b/testing/btest/Baseline.cpp/plugins.reporter-hook/output @@ -1,11 +1,14 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. - | Hook Some Info - | Hook error An Error - | Hook error An Error that does not show up in the log +Reporter::Hook - Exercise Reporter Hook (dynamic, version 1.0.0) + Implements Reporter (priority 0) + + | 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 warning A warning -Some Info -error: An Error -error: An Error that does not show up in the log + | Hook warning A warning <...>/main.zeek, lines 498-499 +<...>/main.zeek, lines 498-499: Some Info +error in <...>/main.zeek, lines 498-499: An Error +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 -warning: A warning +warning in <...>/main.zeek, lines 498-499: A warning diff --git a/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log b/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log index fefdfc18d6..d7d3df0419 100644 --- a/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log +++ b/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log @@ -7,8 +7,8 @@ #open XXXX-XX-XX-XX-XX-XX #fields ts level message location #types time enum string string -XXXXXXXXXX.XXXXXX Reporter::INFO Some Info (empty) -XXXXXXXXXX.XXXXXX Reporter::WARNING A warning (empty) -XXXXXXXXXX.XXXXXX Reporter::ERROR An Error (empty) +XXXXXXXXXX.XXXXXX Reporter::INFO Some Info <...>/main.zeek, lines 498-499 +XXXXXXXXXX.XXXXXX Reporter::WARNING A warning <...>/main.zeek, lines 498-499 +XXXXXXXXXX.XXXXXX Reporter::ERROR An Error <...>/main.zeek, lines 498-499 XXXXXXXXXX.XXXXXX Reporter::ERROR field value missing (empty) #close XXXX-XX-XX-XX-XX-XX diff --git a/testing/btest/Baseline.cpp/scripts.base.frameworks.analyzer.tags/output b/testing/btest/Baseline.cpp/scripts.base.frameworks.analyzer.tags/output new file mode 100644 index 0000000000..2901042f3b --- /dev/null +++ b/testing/btest/Baseline.cpp/scripts.base.frameworks.analyzer.tags/output @@ -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 diff --git a/testing/btest/Baseline.cpp/scripts.base.frameworks.file-analysis.bifs.file_exists_lookup_file/err b/testing/btest/Baseline.cpp/scripts.base.frameworks.file-analysis.bifs.file_exists_lookup_file/err index ee509ce372..f92621dcef 100644 --- a/testing/btest/Baseline.cpp/scripts.base.frameworks.file-analysis.bifs.file_exists_lookup_file/err +++ b/testing/btest/Baseline.cpp/scripts.base.frameworks.file-analysis.bifs.file_exists_lookup_file/err @@ -1,2 +1,3 @@ ### 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 +warning: non-void function returning without a value: Files::lookup_file diff --git a/testing/btest/Baseline/coverage.coverage-blacklist/output b/testing/btest/Baseline/coverage.coverage-blacklist/output index c0cb3e558c..99f220914d 100644 --- a/testing/btest/Baseline/coverage.coverage-blacklist/output +++ b/testing/btest/Baseline/coverage.coverage-blacklist/output @@ -1,10 +1,10 @@ ### 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 15 if (T) { print always executed; } -1 <...>/coverage-blacklist.zeek, line 17 print always executed; -1 <...>/coverage-blacklist.zeek, line 22 if (0 + 0 == 1) print impossible; -1 <...>/coverage-blacklist.zeek, line 24 if (1 == 0) { print also impossible, but included in code coverage analysis; } -0 <...>/coverage-blacklist.zeek, line 26 print also impossible, but included in code coverage analysis; -1 <...>/coverage-blacklist.zeek, line 29 print success; -1 <...>/coverage-blacklist.zeek, line 5 print first; -1 <...>/coverage-blacklist.zeek, line 7 if (F) { print hello; print world; } +1 <...>/coverage-blacklist.zeek, line 10 if (F) { print hello; print world; } +1 <...>/coverage-blacklist.zeek, line 16 print cover me; +1 <...>/coverage-blacklist.zeek, line 18 if (T) { print always executed; } +1 <...>/coverage-blacklist.zeek, line 20 print always executed; +1 <...>/coverage-blacklist.zeek, line 25 if (0 + 0 == 1) print impossible; +1 <...>/coverage-blacklist.zeek, line 27 if (1 == 0) { print also impossible, but included in code coverage analysis; } +0 <...>/coverage-blacklist.zeek, line 29 print also impossible, but included in code coverage analysis; +1 <...>/coverage-blacklist.zeek, line 32 print success; +1 <...>/coverage-blacklist.zeek, line 8 print first; diff --git a/testing/btest/Baseline/language.common-mistakes2/err b/testing/btest/Baseline/language.common-mistakes2/err index 53363fbd9b..aa104a9b32 100644 --- a/testing/btest/Baseline/language.common-mistakes2/err +++ b/testing/btest/Baseline/language.common-mistakes2/err @@ -1,2 +1,2 @@ ### 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) diff --git a/testing/btest/Baseline/language.unused-assignment/out b/testing/btest/Baseline/language.unused-assignment/out index 8b9959a034..4e7cd14878 100644 --- a/testing/btest/Baseline/language.unused-assignment/out +++ b/testing/btest/Baseline/language.unused-assignment/out @@ -1,2 +1,2 @@ ### 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 diff --git a/testing/btest/bifs/piped_exec.zeek b/testing/btest/bifs/piped_exec.zeek index 0aa0238a3e..c77a74292f 100644 --- a/testing/btest/bifs/piped_exec.zeek +++ b/testing/btest/bifs/piped_exec.zeek @@ -4,7 +4,11 @@ global cmds = "print \"hello world\";"; 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); # Test null output. diff --git a/testing/btest/core/load-duplicates.zeek b/testing/btest/core/load-duplicates.zeek index 212fc577ac..d1e9d2455e 100644 --- a/testing/btest/core/load-duplicates.zeek +++ b/testing/btest/core/load-duplicates.zeek @@ -1,5 +1,8 @@ # 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: echo "@load bar/test" >loader.zeek # @TEST-EXEC: cp %INPUT foo/bar/test.zeek diff --git a/testing/btest/core/load-stdin.zeek b/testing/btest/core/load-stdin.zeek index e3aa49dc02..51c3979c8c 100644 --- a/testing/btest/core/load-stdin.zeek +++ b/testing/btest/core/load-stdin.zeek @@ -1,4 +1,9 @@ # 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.explicit # @TEST-EXEC: echo 'print "stdin";' | zeek -b %INPUT >output.nostdin diff --git a/testing/btest/core/pcap/filter-error.zeek b/testing/btest/core/pcap/filter-error.zeek index ae9a40d70f..7e9fba125c 100644 --- a/testing/btest/core/pcap/filter-error.zeek +++ b/testing/btest/core/pcap/filter-error.zeek @@ -3,6 +3,10 @@ # greps to validate that we got a syntax error in the output with the string that we passed # 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: test -e conn.log # @TEST-EXEC: grep "kaputt" output | grep -q "syntax error" diff --git a/testing/btest/core/script-args.zeek b/testing/btest/core/script-args.zeek index 2e38f411cc..b229c87ada 100644 --- a/testing/btest/core/script-args.zeek +++ b/testing/btest/core/script-args.zeek @@ -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 "$BUILD/src/zeek -b --\n" >> test.zeek # @TEST-EXEC: cat %INPUT >> test.zeek diff --git a/testing/btest/coverage/coverage-blacklist.zeek b/testing/btest/coverage/coverage-blacklist.zeek index 75ef0feb79..8899159478 100644 --- a/testing/btest/coverage/coverage-blacklist.zeek +++ b/testing/btest/coverage/coverage-blacklist.zeek @@ -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: grep %INPUT coverage | sort -k2 >output # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output diff --git a/testing/btest/doc/zeekygen/command_line.zeek b/testing/btest/doc/zeekygen/command_line.zeek index 434122b0cd..6eeb6e8191 100644 --- a/testing/btest/doc/zeekygen/command_line.zeek +++ b/testing/btest/doc/zeekygen/command_line.zeek @@ -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 # that's supplied via command line script. diff --git a/testing/btest/language/common-mistakes2.zeek b/testing/btest/language/common-mistakes2.zeek index 20c1ae0f1f..eead53ba31 100644 --- a/testing/btest/language/common-mistakes2.zeek +++ b/testing/btest/language/common-mistakes2.zeek @@ -1,9 +1,10 @@ # 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 -# vector-of-any, which doesn't seem worth going out of our way to support -# in ZAM (and it isn't dead simple to do so). +# this test when using script optimization, since it employs a type-checking +# violation via vector-of-any, which doesn't seem worth going out of our way +# to support for script optimization. # @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1" +# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1" # @TEST-EXEC: zeek -b %INPUT >out 2>err # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out diff --git a/testing/btest/language/unused-assignment.zeek b/testing/btest/language/unused-assignment.zeek index 0958eaa7d5..e3c617af3b 100644 --- a/testing/btest/language/unused-assignment.zeek +++ b/testing/btest/language/unused-assignment.zeek @@ -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: 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. diff --git a/testing/btest/scripts/base/frameworks/analyzer/register-for-port.zeek b/testing/btest/scripts/base/frameworks/analyzer/register-for-port.zeek index d7fdb5fc50..d37212a2d2 100644 --- a/testing/btest/scripts/base/frameworks/analyzer/register-for-port.zeek +++ b/testing/btest/scripts/base/frameworks/analyzer/register-for-port.zeek @@ -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: cat conn.log | zeek-cut service | grep -q ssh # diff --git a/testing/btest/scripts/base/protocols/http/multipart-file-limit.zeek b/testing/btest/scripts/base/protocols/http/multipart-file-limit.zeek index 1050baccaa..bbfed736ca 100644 --- a/testing/btest/scripts/base/protocols/http/multipart-file-limit.zeek +++ b/testing/btest/scripts/base/protocols/http/multipart-file-limit.zeek @@ -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: btest-diff http.log # @TEST-EXEC: zeek -b -C -r $TRACES/http/multipart.trace base/protocols/http %INPUT >out-limited diff --git a/testing/btest/scripts/base/protocols/smb/smb2-create-delete-on-close.zeek b/testing/btest/scripts/base/protocols/smb/smb2-create-delete-on-close.zeek index 47e49c71ee..5dbb5d147a 100644 --- a/testing/btest/scripts/base/protocols/smb/smb2-create-delete-on-close.zeek +++ b/testing/btest/scripts/base/protocols/smb/smb2-create-delete-on-close.zeek @@ -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: btest-diff smb_files.log # @TEST-EXEC: btest-diff smb_cmd.log diff --git a/testing/btest/scripts/policy/protocols/conn/known-hosts.zeek b/testing/btest/scripts/policy/protocols/conn/known-hosts.zeek index 38d14a4607..3359731565 100644 --- a/testing/btest/scripts/policy/protocols/conn/known-hosts.zeek +++ b/testing/btest/scripts/policy/protocols/conn/known-hosts.zeek @@ -1,5 +1,8 @@ # 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: mv known_hosts.log knownhosts-local.log # @TEST-EXEC: btest-diff knownhosts-local.log diff --git a/testing/btest/scripts/policy/protocols/conn/known-services.zeek b/testing/btest/scripts/policy/protocols/conn/known-services.zeek index 3c34adadc9..5a621cbfcd 100644 --- a/testing/btest/scripts/policy/protocols/conn/known-services.zeek +++ b/testing/btest/scripts/policy/protocols/conn/known-services.zeek @@ -1,5 +1,8 @@ # 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: mv known_services.log knownservices-local.log # @TEST-EXEC: btest-diff knownservices-local.log