Commit 3c6180ac authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

Use criu instead of crtools in test scripts

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f7b9f0a2
......@@ -2,7 +2,7 @@
source ../../../functions.sh || exit 1
crtools="../../../../crtools"
criu="../../../../criu"
cleanup_class() {
rm -f ./*.class
......@@ -21,7 +21,7 @@ pid=${!}
echo Lanuched java application with pid $pid in background
${crtools} dump -D dump -o dump.log -v 4 --shell-job -t ${pid} || {
${criu} dump -D dump -o dump.log -v 4 --shell-job -t ${pid} || {
echo "Dump failed"
exit 1
}
......@@ -30,7 +30,7 @@ wait_tasks dump
echo "Dumped, restoring and waiting for completion"
${crtools} restore -D dump -o restore.log -v 4 --shell-job || {
${criu} restore -D dump -o restore.log -v 4 --shell-job || {
echo "Restore failed"
exit 1
}
......
......@@ -21,7 +21,7 @@ switch $current {
puts "FAIL: Timed out on ready"
exit -1
}
system ../../../crtools dump -v 4 -D ./dump -o dump.log -j -t $pid
system ../../../criu dump -v 4 -D ./dump -o dump.log -j -t $pid
system echo "$pid" > ./dump/pid.pid
exit 0
}
......@@ -37,7 +37,7 @@ switch $current {
exit -1
}
spawn ../../../crtools restore -v 4 -D ./dump -o restore.log -j
spawn ../../../criu restore -v 4 -D ./dump -o restore.log -j
#
# spawn doesn't wait for restore to complete, so
# add some sleep here. Still better would be to
......
......@@ -4,7 +4,7 @@
cd `dirname $0`
crtools="../../../crtools"
criu="../../../criu"
name=$1
[ -z "$name" ] && { cat <<EOF
......@@ -34,7 +34,7 @@ $CR_IP_TOOL netns exec $name ip a || exit 1
mkdir data
echo "Dump the CT $name ($pid)"
${crtools} dump --evasive-devices \
${criu} dump --evasive-devices \
--tcp-established \
--file-locks \
-n net -n mnt -n ipc -n pid \
......@@ -46,7 +46,7 @@ echo Press Enter for restoring CT
read
echo "Restore the CT $name"
${crtools} restore --evasive-devices \
${criu} restore --evasive-devices \
--tcp-established \
--file-locks \
-n net -n mnt -n ipc -n pid \
......
......@@ -2,7 +2,7 @@
source ../../functions.sh || exit 1
crtools="../../../crtools"
criu="../../../criu"
cleanup_wd() {
rm -f "ref-*"
......@@ -32,7 +32,7 @@ pid=${!}
echo Lanuched make in $pid background
sleep 2
${crtools} dump --shell-job -D dump -o dump.log -v 4 -t ${pid} || {
${criu} dump --shell-job -D dump -o dump.log -v 4 -t ${pid} || {
echo "Dump failed"
exit 1
}
......@@ -41,7 +41,7 @@ wait_tasks dump
echo "Dumped, restoring and waiting for completion"
${crtools} restore --shell-job -D dump -o restore.log -v 4 || {
${criu} restore --shell-job -D dump -o restore.log -v 4 || {
echo "Restore failed"
exit 1
}
......
......@@ -2,19 +2,19 @@
source ../../functions.sh || exit 1
crtools="../../../crtools"
criu="../../../criu"
set -x
echo "Creating reference objects"
screen -d -m -S crtools-zdtm
pid=$(screen -list | grep '\<crtools-zdtm\>.*Detached' | sed 's/\s*\([0-9]*\).*/\1/');
screen -d -m -S criu-zdtm
pid=$(screen -list | grep '\<criu-zdtm\>.*Detached' | sed 's/\s*\([0-9]*\).*/\1/');
echo PID=$pid
mkdir dump
${crtools} dump -D dump -o dump.log -v 4 -t ${pid} || {
${criu} dump -D dump -o dump.log -v 4 -t ${pid} || {
echo "Dump failed"
exit 1
}
......@@ -23,7 +23,7 @@ wait_tasks dump
echo "Dumped, restoring and waiting for completion"
${crtools} restore -d -D dump -o restore.log -v 4 || {
${criu} restore -d -D dump -o restore.log -v 4 || {
echo "Restore failed"
exit 1
}
......
......@@ -2,7 +2,7 @@
source ../../functions.sh || exit 1
crtools="../../../crtools"
criu="../../../criu"
DEPTH=3
SPAN=5
archref="arch-ref.tar.bz2"
......@@ -47,7 +47,7 @@ pid=${!}
echo "Started tar in $pid background"
sleep 3
${crtools} dump --shell-job -D dump -o dump.log -v 4 -t ${pid} || {
${criu} dump --shell-job -D dump -o dump.log -v 4 -t ${pid} || {
echo "Dump failed"
exit 1
}
......@@ -55,7 +55,7 @@ ${crtools} dump --shell-job -D dump -o dump.log -v 4 -t ${pid} || {
wait_tasks dump
echo "Dump OK, restoring"
${crtools} restore --shell-job -D dump -o restore.log -v 4 || {
${criu} restore --shell-job -D dump -o restore.log -v 4 || {
echo "Restore failed"
exit 1
}
......
......@@ -2,7 +2,7 @@ set -m
source ../../functions.sh || exit 1
crtools="../../../crtools"
criu="../../../criu"
mkdir data
......@@ -10,14 +10,14 @@ mkdir data
pid=`jobs -p %1`
bg
$crtools dump -j --tcp-established -D data/ -o dump.log -v 4 -t $pid || {
$criu dump -j --tcp-established -D data/ -o dump.log -v 4 -t $pid || {
echo "Dump failed"
exit 1
}
wait_tasks dump
$crtools restore -j --tcp-established -D data/ -d -o restore.log -v 4 || {
$criu restore -j --tcp-established -D data/ -d -o restore.log -v 4 || {
echo "Restore failed"
exit 1
}
......
......@@ -6,7 +6,7 @@ function fail {
}
set -x
CRTOOLS="../../crtools"
CRIU="../../criu"
IMGDIR="dump/"
rm -rf "$IMGDIR"
......@@ -37,11 +37,11 @@ launch_test
echo "Taking plain dump"
mkdir "$IMGDIR/dump-1/"
${CRTOOLS} dump -D "$IMGDIR/dump-1/" -o dump.log -t ${PID} -v 4 || fail "Fail to dump"
${CRIU} dump -D "$IMGDIR/dump-1/" -o dump.log -t ${PID} -v 4 || fail "Fail to dump"
sleep 1
echo "Restore to check it works"
${CRTOOLS} restore -D "${IMGDIR}/dump-1/" -o restore.log -d -v 4 || fail "Fail to restore server"
${CRIU} restore -D "${IMGDIR}/dump-1/" -o restore.log -d -v 4 || fail "Fail to restore server"
stop_test
......@@ -53,14 +53,14 @@ echo "Taking pre and plain dumps"
echo "Pre-dump"
mkdir "$IMGDIR/dump-2/"
mkdir "$IMGDIR/dump-2/pre/"
${CRTOOLS} pre-dump -D "$IMGDIR/dump-2/pre/" -o dump.log -t ${PID} -v 4 || fail "Fail to pre-dump"
${CRIU} pre-dump -D "$IMGDIR/dump-2/pre/" -o dump.log -t ${PID} -v 4 || fail "Fail to pre-dump"
echo "Plain dump"
mkdir "$IMGDIR/dump-2/plain/"
${CRTOOLS} dump -D "$IMGDIR/dump-2/plain/" -o dump.log -t ${PID} -v 4 --prev-images-dir=../pre/ || fail "Fail to dump"
${CRIU} dump -D "$IMGDIR/dump-2/plain/" -o dump.log -t ${PID} -v 4 --prev-images-dir=../pre/ || fail "Fail to dump"
sleep 1
echo "Restore"
${CRTOOLS} restore -D "${IMGDIR}/dump-2/plain/" -o restore.log -d -v 4 || fail "Fail to restore server"
${CRIU} restore -D "${IMGDIR}/dump-2/plain/" -o restore.log -d -v 4 || fail "Fail to restore server"
stop_test
......@@ -18,7 +18,7 @@ function fail {
}
set -x
CRTOOLS="../../crtools"
CRIU="../../criu"
IMGDIR="dump/"
rm -rf "$IMGDIR"
......@@ -53,21 +53,21 @@ for SNAP in $(seq 1 $NRSNAP); do
fi
if [ $USEPS -eq 1 ]; then
${CRTOOLS} page-server -D "${IMGDIR}/$SNAP/" -o ps.log --port ${PORT} -v 4 &
${CRIU} page-server -D "${IMGDIR}/$SNAP/" -o ps.log --port ${PORT} -v 4 &
PS_PID=$!
ps_args="--page-server --address 127.0.0.1 --port=${PORT}"
else
ps_args=""
fi
${CRTOOLS} $cmd -D "${IMGDIR}/$SNAP/" -o dump.log -t ${PID} -v 4 $args $ps_args || fail "Fail to dump"
${CRIU} $cmd -D "${IMGDIR}/$SNAP/" -o dump.log -t ${PID} -v 4 $args $ps_args || fail "Fail to dump"
if [ $USEPS -eq 1 ]; then
wait $PS_PID
fi
done
echo "Restoring"
${CRTOOLS} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v 4 || fail "Fail to restore server"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v 4 || fail "Fail to restore server"
cd ../zdtm/live/static/
make mem-touch.out
......
......@@ -18,7 +18,7 @@ function fail {
}
set -x
CRTOOLS="../../crtools"
CRIU="../../criu"
IMGDIR="dump/"
rm -rf "$IMGDIR"
......@@ -50,21 +50,21 @@ for SNAP in $(seq 1 $NRSNAP); do
fi
if [ $USEPS -eq 1 ]; then
${CRTOOLS} page-server -D "${IMGDIR}/$SNAP/" -o ps.log --port ${PORT} -v 4 &
${CRIU} page-server -D "${IMGDIR}/$SNAP/" -o ps.log --port ${PORT} -v 4 &
PS_PID=$!
ps_args="--page-server --address 127.0.0.1 --port=${PORT}"
else
ps_args=""
fi
${CRTOOLS} dump -D "${IMGDIR}/$SNAP/" -o dump.log -t ${PID} -v 4 $args $ps_args || fail "Fail to dump"
${CRIU} dump -D "${IMGDIR}/$SNAP/" -o dump.log -t ${PID} -v 4 $args $ps_args || fail "Fail to dump"
if [ $USEPS -eq 1 ]; then
wait $PS_PID
fi
done
echo "Restoring"
${CRTOOLS} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v 4 || fail "Fail to restore server"
${CRIU} restore -D "${IMGDIR}/$NRSNAP/" -o restore.log -d -v 4 || fail "Fail to restore server"
cd ../zdtm/live/static/
make mem-touch.out
......
......@@ -7,7 +7,7 @@ CLN_PIPE="./clnt_pipe"
SRV_LOG="./srv.log"
CLN_LOG="./cln.log"
DDIR="dump"
CRTOOLS="../../crtools"
CRIU="../../criu"
TEXT=$(hexdump -C /dev/urandom | head -n 1)
......@@ -41,10 +41,10 @@ function fail {
}
echo "Suspend server"
${CRTOOLS} dump -D ${DDIR} -o dump.log -t ${SRV_PID} --tcp-established -vvvv || fail "Fail to dump server"
${CRIU} dump -D ${DDIR} -o dump.log -t ${SRV_PID} --tcp-established -vvvv || fail "Fail to dump server"
sleep 1
echo "Resume server"
${CRTOOLS} restore -D ${DDIR} -o restore.log -d --tcp-established -vvvv --close 3 || fail "Fail to restore server"
${CRIU} restore -D ${DDIR} -o restore.log -d --tcp-established -vvvv --close 3 || fail "Fail to restore server"
echo "Make client run again"
echo "${TEXT}" >&3
......
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