mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Avoid duplicating warnings when reading table
Invalid lines in a file was the one case that would not suppress future warnings. Just make it suppress warnings too, but clear that suppression if there is a field in between that doesn't error. Fixes #3692
This commit is contained in:
parent
54391f50d9
commit
6e8d43a552
3 changed files with 61 additions and 5 deletions
|
@ -0,0 +1,50 @@
|
|||
# @TEST-EXEC: btest-bg-run zeek zeek -b %INPUT
|
||||
# @TEST-EXEC: btest-bg-wait 10
|
||||
# @TEST-EXEC: sed 1d .stderr > .stderrwithoutfirstline
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderrwithoutfirstline
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
redef InputAscii::fail_on_invalid_lines = F;
|
||||
|
||||
@TEST-START-FILE input.log
|
||||
#fields a b c
|
||||
#types string bool bool
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
"hi" T F
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
hello
|
||||
@TEST-END-FILE
|
||||
|
||||
type Key: record {
|
||||
a: string;
|
||||
};
|
||||
|
||||
type Val: record {
|
||||
b: bool &log;
|
||||
c: bool &log;
|
||||
};
|
||||
|
||||
global test_table: table[string] of Val = table();
|
||||
|
||||
event zeek_init() {
|
||||
Input::add_table([
|
||||
$source="../input.log", $name="test_table",
|
||||
$idx=Key, $val=Val, $destination=test_table,
|
||||
$mode=Input::REREAD
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
event Input::end_of_data(name: string, source:string) {
|
||||
terminate();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue