mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 07:15:31 +00:00
test/mem-snap: wait util a zdtm test isn't stopped
before checking results. Reported-by: Mr Jenkins Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
0ac4c13e60
commit
ad80227a37
@@ -27,8 +27,7 @@ function launch_test {
|
|||||||
function stop_test {
|
function stop_test {
|
||||||
wtime=1
|
wtime=1
|
||||||
cd ../zdtm/live/static/
|
cd ../zdtm/live/static/
|
||||||
make maps04.out
|
make maps04.stop
|
||||||
while [ ! -f maps04.out ]; do echo "Wait for maps04.out"; sleep $wtime; ((wtime++)); done
|
|
||||||
cat maps04.out | fgrep PASS || fail "Test failed"
|
cat maps04.out | fgrep PASS || fail "Test failed"
|
||||||
echo "OK"
|
echo "OK"
|
||||||
}
|
}
|
||||||
|
@@ -71,7 +71,7 @@ echo "Restoring"
|
|||||||
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
|
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
|
||||||
|
|
||||||
cd ../zdtm/live/static/
|
cd ../zdtm/live/static/
|
||||||
make mem-touch.out
|
make mem-touch.stop
|
||||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||||
|
|
||||||
echo "Test PASSED"
|
echo "Test PASSED"
|
||||||
|
@@ -83,7 +83,7 @@ echo "Restoring"
|
|||||||
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
|
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
|
||||||
|
|
||||||
cd ../zdtm/live/static/
|
cd ../zdtm/live/static/
|
||||||
make mem-touch.out
|
make mem-touch.stop
|
||||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||||
|
|
||||||
if [[ $dedup_ok_2 -ne 0 || $dedup_ok_1 -ne 0 ]]; then
|
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
|
fi
|
||||||
|
|
||||||
cd ../zdtm/live/static/
|
cd ../zdtm/live/static/
|
||||||
make mem-touch.out
|
make mem-touch.stop
|
||||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||||
|
|
||||||
if [ $restore_dedup_ok -ne 0 ]; then
|
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"
|
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
|
||||||
|
|
||||||
cd ../zdtm/live/static/
|
cd ../zdtm/live/static/
|
||||||
make mem-touch.out
|
make mem-touch.stop
|
||||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||||
|
|
||||||
if [[ $dedup_ok_2 -ne 0 || $dedup_ok_1 -ne 0 ]]; then
|
if [[ $dedup_ok_2 -ne 0 || $dedup_ok_1 -ne 0 ]]; then
|
||||||
|
@@ -55,7 +55,7 @@ fi
|
|||||||
echo "Restoring"
|
echo "Restoring"
|
||||||
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log --auto-dedup -d -v4 || fail "Fail to restore"
|
${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
|
sleep 1
|
||||||
|
|
||||||
cat "../zdtm/live/static/maps04.out" | fgrep PASS || fail "Test failed"
|
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"
|
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v4 || fail "Fail to restore server"
|
||||||
|
|
||||||
cd ../zdtm/live/static/
|
cd ../zdtm/live/static/
|
||||||
make mem-touch.out
|
make mem-touch.stop
|
||||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||||
|
|
||||||
echo "Test PASSED"
|
echo "Test PASSED"
|
||||||
|
@@ -279,6 +279,18 @@ stop: $(STATE_OUT)
|
|||||||
-kill -TERM `cat *.pid`
|
-kill -TERM `cat *.pid`
|
||||||
|
|
||||||
WAIT_TIME=240
|
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:
|
wait_stop:
|
||||||
i=0; \
|
i=0; \
|
||||||
while [ $$i -lt $(WAIT_TIME) ] ; do \
|
while [ $$i -lt $(WAIT_TIME) ] ; do \
|
||||||
|
Reference in New Issue
Block a user