[CRIU] [PATCH] test/secure: don't use the shell_job option

Andrew Vagin avagin at openvz.org
Thu May 14 04:34:01 PDT 2015


It's required to execute the test in Jenkins.

Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 test/security/loop.sh | 7 ++++---
 test/security/run.sh  | 9 ++++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/test/security/loop.sh b/test/security/loop.sh
index b8ebc6f..0a01053 100755
--- a/test/security/loop.sh
+++ b/test/security/loop.sh
@@ -1,10 +1,11 @@
 #!/bin/bash
 
-echo $$
+echo $$ > $1.int
+mv $1.int $1
 
-if [ "$1" == "--chgrp" ]; then
+if [ "$2" == "--chgrp" ]; then
 	grps=( $(groups) )
-	newgrp ${grps[1]}
+	newgrp ${grps[2]}
 fi
 
 while :; do
diff --git a/test/security/run.sh b/test/security/run.sh
index a159918..5b55996 100755
--- a/test/security/run.sh
+++ b/test/security/run.sh
@@ -6,20 +6,23 @@ function run_as {
 	echo "== Run ${LOOP} as $1"
 	echo ${PIDFILE}
 	rm -f ${PIDFILE}
-	su $1 -c "${LOOP} $2 < /dev/null 2> /dev/null > ${PIDFILE} &"
+	su $1 -c "setsid ${LOOP} ${PIDFILE} $2 < /dev/null &> /dev/null &"
+	for i in `seq 100`; do
+		test -f ${PIDFILE} && break
+	done
 	PID=`cat ${PIDFILE}`
 	echo ${PID}
 }
 
 function dump_as {
 	echo "== Dump ${PID} as $@"
-	su $@ -c "${CRIU} dump --tree ${PID} --images-dir ${IMGS} --shell-job"
+	su $@ -c "${CRIU} dump --tree ${PID} --images-dir ${IMGS}"
 	return $?
 }
 
 function rstr_as {
 	echo "== Restore ${IMGS} as $@"
-	su $@ -c "${CRIU} restore --images-dir ${IMGS} --shell-job --restore-detached"
+	su $@ -c "${CRIU} restore --images-dir ${IMGS} --restore-detached"
 	return $?
 }
 
-- 
2.1.0



More information about the CRIU mailing list