summaryrefslogtreecommitdiffstats
path: root/tests/run_qa.sh
diff options
context:
space:
mode:
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"
+
+