Commit ad80227a authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

test/mem-snap: wait util a zdtm test isn't stopped

before checking results.

Reported-by: Mr Jenkins
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 0ac4c13e
......@@ -27,8 +27,7 @@ function launch_test {
function stop_test {
wtime=1
cd ../zdtm/live/static/
make maps04.out
while [ ! -f maps04.out ]; do echo "Wait for maps04.out"; sleep $wtime; ((wtime++)); done
make maps04.stop
cat maps04.out | fgrep PASS || fail "Test failed"
echo "OK"
}
......
......@@ -71,7 +71,7 @@ echo "Restoring"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
cd ../zdtm/live/static/
make mem-touch.out
make mem-touch.stop
cat mem-touch.out | fgrep PASS || fail "Test failed"
echo "Test PASSED"
......@@ -83,7 +83,7 @@ echo "Restoring"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
cd ../zdtm/live/static/
make mem-touch.out
make mem-touch.stop
cat mem-touch.out | fgrep PASS || fail "Test failed"
if [[ $dedup_ok_2 -ne 0 || $dedup_ok_1 -ne 0 ]]; then
......
......@@ -77,7 +77,7 @@ if [[ $size_last1 -ne 0 || $size_last2 -ne 0 || $size_last3 -ne 0 ]]; then
fi
cd ../zdtm/live/static/
make mem-touch.out
make mem-touch.stop
cat mem-touch.out | fgrep PASS || fail "Test failed"
if [ $restore_dedup_ok -ne 0 ]; then
......
......@@ -89,7 +89,7 @@ echo "Restoring"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
cd ../zdtm/live/static/
make mem-touch.out
make mem-touch.stop
cat mem-touch.out | fgrep PASS || fail "Test failed"
if [[ $dedup_ok_2 -ne 0 || $dedup_ok_1 -ne 0 ]]; then
......
......@@ -55,7 +55,7 @@ fi
echo "Restoring"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log --auto-dedup -d -v4 || fail "Fail to restore"
make -C ../zdtm/live/static/ maps04.out
make -C ../zdtm/live/static/ maps04.stop
sleep 1
cat "../zdtm/live/static/maps04.out" | fgrep PASS || fail "Test failed"
......
......@@ -68,7 +68,7 @@ echo "Restoring"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
cd ../zdtm/live/static/
make mem-touch.out
make mem-touch.stop
cat mem-touch.out | fgrep PASS || fail "Test failed"
echo "Test PASSED"
......@@ -279,6 +279,18 @@ stop: $(STATE_OUT)
-kill -TERM `cat *.pid`
WAIT_TIME=240
%.stop: %.pid %
kill -TERM `cat $<`; \
i=0; \
while [ $$i -lt $(WAIT_TIME) ] ; do \
kill -0 `cat $< 2>/dev/null` 2>/dev/null || break; \
sleep 1; \
echo -n .; \
i=`expr $$i + 1`; \
done; \
echo; \
[ $$i -lt $(WAIT_TIME) ]
wait_stop:
i=0; \
while [ $$i -lt $(WAIT_TIME) ] ; do \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment