Skip to content

Commit ff00fb1

Browse files
Merge pull request #1496 from dqminh/test-criu-fix-stack
Fix checkpoint/restore tests with newer kernel
2 parents d337d80 + f8cca79 commit ff00fb1

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ RUN cd /tmp \
4040
&& rm -rf /tmp/bats
4141

4242
# install criu
43-
ENV CRIU_VERSION 2.12
43+
ENV CRIU_VERSION 3ca8e575b49763030d3ddfec4af190a4c9f9deef
4444
RUN mkdir -p /usr/src/criu \
45-
&& curl -sSL https://github.com/xemul/criu/archive/v${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 \
45+
&& curl -sSL https://github.com/xemul/criu/archive/${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 \
4646
&& cd /usr/src/criu \
4747
&& make install-criu \
4848
&& rm -rf /usr/src/criu

tests/integration/checkpoint.bats

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,26 @@ function teardown() {
2424
testcontainer test_busybox running
2525

2626
for i in `seq 2`; do
27-
# checkpoint the running container
28-
runc --criu "$CRIU" checkpoint test_busybox
29-
# if you are having problems getting criu to work uncomment the following dump:
30-
#cat /run/opencontainer/containers/test_busybox/criu.work/dump.log
31-
[ "$status" -eq 0 ]
32-
33-
# after checkpoint busybox is no longer running
34-
runc state test_busybox
35-
[ "$status" -ne 0 ]
36-
37-
# restore from checkpoint
38-
runc --criu "$CRIU" restore -d --console-socket $CONSOLE_SOCKET test_busybox
39-
[ "$status" -eq 0 ]
40-
41-
# busybox should be back up and running
42-
testcontainer test_busybox running
27+
# checkpoint the running container
28+
runc --criu "$CRIU" checkpoint --work-path ./work-dir test_busybox
29+
ret=$?
30+
# if you are having problems getting criu to work uncomment the following dump:
31+
#cat /run/opencontainer/containers/test_busybox/criu.work/dump.log
32+
cat ./work-dir/dump.log | grep -B 5 Error || true
33+
[ "$ret" -eq 0 ]
34+
35+
# after checkpoint busybox is no longer running
36+
runc state test_busybox
37+
[ "$status" -ne 0 ]
38+
39+
# restore from checkpoint
40+
runc --criu "$CRIU" restore -d --work-path ./work-dir --console-socket $CONSOLE_SOCKET test_busybox
41+
ret=$?
42+
cat ./work-dir/restore.log | grep -B 5 Error || true
43+
[ "$ret" -eq 0 ]
44+
45+
# busybox should be back up and running
46+
testcontainer test_busybox running
4347
done
4448
}
4549

0 commit comments

Comments
 (0)