Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@virtuozzo.com>2016-02-29 11:36:05 +0300
committerPavel Emelyanov <xemul@virtuozzo.com>2016-02-29 11:36:05 +0300
commitf91d3f01a5001022d10a8b6a87ef447699420d23 (patch)
treeb01f7f80caf26c5012dd9b437a2a4cc3c2329933 /test/others/crit
parent17018b3c186e5d32a4fa49c244640ddd3de40e83 (diff)
zdtm: Move crit test into others
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Diffstat (limited to 'test/others/crit')
-rw-r--r--test/others/crit/.gitignore5
-rw-r--r--test/others/crit/Makefile9
-rwxr-xr-xtest/others/crit/loop.sh4
-rwxr-xr-xtest/others/crit/test.sh26
4 files changed, 44 insertions, 0 deletions
diff --git a/test/others/crit/.gitignore b/test/others/crit/.gitignore
new file mode 100644
index 000000000..9614eb6c4
--- /dev/null
+++ b/test/others/crit/.gitignore
@@ -0,0 +1,5 @@
+*.img
+*.log
+*.txt
+stats-*
+*.json
diff --git a/test/others/crit/Makefile b/test/others/crit/Makefile
new file mode 100644
index 000000000..028f4393a
--- /dev/null
+++ b/test/others/crit/Makefile
@@ -0,0 +1,9 @@
+images: clean
+ 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/others/crit/loop.sh b/test/others/crit/loop.sh
new file mode 100755
index 000000000..0ab34ce96
--- /dev/null
+++ b/test/others/crit/loop.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+while :; do
+ sleep 1
+done
diff --git a/test/others/crit/test.sh b/test/others/crit/test.sh
new file mode 100755
index 000000000..5b0fb903c
--- /dev/null
+++ b/test/others/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 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