[netfilter-cvslog] r3323 - trunk/nfsim-testsuite

rusty at netfilter.org rusty at netfilter.org
Mon Dec 13 00:31:35 CET 2004


Author: rusty at netfilter.org
Date: 2004-12-13 00:31:35 +0100 (Mon, 13 Dec 2004)
New Revision: 3323

Modified:
   trunk/nfsim-testsuite/test.sh
Log:
Redirect stdout and stderr to /dev/null if expected to fail.


Modified: trunk/nfsim-testsuite/test.sh
===================================================================
--- trunk/nfsim-testsuite/test.sh	2004-12-12 23:30:43 UTC (rev 3322)
+++ trunk/nfsim-testsuite/test.sh	2004-12-12 23:31:35 UTC (rev 3323)
@@ -111,22 +111,29 @@
 	    case "$f" in *$1*) DOING=1;; *) continue;; esac
 	fi
 
+	if expected_failure $f; then
+	    XFAIL=1
+	    ERROUT=/dev/null
+	else
+	    XFAIL=0
+	    ERROUT=/proc/$$/fd/1
+	fi
 	case "$f" in
 	    # Ignore backups.
 	    *~)
 		continue;;
 	    *.sh)
-		sh -e $EXTRA_ARGS "$f"
+		sh -e $EXTRA_ARGS "$f" > $ERROUT 2>&1
 		;;
 	    *.sim)
-		$NFSIM $NFSIM_ARGS < "$f"
+		$NFSIM $NFSIM_ARGS < "$f" > $ERROUT 2>&1
 		;;
 	    *)
 		echo Unknown test type "$f" >&2
 		exit 1
 	esac
 	if [ $? -ne 0 ]; then
-	    if expected_failure $f; then 
+	    if [ $XFAIL = 1 ]; then 
 		if [ -z "$VERBOSE" ]; then
 		    echo -n x
 		else
@@ -138,7 +145,7 @@
 		FAILED=1
 	    fi
 	else
-	    if expected_failure $f; then
+	    if [ $XFAIL = 1 ]; then
 		if [ -z "$VERBOSE" ]; then
 		    echo -n !
 		else




More information about the netfilter-cvslog mailing list