[CRIU] [PATCH 5/5]v5 zdtm: test for auto-dedup on restore
Pavel Tikhomirov
snorcht at gmail.com
Fri Mar 7 01:56:27 PST 2014
This small patch passes auto-dedup option also to page-server
Signed-off-by: Tikhomirov Pavel <snorcht at gmail.com>
diff --git a/test/zdtm.sh b/test/zdtm.sh
index d9b351d..2403ada 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -462,6 +462,7 @@ EOF
if [ -n "$AUTO_DEDUP" ]; then
args="$args --auto-dedup"
+ ps_args="--auto-dedup"
fi
for i in `seq $ITERATIONS`; do
@@ -476,7 +477,7 @@ EOF
[ -n "$DUMP_ONLY" ] && dump_only=1
if [ $PAGE_SERVER -eq 1 ]; then
- $CRIU page-server -D $ddump -o page_server.log -v4
--port
+ $CRIU page-server -D $ddump -o page_server.log -v4
--port
ps_pid=`lsof -s TCP:LISTEN -i :$PS_PORT -t`
ps -p "$ps_pid" -o cmd h | grep -q page-server || {
echo "Unable to determing PID of
page-server"
Best Regards, Tikhomirov Pavel.
2014-03-07 11:24 GMT+04:00 Tikhomirov Pavel <snorcht at gmail.com>:
> 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
> + 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140307/8149b372/attachment.html>
More information about the CRIU
mailing list