Skip to content

Commit

Permalink
checkpoint: ignore ipv6 if CRIU_NOIPV6 is set
Browse files Browse the repository at this point in the history
Janky executes tests in a docker container and there it is impossible
to load kernel modules which are required to dump ipv6 sockets.

Signed-off-by: Andrei Vagin <[email protected]>
  • Loading branch information
avagin committed Mar 22, 2017
1 parent 758dc37 commit ea51324
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ RUN cd /tmp \

# install criu
ENV CRIU_VERSION 2.12
COPY tests/hacks/0001-criu-allow-to-ignore-ipv6-if-CRIU_NOIPV6-is-set.patch /tmp/
RUN mkdir -p /usr/src/criu \
&& curl -sSL https://github.com/xemul/criu/archive/v${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 \
&& cd /usr/src/criu \
&& cat /tmp/0001-criu-allow-to-ignore-ipv6-if-CRIU_NOIPV6-is-set.patch | patch -p1 \
&& make install-criu \
&& rm -rf /usr/src/criu

Expand All @@ -49,6 +51,8 @@ RUN mkdir -p /go/src/github.com/mvdan \
&& go install ./cmd/shfmt \
&& rm -rf /go/src/github.com/mvdan

ENV CRIU_NOIPV6 1

# setup a playground for us to spawn containers in
ENV ROOTFS /busybox
RUN mkdir -p ${ROOTFS} \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 8a9b1d0e6929d296254a8892e553621d76810e87 Mon Sep 17 00:00:00 2001
From: Andrei Vagin <[email protected]>
Date: Thu, 2 Mar 2017 14:44:18 -0800
Subject: [PATCH] criu: allow to ignore ipv6 if CRIU_NOIPV6 is set

Signed-off-by: Andrei Vagin <[email protected]>
---
criu/kerndat.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/criu/kerndat.c b/criu/kerndat.c
index 162ac28..216afe0 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -433,6 +433,8 @@ out:

static int get_ipv6()
{
+ if (getenv("CRIU_NOIPV6"))
+ return 0;
if (access("/proc/sys/net/ipv6", F_OK) < 0) {
if (errno == ENOENT) {
pr_debug("ipv6 is disabled\n");
--
2.9.3

0 comments on commit ea51324

Please sign in to comment.