diff --git a/test/Makefile b/test/Makefile index 1fff10514..4c68c0219 100644 --- a/test/Makefile +++ b/test/Makefile @@ -55,6 +55,7 @@ clean: $(Q) $(MAKE) -C zdtm cleandep clean cleanout $(Q) $(MAKE) -C libcriu clean $(Q) $(MAKE) -C rpc clean + $(Q) $(MAKE) -C crit clean mount_cgroups: .FORCE flock zdtm_mount_cgroups ./zdtm_mount_cgroups diff --git a/test/crit/.gitignore b/test/crit/.gitignore new file mode 100644 index 000000000..9614eb6c4 --- /dev/null +++ b/test/crit/.gitignore @@ -0,0 +1,5 @@ +*.img +*.log +*.txt +stats-* +*.json diff --git a/test/crit/Makefile b/test/crit/Makefile new file mode 100644 index 000000000..484b03223 --- /dev/null +++ b/test/crit/Makefile @@ -0,0 +1,9 @@ +images: + setsid ./loop.sh < /dev/null &> /dev/null & \ + ../../criu dump -v4 -o dump.log -D ./ -t $${!} --shell-job + +run: images + ./test.sh + +clean: + rm -f *.img *.log *.txt stats-* *.json diff --git a/test/crit/loop.sh b/test/crit/loop.sh new file mode 100755 index 000000000..0ab34ce96 --- /dev/null +++ b/test/crit/loop.sh @@ -0,0 +1,4 @@ +#!/bin/bash +while :; do + sleep 1 +done diff --git a/test/crit/test.sh b/test/crit/test.sh new file mode 100755 index 000000000..70fe834df --- /dev/null +++ b/test/crit/test.sh @@ -0,0 +1,26 @@ +images_list=$(ls -1 *.img) + +function _exit { + if [ $? -ne 0 ]; then + echo "FAIL" + exit -1 + fi +} + +for x in $images_list +do + echo "=== $x" + if [[ $x == pages* ]]; then + echo "skip" + continue + fi + + echo " -- to json" + ../../crit convert -o "$x"".json" --format nice < $x || _exit $? + echo " -- to img" + ../../crit convert -i "$x"".json" > "$x"".json.img" || _exit $? + echo " -- cmp" + cmp $x "$x"".json.img" || _exit $? + + echo "=== done" +done