[netfilter-cvslog] r3474 - in trunk/nfsim-testsuite: . 01iptables 02conntrack 03NAT

rusty at netfilter.org rusty at netfilter.org
Mon Dec 20 07:46:58 CET 2004


Author: rusty at netfilter.org
Date: 2004-12-20 07:46:58 +0100 (Mon, 20 Dec 2004)
New Revision: 3474

Removed:
   trunk/nfsim-testsuite/expected-failures
Modified:
   trunk/nfsim-testsuite/01iptables/20ipt_MARK.sim
   trunk/nfsim-testsuite/01iptables/23ipt_tos-bad-args.sim
   trunk/nfsim-testsuite/01iptables/26ipt_ttl-out-of-range.sim
   trunk/nfsim-testsuite/01iptables/36ipt_multiport-bad-args-complain.sim
   trunk/nfsim-testsuite/02conntrack/05loopback.sim
   trunk/nfsim-testsuite/02conntrack/10ftp-pasv.sim
   trunk/nfsim-testsuite/02conntrack/10ftp-port.sim
   trunk/nfsim-testsuite/03NAT/03ip_dnat.sim
   trunk/nfsim-testsuite/03NAT/05dnat_reply.sim
   trunk/nfsim-testsuite/03NAT/13ip_nat_fill.sim
   trunk/nfsim-testsuite/03NAT/17masq.sim
   trunk/nfsim-testsuite/03NAT/21loopback.sim
   trunk/nfsim-testsuite/test.sh
Log:
Move expected failure information into tests themselves (comments).


Modified: trunk/nfsim-testsuite/01iptables/20ipt_MARK.sim
===================================================================
--- trunk/nfsim-testsuite/01iptables/20ipt_MARK.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/01iptables/20ipt_MARK.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,4 +1,6 @@
 # Test the ipt_MARK target, which has a backwards compatbility mode.
+# Not merged in kernel yet, fails on everything:
+#	XFAIL:linux:*
 
 # Test old-style first, insert and delete.
 iptables -t mangle -A PREROUTING -j MARK --set-mark 7

Modified: trunk/nfsim-testsuite/01iptables/23ipt_tos-bad-args.sim
===================================================================
--- trunk/nfsim-testsuite/01iptables/23ipt_tos-bad-args.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/01iptables/23ipt_tos-bad-args.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -7,6 +7,9 @@
 # I sent a patch to nf-devel.
 # someone can apply it please ?. thanks.
 # https://lists.netfilter.org/pipermail/netfilter-devel/2004-December/017824.html
+# Applied for 1.3
+# XFAIL:iptables:1.2*
+
 expect iptables iptables: command failed
 iptables -A INPUT -m tos --tos 2 --tos 4
 

Modified: trunk/nfsim-testsuite/01iptables/26ipt_ttl-out-of-range.sim
===================================================================
--- trunk/nfsim-testsuite/01iptables/26ipt_ttl-out-of-range.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/01iptables/26ipt_ttl-out-of-range.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,6 +1,7 @@
 # This should fail but it doesn't because patch was lost
 # somewhere in the outter limit.
 # https://lists.netfilter.org/pipermail/netfilter-cvslog/2004-July/003454.html
+# XFAIL:iptables:*
 expect iptables iptables: command failed
 iptables -A INPUT -m ttl --ttl-eq -1
 expect iptables iptables: command failed

Modified: trunk/nfsim-testsuite/01iptables/36ipt_multiport-bad-args-complain.sim
===================================================================
--- trunk/nfsim-testsuite/01iptables/36ipt_multiport-bad-args-complain.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/01iptables/36ipt_multiport-bad-args-complain.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,5 +1,6 @@
 # Multiport doesn't support invert.
 # Older versions don't complain about it.
+# XFAIL:iptables:1.2*
 expect iptables *multiport does not support invert
 expect iptables *command failed
 iptables -I INPUT -p tcp -m multiport ! --source-ports 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15

Modified: trunk/nfsim-testsuite/02conntrack/05loopback.sim
===================================================================
--- trunk/nfsim-testsuite/02conntrack/05loopback.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/02conntrack/05loopback.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,4 +1,6 @@
 # Loopback connection tracking: should get a single connection.
