[CRIU] [PATCH 6/6] RFC: zdtm: Last bits of Busybox makeover

Christopher Covington cov at codeaurora.org
Wed Aug 6 15:02:14 PDT 2014


These are the additional changes I'm using to run the ZDTM test
suite in Busybox based root filesystems. I plan to break them into
smaller pieces and potentially rework them, but I'm including them
here in case anyone want to reproduce the setup.

Signed-off-by: Christopher Covington <cov at codeaurora.org>
---
 test/env.sh  |  2 +-
 test/zdtm.sh | 15 +++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/test/env.sh b/test/env.sh
index ab015e0..d9e243c 100755
--- a/test/env.sh
+++ b/test/env.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../criu)
+CRIU=$(readlink -f `dirname $0`/../criu)
 criu=$CRIU
diff --git a/test/zdtm.sh b/test/zdtm.sh
index 30ea3ec..5029671 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -142,8 +142,10 @@ fi
 
 TEST_LIST=$TEST_LIST$TEST_LIST_ARCH
 
+if [ $ARCH = "x86_64" ]; then
 # Duplicate list with ns/ prefix
 TEST_LIST=$TEST_LIST$(echo $TEST_LIST | tr ' ' '\n' | sed 's#^#ns/#')
+fi
 
 # These ones are not in ns
 TEST_LIST="$TEST_LIST
@@ -364,6 +366,11 @@ start_test()
 	local test=$(readlink -f $tdir)/$tname
 	export ZDTM_ROOT
 
+	if ! [ -x $(readlink -f $test) ]; then
+		echo ERROR: $tdir/$tname does not exist or is not executable
+		return 1
+	fi
+
 	killall -9 $tname > /dev/null 2>&1
 	rm -fr	$test.pid	\
 		$test.out*	\
@@ -436,7 +443,7 @@ save_fds()
 
 save_maps()
 {
-	cat /proc/$1/maps | python maps.py > $2
+	cat /proc/$1/maps > $2
 }
 
 diff_maps()
@@ -532,7 +539,7 @@ EOF
 		local cpt_args=
 		local dump_only=
 		local dump_cmd="dump"
-		ddump=`readlink -f dump/$tname/$PID/$i`
+		ddump=dump/$tname/$PID/$i
 		DUMP_PATH=$ddump
 		echo Dump $PID
 		mkdir -p $ddump
@@ -624,7 +631,7 @@ EOF
 			for i in `seq 5`; do
 				save_fds $PID  $ddump/restore.fd
 				diff_fds $ddump/dump.fd $ddump/restore.fd && break
-				sleep 0.2
+				sleep 2
 			done
 			[ $i -eq 5 ] && return 2
 
@@ -902,7 +909,7 @@ else
 		pattern=$1
 	fi
 
-	for t in $(echo "$TEST_LIST" | grep -x "$pattern"); do
+	for t in $(echo "$TEST_LIST" | grep "^$pattern$"); do
 		run_test $t || case_error $t
 	done
 
-- 
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by the Linux Foundation.



More information about the CRIU mailing list