[CRIU] [PATCH 3/3] jenkins: Add test for crit de/encode correctness

Pavel Emelyanov xemul at parallels.com
Fri Dec 4 06:07:01 PST 2015


The crit tool should decode and encode all images and after
de- and en- sequence the result should be the same as before.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 test/jenkins/crit.sh | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100755 test/jenkins/crit.sh

diff --git a/test/jenkins/crit.sh b/test/jenkins/crit.sh
new file mode 100755
index 0000000..2e27446
--- /dev/null
+++ b/test/jenkins/crit.sh
@@ -0,0 +1,28 @@
+# Check how crit de/encodes images
+set -e
+source `dirname $0`/criu-lib.sh
+prep
+./test/zdtm.py run --all -f best -x maps04 -x cgroup02 --norst --keep always || fail
+
+images_list=$(find "test/dump/" -name '*.img')
+crit="./crit"
+
+for x in $images_list
+do
+	[[ "$(basename $x)" == pages* ]] && continue
+
+	echo "Check $x"
+
+	$crit decode -o "$x"".json" < $x || fail
+	$crit encode -i "$x"".json" > "$x"".json.img" || fail
+	cmp "$x" "${x}.json.img" || _exit $x
+	rm -f "${x}.json.img"
+
+	$crit decode -o "$x"".json" --pretty < $x || fail
+	$crit encode -i "$x"".json" > "$x"".json.img" || fail
+	cmp "$x" "${x}.json.img" || fail
+	rm -f "${x}.json.img"
+done
+
+echo "PASS"
+exit 0
-- 
1.9.3




More information about the CRIU mailing list