[CRIU] [PATCH 3/6] test: Tune libcriu tests launcher
Pavel Emelyanov
xemul at parallels.com
Wed Jun 25 04:24:20 PDT 2014
* Exit on compilation errors
* More verbosity
* Start _self test as well
* Report overall result
Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
test/libcriu/run_sub.sh | 31 ++++++++++++++++++++++++-------
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/test/libcriu/run_sub.sh b/test/libcriu/run_sub.sh
index 9e14a49..d96a2c6 100644
--- a/test/libcriu/run_sub.sh
+++ b/test/libcriu/run_sub.sh
@@ -2,26 +2,43 @@
source ../env.sh || exit 1
-LOOP_PID=0
-
echo "== Clean"
make clean
rm -rf wdir
rm -f ./libcriu.so.1
echo "== Prepare"
-make test_sub || { echo "FAIL"; exit 1; }
+make test_sub || { echo "FAIL build sub"; exit 1; }
+make test_self || { echo "FAIL build self"; exit 1; }
mkdir -p wdir/s/
-mkdir -p wdir/i/
echo "== Start service"
-${CRIU} service -v4 -o service.log --address cs.sk -d --pidfile pidfile -W wdir/s/ || { echo "FAIL"; exit 1; }
+${CRIU} service -v4 -o service.log --address cs.sk -d --pidfile pidfile -W wdir/s/ || { echo "FAIL service start"; exit 1; }
-echo "== Run test_sub"
+echo "== Run tests"
ln -s ../../lib/libcriu.so libcriu.so.1
export LD_LIBRARY_PATH=.
export PATH="`dirname ${BASH_SOURCE[0]}`/../../:$PATH"
-./test_sub wdir/s/cs.sk wdir/i/
+
+RESULT=0
+
+# C/R of child process
+echo "== Test SUB"
+mkdir -p wdir/i/sub/
+if ! ./test_sub wdir/s/cs.sk wdir/i/sub/; then
+ echo "test_sub: FAIL"
+ RESULT=1
+fi
+
+# C/R of self
+echo "== Test SELF"
+mkdir -p wdir/i/self/
+if ! ./test_self wdir/s/cs.sk wdir/i/self/; then
+ echo "test_self: FAIL"
+ RESULT=1
+fi
echo "== Stopping service"
kill -TERM $(cat wdir/s/pidfile)
+[ $RESULT ] && echo "Success" || echo "FAIL"
+exit $RESULT
--
1.8.4.2
More information about the CRIU
mailing list