diff options
author | Ruslan Kuprieiev <kupruser@gmail.com> | 2016-05-21 16:38:30 +0300 |
---|---|---|
committer | Pavel Emelyanov <xemul@virtuozzo.com> | 2016-06-28 13:04:00 +0300 |
commit | e569e46b312071c5d8d1a36bfef9be28c444efda (patch) | |
tree | 432c018eebe22e3eec4aa0fc627764382ed6493a /test/others/crit | |
parent | 8a71a4a27d26714900f48670637a67ba08c59d19 (diff) |
test: fix manual crit test
In automated tests we use test/crit-recode.py because of performance
benefits(no need to launch python interpreter more than once), but
manual test is still useful for manual testing, so lets make it
work again.
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Diffstat (limited to 'test/others/crit')
-rw-r--r-- | test/others/crit/Makefile | 6 | ||||
-rwxr-xr-x | test/others/crit/test.sh | 55 |
2 files changed, 40 insertions, 21 deletions
diff --git a/test/others/crit/Makefile b/test/others/crit/Makefile index 028f4393a..75d09b66c 100644 --- a/test/others/crit/Makefile +++ b/test/others/crit/Makefile @@ -1,8 +1,4 @@ -images: clean - setsid ./loop.sh < /dev/null &> /dev/null & \ - ../../criu dump -v4 -o dump.log -D ./ -t $${!} --shell-job - -run: images +run: clean ./test.sh clean: diff --git a/test/others/crit/test.sh b/test/others/crit/test.sh index 5b0fb903c..a85b4c3b2 100755 --- a/test/others/crit/test.sh +++ b/test/others/crit/test.sh @@ -1,26 +1,49 @@ -images_list=$(ls -1 *.img) +source ../env.sh + +images_list="" function _exit { if [ $? -ne 0 ]; then echo "FAIL" - exit -1 + exit 1 fi } -for x in $images_list -do - echo "=== $x" - if [[ $x == pages* ]]; then - echo "skip" - continue +function gen_imgs { + setsid ./loop.sh < /dev/null &> /dev/null & + PID=$! + $CRIU dump -v4 -o dump.log -D ./ -t $PID + if [ $? -ne 0 ]; then + kill -9 $PID + _exit 1 + fi + + images_list=$(ls -1 *.img) + if [ -z "$images_list" ]; then + echo "Failed to generate images" + _exit 1 fi +} + +function run_test { + for x in $images_list + do + echo "=== $x" + if [[ $x == pages* ]]; then + echo "skip" + continue + fi - echo " -- to json" - ../../crit decode -o "$x"".json" --pretty < $x || _exit $? - echo " -- to img" - ../../crit encode -i "$x"".json" > "$x"".json.img" || _exit $? - echo " -- cmp" - cmp $x "$x"".json.img" || _exit $? + echo " -- to json" + $CRIT decode -o "$x"".json" --pretty < $x || _exit $? + echo " -- to img" + $CRIT encode -i "$x"".json" > "$x"".json.img" || _exit $? + echo " -- cmp" + cmp $x "$x"".json.img" || _exit $? + + echo "=== done" + done +} - echo "=== done" -done +gen_imgs +run_test |