2017-10-05 20:38:24 +03:00
|
|
|
#!/bin/bash
|
2020-09-17 17:05:33 +00:00
|
|
|
|
|
|
|
# shellcheck disable=SC1091,SC2015
|
|
|
|
|
2017-10-05 20:38:24 +03:00
|
|
|
set -x -e -o pipefail
|
|
|
|
|
2020-08-14 08:37:25 +00:00
|
|
|
./apt-install \
|
2017-10-05 20:38:24 +03:00
|
|
|
apt-transport-https \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
software-properties-common
|
|
|
|
|
|
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
|
|
|
|
|
|
|
add-apt-repository \
|
|
|
|
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
|
|
|
$(lsb_release -cs) \
|
2019-01-01 23:06:38 -08:00
|
|
|
stable test"
|
2017-10-05 20:38:24 +03:00
|
|
|
|
2020-08-14 08:37:25 +00:00
|
|
|
./apt-install docker-ce
|
2017-10-05 20:38:24 +03:00
|
|
|
|
2019-12-20 17:50:37 +01:00
|
|
|
. /etc/lsb-release
|
|
|
|
|
|
|
|
if [ "$DISTRIB_RELEASE" = "18.04" ]; then
|
|
|
|
# overlayfs behaves differently on Ubuntu (18.04) and breaks CRIU
|
|
|
|
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1857257
|
|
|
|
# Switch to devicemapper
|
|
|
|
echo '{ "experimental": true, "storage-driver": "devicemapper" }' > /etc/docker/daemon.json
|
|
|
|
else
|
|
|
|
echo '{ "experimental": true }' > /etc/docker/daemon.json
|
|
|
|
fi
|
2017-10-05 20:38:24 +03:00
|
|
|
|
|
|
|
service docker restart
|
|
|
|
|
|
|
|
export SKIP_TRAVIS_TEST=1
|
|
|
|
|
|
|
|
./travis-tests
|
|
|
|
|
|
|
|
cd ../../
|
|
|
|
|
2017-10-05 23:17:05 +03:00
|
|
|
make install
|
2017-10-05 20:38:24 +03:00
|
|
|
|
|
|
|
docker info
|
|
|
|
|
|
|
|
criu --version
|
|
|
|
|
2020-09-17 17:05:33 +00:00
|
|
|
# shellcheck disable=SC2016
|
2019-03-22 21:03:48 +00:00
|
|
|
docker run --tmpfs /tmp --tmpfs /run --read-only --security-opt seccomp=unconfined --name cr -d alpine /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
|
2017-10-05 20:38:24 +03:00
|
|
|
|
|
|
|
sleep 1
|
2020-09-17 17:05:33 +00:00
|
|
|
for i in $(seq 50); do
|
2017-10-05 20:38:24 +03:00
|
|
|
# docker start returns 0 silently if a container is already started
|
|
|
|
# docker checkpoint doesn't wait when docker updates a container state
|
|
|
|
# Due to both these points, we need to sleep after docker checkpoint to
|
|
|
|
# avoid races with docker start.
|
|
|
|
docker exec cr ps axf &&
|
2020-09-17 17:05:33 +00:00
|
|
|
docker checkpoint create cr checkpoint"$i" &&
|
2017-10-05 20:38:24 +03:00
|
|
|
sleep 1 &&
|
2019-01-01 23:06:38 -08:00
|
|
|
docker ps &&
|
|
|
|
(docker exec cr true && exit 1 || exit 0) &&
|
2020-09-17 17:05:33 +00:00
|
|
|
docker start --checkpoint checkpoint"$i" cr 2>&1 | tee log || {
|
|
|
|
cat "$(grep log 'log file:' | sed 's/log file:\s*//')" || true
|
2017-10-05 20:38:24 +03:00
|
|
|
docker logs cr || true
|
|
|
|
cat /tmp/zdtm-core-* || true
|
|
|
|
dmesg
|
|
|
|
docker ps
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
docker ps
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|