[CRIU] [PATCH 3/3] zdtm: Factor out starting the test via Makefule

Pavel Emelyanov xemul at parallels.com
Tue Jul 1 10:02:07 PDT 2014


Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 test/zdtm.sh | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 9bd0918..cd7ee30 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -368,7 +368,7 @@ start_test()
 
 	if [ -z "$PIDNS" ]; then
 		TPID="$test.pid"
-		make -C $tdir $tname.pid || return 1
+		unset ZDTM_NEWNS
 	else
 		TPID=$(readlink -f $tdir)/$tname.init.pid
 		if [ -z "$ZDTM_ROOT" ]; then
@@ -378,17 +378,19 @@ start_test()
 			mount --bind . $ZDTM_ROOT || return 1
 		fi
 		construct_root $ZDTM_ROOT $tdir/$tname || return 1
-	(	export ZDTM_NEWNS=1
+		export ZDTM_NEWNS=1
 		export ZDTM_PIDFILE=$TPID
 		cd $ZDTM_ROOT
 		rm -f $ZDTM_PIDFILE
-		if ! make -C $tdir $tname.pid; then
-			echo ERROR: fail to start $tdir/$tname
-			return 1
-		fi
-	)
 	fi
 
+	if ! make -C $tdir $tname.pid; then
+		echo ERROR: fail to start $tdir/$tname
+		return 1
+	fi
+
+	[ -z "$ZDTM_ROOT" ] || cd -
+
 	PID=`cat "$TPID"` || return 1
 	if ! ps -p $PID ; then
 		echo "Test failed to start"
-- 
1.8.4.2




More information about the CRIU mailing list