[PATCH] zdtm: repair skip()

Andrey Vagin avagin at openvz.org
Mon Jun 23 23:39:22 PDT 2014


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm.sh         | 10 +++++++++-
 test/zdtm/lib/test.c |  3 ++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 0e36f7d..90d7706 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -370,7 +370,11 @@ start_test()
 			return 1
 		fi
 	)
-
+		if [ ! -f $TPID ]; then
+			PID=""
+			cat $tdir/$tname.out | grep SKIP && return 0;
+			return 1;
+		fi
 		PID=`cat "$TPID"`
 		ps -p $PID || return 1
 	fi
@@ -455,6 +459,10 @@ run_test()
 
 	start_test $tdir $tname || return 1
 
+	if [ -z "$PID" ]; then
+		continue
+	fi
+
 	if [ $START_ONLY -eq 1 ]; then
 		echo "Test is started"
 		return 0
diff --git a/test/zdtm/lib/test.c b/test/zdtm/lib/test.c
index 5d2a05d..51eb0c7 100644
--- a/test/zdtm/lib/test.c
+++ b/test/zdtm/lib/test.c
@@ -173,7 +173,8 @@ void test_init(int argc, char **argv)
 			waitpid(pid, &ret, 0);
 
 			if (WIFEXITED(ret)) {
-				err("Test exited with unexpectedly with code %d\n", WEXITSTATUS(ret));
+				if (WEXITSTATUS(ret))
+					err("Test exited with unexpectedly with code %d\n", WEXITSTATUS(ret));
 				exit(0);
 			}
 			if (WIFSIGNALED(ret)) {
-- 
1.8.5.3


--oyUTqETQ0mS9luUI--


More information about the CRIU mailing list