[CRIU] [PATCH 3/3] test: add ability to execute tests in a docker container

Andrey Vagin avagin at openvz.org
Fri Mar 20 01:33:09 PDT 2015


 # Build criu in a docker container
$ make direct-build
 # Execute tests in a docker container
$ make direct-test

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 Dockerfile | 18 ++++++++++++++++++
 Makefile   |  6 ++++++
 2 files changed, 24 insertions(+)
 create mode 100644 Dockerfile

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..1d1bb16
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,18 @@
+FROM ubuntu:utopic
+
+RUN apt-get update && apt-get install -y \
+		build-essential	\
+		protobuf-c-compiler \
+		libprotobuf-c0-dev \
+		libprotobuf-dev	\
+		bsdmainutils \
+		protobuf-compiler \
+		python-minimal \
+		libaio-dev \
+		iptables
+
+COPY . /criu
+WORKDIR /criu
+
+RUN make clean && make -j $(nproc)
+RUN make -j $(nproc) -C test ZDTM_ARGS="-C -x static/rtc -x mountpoint -x static/cgroup02 -x tcp6 -x tcpbuf6"
diff --git a/Makefile b/Makefile
index 2a63f04..29f1d5b 100644
--- a/Makefile
+++ b/Makefile
@@ -319,4 +319,10 @@ gcov:
 	genhtml -o html crtools.info
 .PHONY: gcov
 
+docker-build:
+	docker build -t criu .
+
+docker-test:
+	docker run --rm -it --privileged criu ./test/zdtm.sh -C -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup -x mountpoint
+
 .DEFAULT_GOAL	:= all
-- 
2.1.0



More information about the CRIU mailing list