[CRIU] [PATCH cr] zdtm: add ability to make several iterations
of dump/restore
Andrew Vagin
avagin at parallels.com
Fri Sep 28 08:35:06 EDT 2012
ping
On Mon, Sep 17, 2012 at 11:58:48AM +0400, Andrey Vagin wrote:
>
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
> test/zdtm.sh | 32 +++++++++++++++++++++++++-------
> 1 files changed, 25 insertions(+), 7 deletions(-)
>
> diff --git a/test/zdtm.sh b/test/zdtm.sh
> index 51e363d..2477794 100644
> --- a/test/zdtm.sh
> +++ b/test/zdtm.sh
> @@ -100,6 +100,8 @@ ARGS=""
> PID=""
> PIDNS=""
>
> +ITERATIONS=1
> +
> umount_zdtm_root()
> {
> [ -z "$ZDTM_ROOT" ] && return;
> @@ -212,9 +214,6 @@ run_test()
> return 1
> }
>
> - ddump=dump/$tname/$PID
> - DUMP_PATH=`pwd`/$ddump
> -
> if [ -n "$PIDNS" ]; then
> [ -z "$CR_IP_TOOL" ] && CR_IP_TOOL=ip
> $CR_IP_TOOL a help 2>&1 | grep -q showdump || {
> @@ -228,8 +227,13 @@ EOF
> args="-n uts -n ipc -n net -n pid -n mnt --root $ZDTM_ROOT --pidfile $TPID $args"
> fi
>
> + for i in `seq $ITERATIONS`; do
> +
> + ddump=dump/$tname/$PID/$i
> + DUMP_PATH=`pwd`/$ddump
> echo Dump $PID
> mkdir -p $ddump
> +
> save_fds $PID $ddump/dump.fd
> setsid $CRTOOLS dump --tcp-established -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
> @@ -263,8 +267,11 @@ EOF
> sleep 0.2
> done
> [ $i -eq 5 ] && return 2;
> + [ -n "$PIDNS" ] && PID=`cat $TPID`
> fi
>
> + done
> +
> echo Check results $PID
> stop_test $tdir $tname
> sltime=1
> @@ -303,10 +310,20 @@ case_error()
>
> cd `dirname $0` || exit 1
>
> -if [ "$1" = "-d" ]; then
> - ARGS="-s"
> - shift
> -fi
> +while :; do
> + if [ "$1" = "-d" ]; then
> + ARGS="-s"
> + shift
> + continue
> + fi
> + if [ "$1" = "-i" ]; then
> + shift
> + ITERATIONS=$1
> + shift
> + continue
> + fi
> + break;
> +done
>
> if [ $# -eq 0 ]; then
> for t in $TEST_LIST; do
> @@ -332,6 +349,7 @@ zdtm.sh [OPTIONS] [TEST NAME]
> Options:
> -l : Show list of tests.
> -d : Dump a test process and check that this process can continue working.
> + -i : Number of ITERATIONS of dump/restore
> EOF
> else
> if echo $UTS_TEST_LIST | fgrep -qw $1; then
> --
> 1.7.1
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://openvz.org/mailman/listinfo/criu
More information about the CRIU
mailing list