mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
Tweaking the custom-rotate test to produce stable output.
There seems to be a race condition in capturing the external shell's stdout output reliably. As far as I can tell, Bro's doing everything correctly though, the log postprocessors gets executed as expected. So I rewrote the test to capture the output in a separate file first, and that seems to solve the test failures.
This commit is contained in:
parent
951444ee73
commit
412bebb703
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
#
|
#
|
||||||
#@TEST-EXEC: bro -b -r ${TRACES}/rotation.trace %INPUT | egrep "test|test2" | sort >out
|
# @TEST-EXEC: bro -b -r ${TRACES}/rotation.trace %INPUT | egrep "test|test2" | sort >out.tmp
|
||||||
|
# @TEST-EXEC: cat out.tmp pp.log | sort >out
|
||||||
# @TEST-EXEC: for i in `ls test*.log | sort`; do printf '> %s\n' $i; cat $i; done | sort | uniq >>out
|
# @TEST-EXEC: for i in `ls test*.log | sort`; do printf '> %s\n' $i; cat $i; done | sort | uniq >>out
|
||||||
# @TEST-EXEC: btest-diff out
|
# @TEST-EXEC: btest-diff out
|
||||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-sort btest-diff .stderr
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-sort btest-diff .stderr
|
||||||
|
@ -19,7 +20,7 @@ export {
|
||||||
}
|
}
|
||||||
|
|
||||||
redef Log::default_rotation_interval = 1hr;
|
redef Log::default_rotation_interval = 1hr;
|
||||||
redef Log::default_rotation_postprocessor_cmd = "echo 1st";
|
redef Log::default_rotation_postprocessor_cmd = "echo 1st >>pp.log";
|
||||||
|
|
||||||
function custom_rotate(info: Log::RotationInfo) : bool
|
function custom_rotate(info: Log::RotationInfo) : bool
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue