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

zdtm.sh: check snapshot functionality

Only last iteration stops processes, all other iterations make
snapshots. Processes are restored from the last snapshot.

bash -x test/zdtm.sh -s -i 3
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 13a809a9
...@@ -302,6 +302,8 @@ run_test() ...@@ -302,6 +302,8 @@ run_test()
{ {
local test=$1 local test=$1
local linkremap= local linkremap=
local snapopt=
local snappdir=
[ -n "$EXCLUDE_PATTERN" ] && echo $test | grep "$EXCLUDE_PATTERN" && return 0 [ -n "$EXCLUDE_PATTERN" ] && echo $test | grep "$EXCLUDE_PATTERN" && return 0
...@@ -361,14 +363,24 @@ EOF ...@@ -361,14 +363,24 @@ EOF
opts="--page-server --address 127.0.0.1 --port $PS_PORT" opts="--page-server --address 127.0.0.1 --port $PS_PORT"
fi fi
if [ -n "$SNAPSHOT" ]; then
snapopt=""
[ "$i" -ne "$ITERATIONS" ] && snapopt="$snapopt -R --track-mem"
[ -n "$snappdir" ] && snapopt="$snapopt --prev-images-dir=$snappdir"
fi
save_fds $PID $ddump/dump.fd save_fds $PID $ddump/dump.fd
setsid $CRIU_CPT dump $opts --file-locks --tcp-established $linkremap \ setsid $CRIU_CPT dump $opts --file-locks --tcp-established $linkremap \
-x --evasive-devices -D $ddump -o dump.log -v4 -t $PID $args $ARGS || { -x --evasive-devices -D $ddump -o dump.log -v4 -t $PID $args $ARGS $snapopt || {
echo WARNING: process $tname is left running for your debugging needs echo WARNING: process $tname is left running for your debugging needs
return 1 return 1
} }
if [ -n "$SNAPSHOT" ]; then
snappdir=../`basename $ddump`
[ "$i" -ne "$ITERATIONS" ] && continue
fi
if [ $PAGE_SERVER -eq 1 ]; then if [ $PAGE_SERVER -eq 1 ]; then
wait $PS_PID wait $PS_PID
fi fi
...@@ -518,6 +530,11 @@ while :; do ...@@ -518,6 +530,11 @@ while :; do
shift shift
continue; continue;
fi fi
if [ "$1" = "-s" ]; then
SNAPSHOT=1
shift
continue
fi
break; break;
done done
......
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