Skip to content

Commit

Permalink
Merge pull request #1496 from dqminh/test-criu-fix-stack
Browse files Browse the repository at this point in the history
Fix checkpoint/restore tests with newer kernel
  • Loading branch information
crosbymichael committed Jun 26, 2017
2 parents d337d80 + f8cca79 commit ff00fb1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ RUN cd /tmp \
&& rm -rf /tmp/bats

# install criu
ENV CRIU_VERSION 2.12
ENV CRIU_VERSION 3ca8e575b49763030d3ddfec4af190a4c9f9deef
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 \
&& curl -sSL https://github.com/xemul/criu/archive/${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 \
&& cd /usr/src/criu \
&& make install-criu \
&& rm -rf /usr/src/criu
Expand Down
36 changes: 20 additions & 16 deletions tests/integration/checkpoint.bats
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,26 @@ function teardown() {
testcontainer test_busybox running

for i in `seq 2`; do
# checkpoint the running container
runc --criu "$CRIU" checkpoint test_busybox
# if you are having problems getting criu to work uncomment the following dump:
#cat /run/opencontainer/containers/test_busybox/criu.work/dump.log
[ "$status" -eq 0 ]

# after checkpoint busybox is no longer running
runc state test_busybox
[ "$status" -ne 0 ]

# restore from checkpoint
runc --criu "$CRIU" restore -d --console-socket $CONSOLE_SOCKET test_busybox
[ "$status" -eq 0 ]

# busybox should be back up and running
testcontainer test_busybox running
# checkpoint the running container
runc --criu "$CRIU" checkpoint --work-path ./work-dir test_busybox
ret=$?
# if you are having problems getting criu to work uncomment the following dump:
#cat /run/opencontainer/containers/test_busybox/criu.work/dump.log
cat ./work-dir/dump.log | grep -B 5 Error || true
[ "$ret" -eq 0 ]

# after checkpoint busybox is no longer running
runc state test_busybox
[ "$status" -ne 0 ]

# restore from checkpoint
runc --criu "$CRIU" restore -d --work-path ./work-dir --console-socket $CONSOLE_SOCKET test_busybox
ret=$?
cat ./work-dir/restore.log | grep -B 5 Error || true
[ "$ret" -eq 0 ]

# busybox should be back up and running
testcontainer test_busybox running
done
}

Expand Down

0 comments on commit ff00fb1

Please sign in to comment.