+# 2.4 doesn't have /proc/net/stat
+# XFAIL:linux:2.4*
 
 expect gen_ip send:lo {IPv4 127.0.0.1 127.0.0.1 0 1 8 0 55 57}
 gen_ip 127.0.0.1 127.0.0.1 0 1 8 0 55 57

Modified: trunk/nfsim-testsuite/02conntrack/10ftp-pasv.sim
===================================================================
--- trunk/nfsim-testsuite/02conntrack/10ftp-pasv.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/02conntrack/10ftp-pasv.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,4 +1,6 @@
 # Tests for PASV recognition.
+# 2.4 doesn't have /proc/net/stat
+# XFAIL:linux:2.4*
 
 # Drop invalid packets, in case this script has a mistake.
 iptables -A FORWARD -m state --state INVALID -j DROP

Modified: trunk/nfsim-testsuite/02conntrack/10ftp-port.sim
===================================================================
--- trunk/nfsim-testsuite/02conntrack/10ftp-port.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/02conntrack/10ftp-port.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,4 +1,6 @@
 # Test ftp module's tracking code for PORT commands.
+# 2.4 doesn't have /proc/net/stat
+# XFAIL:linux:2.4*
 
 # Drop invalid packets, in case this script has a mistake.
 iptables -A FORWARD -m state --state INVALID -j DROP

Modified: trunk/nfsim-testsuite/03NAT/03ip_dnat.sim
===================================================================
--- trunk/nfsim-testsuite/03NAT/03ip_dnat.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/03NAT/03ip_dnat.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,3 +1,6 @@
+# We currently DNAT for local packets, implicitly.
+# XFAIL:linux:*
+
 iptables -t nat -A PREROUTING -p icmp -j DNAT --to-dest 192.168.1.3 
 
 # Check it DNATs the first one.

Modified: trunk/nfsim-testsuite/03NAT/05dnat_reply.sim
===================================================================
--- trunk/nfsim-testsuite/03NAT/05dnat_reply.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/03NAT/05dnat_reply.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,5 +1,7 @@
 #! /bin/sh
 
+# XFAIL:linux:*
+
 iptables -t nat -A PREROUTING -s 192.168.0.0/24 -d 192.168.1.2 -j DNAT --to-dest 192.168.1.3
 
 # ICMP, UDP, TCP and unknown

Modified: trunk/nfsim-testsuite/03NAT/13ip_nat_fill.sim
===================================================================
--- trunk/nfsim-testsuite/03NAT/13ip_nat_fill.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/03NAT/13ip_nat_fill.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,5 +1,7 @@
 # Test the case where the NAT space fills up (packets should be dropped).
 
+# XFAIL:linux:*
+
 iptables -t nat -A POSTROUTING -p udp -s 192.168.0.2 -d 192.168.1.2 -j SNAT --to-source 192.168.0.4:1-10
 
 expect gen_ip send:eth1 {IPv4 192.168.0.4 192.168.1.2 100 17 1 1}

Modified: trunk/nfsim-testsuite/03NAT/17masq.sim
===================================================================
--- trunk/nfsim-testsuite/03NAT/17masq.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/03NAT/17masq.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,5 +1,7 @@
 # Tests for masquerading.
 
+# XFAIL:linux:*
+
 # Check we can only insert it on correct position.
 expect iptables iptables: command failed
 iptables -t nat -A PREROUTING -s 192.168.0.2 -d 192.168.1.0/24 -j MASQUERADE

Modified: trunk/nfsim-testsuite/03NAT/21loopback.sim
===================================================================
--- trunk/nfsim-testsuite/03NAT/21loopback.sim	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/03NAT/21loopback.sim	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,5 +1,7 @@
 #! /bin/sh
 
+# XFAIL:linux:*
+
 # Loopback and locally-generated packets have various of their own
 # problems.
 

