Merge pull request #1496 from dqminh/test-criu-fix-stack

Fix checkpoint/restore tests with newer kernel
This commit is contained in:
Michael Crosby 2017-06-26 12:46:20 -07:00 committed by GitHub
commit ff00fb108c
2 changed files with 19 additions and 15 deletions

View File

@ -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

View File

@ -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 ]
# 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 ]
# 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 ]
# 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
# busybox should be back up and running
testcontainer test_busybox running
done
}