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

zdtm: add ability to make several iterations of dump/restore

Use the -i <num> option to zdtm.sh
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 595e2c76
...@@ -101,6 +101,8 @@ ARGS="" ...@@ -101,6 +101,8 @@ ARGS=""
PID="" PID=""
PIDNS="" PIDNS=""
ITERATIONS=1
umount_zdtm_root() umount_zdtm_root()
{ {
[ -z "$ZDTM_ROOT" ] && return; [ -z "$ZDTM_ROOT" ] && return;
...@@ -213,9 +215,6 @@ run_test() ...@@ -213,9 +215,6 @@ run_test()
return 1 return 1
} }
ddump=dump/$tname/$PID
DUMP_PATH=`pwd`/$ddump
if [ -n "$PIDNS" ]; then if [ -n "$PIDNS" ]; then
[ -z "$CR_IP_TOOL" ] && CR_IP_TOOL=ip [ -z "$CR_IP_TOOL" ] && CR_IP_TOOL=ip
$CR_IP_TOOL a help 2>&1 | grep -q showdump || { $CR_IP_TOOL a help 2>&1 | grep -q showdump || {
...@@ -229,8 +228,13 @@ EOF ...@@ -229,8 +228,13 @@ EOF
args="-n uts -n ipc -n net -n pid -n mnt --root $ZDTM_ROOT --pidfile $TPID $args" args="-n uts -n ipc -n net -n pid -n mnt --root $ZDTM_ROOT --pidfile $TPID $args"
fi fi
for i in `seq $ITERATIONS`; do
ddump=dump/$tname/$PID/$i
DUMP_PATH=`pwd`/$ddump
echo Dump $PID echo Dump $PID
mkdir -p $ddump mkdir -p $ddump
save_fds $PID $ddump/dump.fd save_fds $PID $ddump/dump.fd
setsid $CRTOOLS dump --tcp-established --link-remap -x --evasive-devices -D $ddump -o dump.log -v 4 -t $PID $args $ARGS || { setsid $CRTOOLS dump --tcp-established --link-remap -x --evasive-devices -D $ddump -o dump.log -v 4 -t $PID $args $ARGS || {
echo WARNING: process $tname is left running for your debugging needs echo WARNING: process $tname is left running for your debugging needs
...@@ -264,8 +268,11 @@ EOF ...@@ -264,8 +268,11 @@ EOF
sleep 0.2 sleep 0.2
done done
[ $i -eq 5 ] && return 2; [ $i -eq 5 ] && return 2;
[ -n "$PIDNS" ] && PID=`cat $TPID`
fi fi
done
echo Check results $PID echo Check results $PID
stop_test $tdir $tname stop_test $tdir $tname
sltime=1 sltime=1
...@@ -304,10 +311,20 @@ case_error() ...@@ -304,10 +311,20 @@ case_error()
cd `dirname $0` || exit 1 cd `dirname $0` || exit 1
if [ "$1" = "-d" ]; then while :; do
ARGS="-s" if [ "$1" = "-d" ]; then
shift ARGS="-s"
fi shift
continue
fi
if [ "$1" = "-i" ]; then
shift
ITERATIONS=$1
shift
continue
fi
break;
done
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
for t in $TEST_LIST; do for t in $TEST_LIST; do
...@@ -333,6 +350,7 @@ zdtm.sh [OPTIONS] [TEST NAME] ...@@ -333,6 +350,7 @@ zdtm.sh [OPTIONS] [TEST NAME]
Options: Options:
-l : Show list of tests. -l : Show list of tests.
-d : Dump a test process and check that this process can continue working. -d : Dump a test process and check that this process can continue working.
-i : Number of ITERATIONS of dump/restore
EOF EOF
else else
if echo $UTS_TEST_LIST | fgrep -qw $1; then if echo $UTS_TEST_LIST | fgrep -qw $1; then
......
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