diff options
author | Phil Sutter <phil@nwl.cc> | 2017-07-25 16:56:24 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-07-25 17:58:22 +0200 |
commit | f9158151f368b009bed2ef3da4ea252014ab11f1 (patch) | |
tree | ed17fcdffba305434245d7d1144084f518cadcbc /tests/monitor | |
parent | e8f4fdb0097769cab0c1f7b56f610d05dbae43bc (diff) |
tests/monitor: Ignore newgen messages in output
Predicting the new ID value is not feasible and neither is implementing
support for regular expressions when matching monitor output, so simply
ignore them.
Also use diff option '-w' instead of '-Z' to ignore all whitespace, not
just at EOL.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/monitor')
-rwxr-xr-x | tests/monitor/run-tests.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/monitor/run-tests.sh b/tests/monitor/run-tests.sh index 7447adf1..e21ed688 100755 --- a/tests/monitor/run-tests.sh +++ b/tests/monitor/run-tests.sh @@ -10,6 +10,9 @@ fi trap "rm -rf $testdir" EXIT nft=../../src/nft +mydiff() { + diff -w -I '^# ' "$@" +} command_file=$(mktemp -p $testdir) output_file=$(mktemp -p $testdir) @@ -35,9 +38,9 @@ run_test() { sleep 0.5 kill $monitor_pid wait >/dev/null 2>&1 - if ! diff -Z -q $monitor_output $output_file >/dev/null 2>&1; then + if ! mydiff -q $monitor_output $output_file >/dev/null 2>&1; then echo "monitor output differs!" - diff -Z -u $output_file $monitor_output + mydiff -u $output_file $monitor_output exit 1 fi rm $command_file |