netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [nft PATCH v2 3/3] tests/monitor: Clear ruleset after testing
Date: Tue, 25 Jul 2017 20:39:44 +0200	[thread overview]
Message-ID: <20170725183944.9377-4-phil@nwl.cc> (raw)
In-Reply-To: <20170725183944.9377-1-phil@nwl.cc>

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tests/monitor/run-tests.sh | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/monitor/run-tests.sh b/tests/monitor/run-tests.sh
index de19462438d64..9fd0e504d08c0 100755
--- a/tests/monitor/run-tests.sh
+++ b/tests/monitor/run-tests.sh
@@ -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)
 
-- 
2.13.1


  parent reply	other threads:[~2017-07-25 18:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 18:39 [nft PATCH v2 0/3] monitor: Some fixes and improvements Phil Sutter
2017-07-25 18:39 ` [nft PATCH v2 1/3] monitor: Fix printing of set declarations Phil Sutter
2017-07-25 18:39 ` [nft PATCH v2 2/3] tests/monitor: Simplify testcases Phil Sutter
2017-07-25 18:39 ` Phil Sutter [this message]
2017-07-27  8:50 ` [nft PATCH v2 0/3] monitor: Some fixes and improvements Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170725183944.9377-4-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).