[CRIU] [PATCH 5/5]v5 zdtm: test for auto-dedup on restore

Andrew Vagin avagin at parallels.com
Sat Mar 8 10:34:30 PST 2014


On Fri, Mar 07, 2014 at 11:24:30AM +0400, Tikhomirov Pavel wrote:
> if new size of image is zero than dedup works
> 
> use :
> bash test/zdtm.sh -A static/maps04
> bash test/zdtm.sh -P -i 3 -A -t transition/maps007
> 
> changes: aplicable for all tests, -ad changed to --auto-dedup,
> simplify, check all(and only) private pages files.
> 
> Signed-off-by: Tikhomirov Pavel <snorcht at gmail.com>
> ---
>  test/zdtm.sh | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/test/zdtm.sh b/test/zdtm.sh
> index ac6b974..75f6ef6 100755
> --- a/test/zdtm.sh
> +++ b/test/zdtm.sh
> @@ -460,6 +460,10 @@ EOF
>  		args="$args -L `pwd`/$tdir/lib"
>  	fi
>  
> +	if [ -n "$AUTO_DEDUP" ]; then
> +		args="$args --auto-dedup"
> +	fi
> +
>  	for i in `seq $ITERATIONS`; do
>  		local dump_only=
>  		local postdump=
> @@ -586,6 +590,20 @@ EOF
>  		[ $sltime -lt 9 ] && sltime=$((sltime+1))
>  	done
>  
> +	if [ -n "$AUTO_DEDUP" ]; then
> +		for pagemap in $ddump/pagemap-[0-9]*.img; do

Why can we not check all pages-*.img images? I would like to have a
comment here with explanation.

> +			img_index=$($CRIU show -f $pagemap | grep 'pages_id:' | cut -f 2 -d : -s)
> +			img_index=$((img_index))
> +			echo "Check $img_index image"
> +			size=$(du -sh -BK "$ddump/pages-$img_index.img" | grep -Eo '[0-9]+' | head -1)
> +			echo "Size of pages dump is $size"
> +			if [ "$size" -ne 0 ]; then
> +				echo "Check: $test, Auto-dedup: image size is more than 0"
> +				return 2
> +			fi
> +		done
> +	fi
> +
>  	cat $test.out
>  	cat $test.out | grep -q PASS || return 2
>  	[ "$CLEANUP" -ne 0 ] && rm -rf `dirname $ddump`
> @@ -681,6 +699,7 @@ Options:
>  	-v : Verbose mode
>  	-P : Make pre-dump instead of dump on all iterations except the last one
>  	-s : Make iterative snapshots. Only the last one will be checked.
> +	--auto-dedup : Make auto-dedup on restore. Check sizes of pages imges, it must be zero.
>  EOF
>  }
>  
> @@ -755,6 +774,10 @@ while :; do
>  		SNAPSHOT=1
>  		shift
>  		;;
> +	  --auto-dedup)
> +		AUTO_DEDUP=1
> +		shift
> +		;;
>  	  -g)
>  		COMPILE_ONLY=1
>  		shift
> -- 
> 1.8.3.2
> 


More information about the CRIU mailing list