From 36305b80176e2e7abe56bcdd084c0ba3d0fd7c0f Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 13 Feb 2015 14:00:27 +0100 Subject: 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 --- tests/run_qa.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/run_qa.sh (limited to 'tests/run_qa.sh') 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" + + -- cgit v1.2.3