zeek/testing/btest/bifs/disable_analyzer-invalid-aid.zeek
Christian Kreibich a599fe0438 More precise error reporting for the disable_analyzer() BiF
This replaces generic reporter->Error() calls with the builtin-specific variety,
which gives better context in the resulting error messages (such as the script
and line causing it).

Includes corresponding baseline update in one affected btest.
2024-05-30 16:38:22 -07:00

15 lines
541 B
Text

# @TEST-EXEC: zeek -b -r $TRACES/wikipedia.trace %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER='$SCRIPTS/diff-canonifier | $SCRIPTS/diff-remove-abspath' btest-diff out
# @TEST-DOC: Validates that one can use disable_analyzer even for analyzers without parent. This is a regression test for #3071.
event new_connection(c: connection)
{
# Iterate over a range of analyzer IDs. This range should include e.g.,
# `TCP` which has no parent analyzer.
local i = 0;
while ( i < 200 )
{
disable_analyzer(c$id, i, F, T);
++i;
}
}