mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-04 08:15:37 +00:00
test: recoursive autodedup
verify decline in size of second parent-level image file Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
a23765435b
commit
04b6403532
@@ -44,7 +44,8 @@ for SNAP in $(seq 1 $NRSNAP); do
|
|||||||
args="--track-mem -R"
|
args="--track-mem -R"
|
||||||
elif [ $SNAP -eq $NRSNAP ]; then
|
elif [ $SNAP -eq $NRSNAP ]; then
|
||||||
# Last snapshot -- has parent, kill afterwards
|
# Last snapshot -- has parent, kill afterwards
|
||||||
size_first=$(du -sh -BK dump/2/pages-*.img | grep -Eo '[0-9]+' | head -1)
|
size_first_2=$(du -sh -BK dump/2/pages-*.img | grep -Eo '[0-9]+' | head -1)
|
||||||
|
size_first_1=$(du -sh -BK dump/1/pages-*.img | grep -Eo '[0-9]+' | head -1)
|
||||||
args="--prev-images-dir=../$((SNAP - 1))/ --track-mem --auto-dedup"
|
args="--prev-images-dir=../$((SNAP - 1))/ --track-mem --auto-dedup"
|
||||||
else
|
else
|
||||||
# Other snapshots -- have parent, keep running
|
# Other snapshots -- have parent, keep running
|
||||||
@@ -65,11 +66,17 @@ for SNAP in $(seq 1 $NRSNAP); do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
size_last=$(du -sh -BK dump/2/pages-*.img | grep -Eo '[0-9]+' | head -1)
|
size_last_2=$(du -sh -BK dump/2/pages-*.img | grep -Eo '[0-9]+' | head -1)
|
||||||
|
size_last_1=$(du -sh -BK dump/1/pages-*.img | grep -Eo '[0-9]+' | head -1)
|
||||||
|
|
||||||
dedup_ok=1
|
dedup_ok_2=1
|
||||||
if [ $size_first -gt $size_last ]; then
|
if [ $size_first_2 -gt $size_last_2 ]; then
|
||||||
dedup_ok=0
|
dedup_ok_2=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
dedup_ok_1=1
|
||||||
|
if [ $size_first_1 -gt $size_last_1 ]; then
|
||||||
|
dedup_ok_1=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Restoring"
|
echo "Restoring"
|
||||||
@@ -79,7 +86,7 @@ cd ../zdtm/live/static/
|
|||||||
make mem-touch.out
|
make mem-touch.out
|
||||||
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
cat mem-touch.out | fgrep PASS || fail "Test failed"
|
||||||
|
|
||||||
if [ $dedup_ok -ne 0 ]; then
|
if [[ $dedup_ok_2 -ne 0 || $dedup_ok_1 -ne 0 ]]; then
|
||||||
fail "Dedup test failed"
|
fail "Dedup test failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user