summaryrefslogtreecommitdiffstats
path: root/tests/run_qa.sh
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2015-02-13 14:00:27 +0100
committerFlorian Westphal <fw@strlen.de>2015-02-13 14:00:27 +0100
commit36305b80176e2e7abe56bcdd084c0ba3d0fd7c0f (patch)
treedea4868d0a4485b2aa0416ff5cfe226c4d575001 /tests/run_qa.sh
parent87f82cbd4f94cca74eb58506e117f226a2270759 (diff)
tests: split into family and table specific files
also add simple script to restore/save them. run_qa.sh passes on standard-distro kernels. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/run_qa.sh')
-rw-r--r--tests/run_qa.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/run_qa.sh b/tests/run_qa.sh
new file mode 100644
index 00000000..1b045f5b
--- /dev/null
+++ b/tests/run_qa.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+set -e
+
+test_family() {
+ f=$1
+ xt=$2
+
+ for file in options-"$f".* ;do
+ echo "restoring $file"
+ "$xt"tables-restore < "$file"
+ done
+}
+
+test_family ipv4 ip
+test_family ipv6 ip6
+
+TMPA=$(mktemp) || exit 111
+TMPB=$(mktemp) || exit 111
+
+iptables-save > "$TMPA"
+(iptables-save | iptables-restore) || exit 111
+iptables-save > "$TMPB"
+
+echo "iptables diff"
+diff -u "$TMPA" "$TMPB"
+
+rm "$TMPA" "$TMPB"
+
+ip6tables-save > "$TMPA"
+(ip6tables-save | ip6tables-restore) || exit 111
+ip6tables-save > "$TMPB"
+
+echo "ip6tables diff"
+diff -u "$TMPA" "$TMPB"
+
+rm "$TMPA" "$TMPB"
+
+