Deleted: trunk/nfsim-testsuite/expected-failures
===================================================================
--- trunk/nfsim-testsuite/expected-failures	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/expected-failures	2004-12-20 06:46:58 UTC (rev 3474)
@@ -1,29 +0,0 @@
-# Format: TYPE:VERSIONPATTERN:TESTNAME
-# TYPE is "linux" or "iptables" currently
-# VERSIONPATTERN is a wildcard-style pattern to match
-# TESTNAME is the test which is expected to fail if this matches
-linux:2.6.[0-9]*:01iptables/20ipt_MARK.sim
-linux:2.6.[0-9]*:03NAT/03ip_dnat.sim
-linux:2.6.[0-9]*:03NAT/05dnat_reply.sim
-linux:2.6.[0-9]*:03NAT/13ip_nat_fill.sim
-linux:2.6.[0-9]*:03NAT/17masq.sim
-linux:2.6.[0-9]*:03NAT/21loopback.sim
-linux:2.6.9:03NAT/10source-map.sim
-linux:2.4*:01iptables/20ipt_MARK.sim
-linux:2.4*:02conntrack/05loopback.sim
-linux:2.4*:02conntrack/10ftp-pasv.sim
-linux:2.4*:02conntrack/10ftp-port.sim
-linux:2.4*:03NAT/03ip_dnat.sim
-linux:2.4*:03NAT/05dnat_reply.sim
-linux:2.4*:03NAT/13ip_nat_fill.sim
-linux:2.4*:03NAT/17masq.sim
-linux:2.4*:03NAT/21loopback.sim
-linux:2.6.10*:01iptables/20ipt_MARK.sim
-linux:2.6.10*:03NAT/03ip_dnat.sim
-linux:2.6.10*:03NAT/05dnat_reply.sim
-linux:2.6.10*:03NAT/13ip_nat_fill.sim
-linux:2.6.10*:03NAT/17masq.sim
-linux:2.6.10*:03NAT/21loopback.sim
-iptables:*:01iptables/26ipt_ttl-out-of-range.sim
-iptables:1.2*:01iptables/36ipt_multiport-bad-args-complain.sim
-iptables:1.2*:01iptables/23ipt_tos-bad-args.sim

Modified: trunk/nfsim-testsuite/test.sh
===================================================================
--- trunk/nfsim-testsuite/test.sh	2004-12-20 06:31:41 UTC (rev 3473)
+++ trunk/nfsim-testsuite/test.sh	2004-12-20 06:46:58 UTC (rev 3474)
@@ -55,40 +55,26 @@
 }
 export -f create_tempfile
 
+# Look for XFAIL:type:version lines in file to see where it's expected to fail
 expected_failure()
 {
-    grep -q :$1 expected-failures || return 1
-
-    while IFS=":" read WHAT VERSION TEST; do
-	if [ "$TEST" = "$1" ]; then
-	    case "$WHAT" in
-		linux)
-		    WVERSION=$KVERSION;;
-		iptables)
-		    WVERSION=$IPTABLES_VERSION;;
-		\#*) : ;;
-		*)
-		    echo "Unknown test in expected-failures: $TEST" >&2
-		    exit 1;;
+    grep '^[	 ]*#[	 ]XFAIL' $1 | sed 's/.*XFAIL://' |
+    (while IFS=":" read WHAT VERSION; do
+	case "$WHAT" in
+	    linux)
+		WVERSION=$KVERSION;;
+	    iptables)
+		WVERSION=$IPTABLES_VERSION;;
+	    *)
+		echo "Unknown test in expected-failures: $WHAT" >&2
+		exit 1;;
 	    esac
-
-	    case $WVERSION in
-		$VERSION) return 0;;
-	    esac
-	fi
-    done < expected-failures
-    return 1
+	case $WVERSION in
+	    $VERSION) echo 1; exit;;
+	esac
+    done; echo 0)
 }
 
-failed()
-{
-    echo
-    echo "Test for $1 failed." >&2
-    if expected_failure $f; then return 0; fi
-    if [ -n "$KEEP_GOING" ]; then return 1; fi
-    exit 1
-}
-
 valgrind_nfsim()
 {
     VG_NFSIM=$1
@@ -150,11 +136,10 @@
 	    case "$f" in *$1*) DOING=1;; *) continue;; esac
 	fi
 
-	if expected_failure $f; then
-	    XFAIL=1
+	XFAIL=`expected_failure $f`;
+	if [ $XFAIL = 1 ]; then
 	    ERROUT=/dev/null
 	else
-	    XFAIL=0
 	    ERROUT=/proc/$$/fd/1
 	fi
 	case "$f" in




More information about the netfilter-cvslog mailing list