]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/monitor: Clear ruleset after testing
authorPhil Sutter <phil@nwl.cc>
Tue, 25 Jul 2017 18:39:44 +0000 (20:39 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 27 Jul 2017 08:50:21 +0000 (10:50 +0200)
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/monitor/run-tests.sh

index de19462438d64ace491bdc2d8558f42b5870550f..9fd0e504d08c05f056a0b3854e1410627568d619 100755 (executable)
@@ -2,17 +2,18 @@
 
 cd $(dirname $0)
 
+nft=../../src/nft
+mydiff() {
+       diff -w -I '^# ' "$@"
+}
+
 testdir=$(mktemp -d)
 if [ ! -d $testdir ]; then
        echo "Failed to create test directory" >&2
        exit 0
 fi
-trap "rm -rf $testdir" EXIT
+trap "rm -rf $testdir; $nft flush ruleset" EXIT
 
-nft=../../src/nft
-mydiff() {
-       diff -w -I '^# ' "$@"
-}
 command_file=$(mktemp -p $testdir)
 output_file=$(mktemp -p $testdir)