[CRIU] [PATCH] test: add scripts, which are used by jenkins (v2)

Andrey Vagin avagin at openvz.org
Tue Feb 25 04:09:16 PST 2014


v2: split one job on a few parts
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/jenkins/criu-btrfs.sh |  6 ++++++
 test/jenkins/criu-by-id.sh | 12 ++++++++++++
 test/jenkins/criu-dump.sh  |  8 ++++++++
 test/jenkins/criu-iter.sh  |  6 ++++++
 test/jenkins/criu-lib.sh   | 21 +++++++++++++++++++++
 test/jenkins/criu-snap.sh  |  8 ++++++++
 test/jenkins/criu.sh       | 11 +++++++++++
 7 files changed, 72 insertions(+)
 create mode 100644 test/jenkins/criu-btrfs.sh
 create mode 100644 test/jenkins/criu-by-id.sh
 create mode 100644 test/jenkins/criu-dump.sh
 create mode 100644 test/jenkins/criu-iter.sh
 create mode 100644 test/jenkins/criu-lib.sh
 create mode 100644 test/jenkins/criu-snap.sh
 create mode 100644 test/jenkins/criu.sh

diff --git a/test/jenkins/criu-btrfs.sh b/test/jenkins/criu-btrfs.sh
new file mode 100644
index 0000000..02c689d
--- /dev/null
+++ b/test/jenkins/criu-btrfs.sh
@@ -0,0 +1,6 @@
+# This is a job which is executed on btrfs
+
+source `dirname $0`/criu-lib.sh &&
+prep &&
+make -C test -j 4 ZDTM_ARGS="-C -x '\(maps04\|mountpoints\)'" &&
+true || fail
diff --git a/test/jenkins/criu-by-id.sh b/test/jenkins/criu-by-id.sh
new file mode 100644
index 0000000..c350b07
--- /dev/null
+++ b/test/jenkins/criu-by-id.sh
@@ -0,0 +1,12 @@
+echo 950000 > /sys/fs/cgroup/cpu,cpuacct/system/cpu.rt_runtime_us
+echo 950000 > /sys/fs/cgroup/cpu,cpuacct/system/jenkins.service/cpu.rt_runtime_us
+git checkout -f ${TEST_COMMIT}
+git clean -dfx &&
+make -j 4 && make -j 4 -C test/zdtm &&
+mkdir -p test/dump &&
+mount -t tmpfs zdtm test/dump &&
+make -C test -j 32 zdtm_ns &&
+true || {
+    tar -czf /home/criu-by-id-${TEST_COMMIT}-$(date +%m%d%H%M).tar.gz .
+    exit 1
+}
diff --git a/test/jenkins/criu-dump.sh b/test/jenkins/criu-dump.sh
new file mode 100644
index 0000000..d924d2b
--- /dev/null
+++ b/test/jenkins/criu-dump.sh
@@ -0,0 +1,8 @@
+# Check that dump is not destructive
+
+source `dirname $0`/criu-lib.sh &&
+prep &&
+mkdir -p test/dump &&
+mount -t tmpfs dump test/dump &&
+make -C test -j 4 ZDTM_ARGS="-d -C" &&
+true || fail
diff --git a/test/jenkins/criu-iter.sh b/test/jenkins/criu-iter.sh
new file mode 100644
index 0000000..a537866
--- /dev/null
+++ b/test/jenkins/criu-iter.sh
@@ -0,0 +1,6 @@
+# Make 3 iteration of dump/restore for each test
+
+source `dirname $0`/criu-lib.sh &&
+prep &&
+make -C test -j 4 ZDTM_ARGS="-C -i 3" &&
+true || fail
diff --git a/test/jenkins/criu-lib.sh b/test/jenkins/criu-lib.sh
new file mode 100644
index 0000000..aa70d79
--- /dev/null
+++ b/test/jenkins/criu-lib.sh
@@ -0,0 +1,21 @@
+function prep()
+{
+	# systemd executes jenkins in a separate sched cgroup.
+	echo 950000 > /sys/fs/cgroup/cpu,cpuacct/system/cpu.rt_runtime_us || true
+	echo 950000 > /sys/fs/cgroup/cpu,cpuacct/system/jenkins.service/cpu.rt_runtime_us || true
+
+	ulimit -c unlimited &&
+	git clean -dfx &&
+	make -j 4 &&
+	make -j 4 -C test/zdtm/live &&
+	true
+}
+
+function fail()
+{
+	uname -a
+	ps axf > ps.log
+	cat /sys/kernel/debug/tracing/trace > trace.log
+	tar -czf /home/`basename $0`-${GIT_COMMIT}-$(date +%m%d%H%M).tar.gz .
+	exit 1
+}
diff --git a/test/jenkins/criu-snap.sh b/test/jenkins/criu-snap.sh
new file mode 100644
index 0000000..f92a4f0
--- /dev/null
+++ b/test/jenkins/criu-snap.sh
@@ -0,0 +1,8 @@
+# Check snapshots
+
+source `dirname $0`/criu-lib.sh &&
+prep &&
+mkdir -p test/dump &&
+mount -t tmpfs dump test/dump &&
+make -C test -j 4 ZDTM_ARGS="-s -i 3 -C -x '\(unlink\|socket-tcp\)'" &&
+true || fail
diff --git a/test/jenkins/criu.sh b/test/jenkins/criu.sh
new file mode 100644
index 0000000..35fecb5
--- /dev/null
+++ b/test/jenkins/criu.sh
@@ -0,0 +1,11 @@
+source `dirname $0`/criu-lib.sh &&
+prep &&
+bash test/zdtm.sh -C &&
+true || fail
+
+# Execute tests for each new commit
+git rev-parse tested || ( git tag tested; exit )
+for i in `git rev-list --reverse tested..HEAD`; do
+    curl "http://localhost:8080/job/CRIU-by-id/buildWithParameters?token=d6edab71&TEST_COMMIT=$i" || exit 1
+done
+git tag -f tested
-- 
1.8.5.3



More information about the CRIU mailing list