2019-07-29 14:21:45 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -x -e -o pipefail
|
|
|
|
|
2020-11-03 10:18:02 +00:00
|
|
|
export SKIP_CI_TEST=1
|
2019-07-29 14:21:45 +00:00
|
|
|
|
2020-11-03 10:18:02 +00:00
|
|
|
./run-ci-tests.sh
|
2019-07-29 14:21:45 +00:00
|
|
|
|
|
|
|
cd ../../
|
|
|
|
|
|
|
|
make install
|
|
|
|
|
|
|
|
criu --version
|
|
|
|
|
2020-09-17 17:05:33 +00:00
|
|
|
# shellcheck disable=SC2016
|
2019-07-29 14:21:45 +00:00
|
|
|
podman run --name cr -d docker.io/library/alpine /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
|
|
|
|
|
|
|
|
sleep 1
|
2020-09-17 17:05:33 +00:00
|
|
|
for i in $(seq 20); do
|
2019-07-29 14:21:45 +00:00
|
|
|
echo "Test $i for podman container checkpoint"
|
|
|
|
podman exec cr ps axf
|
|
|
|
podman logs cr
|
2020-09-17 17:05:33 +00:00
|
|
|
[ "$(podman ps -f name=cr -q -f status=running | wc -l)" -eq "1" ]
|
2019-07-29 14:21:45 +00:00
|
|
|
podman container checkpoint cr
|
2020-09-17 17:05:33 +00:00
|
|
|
[ "$(podman ps -f name=cr -q -f status=running | wc -l)" -eq "0" ]
|
2019-07-29 14:21:45 +00:00
|
|
|
podman ps -a
|
|
|
|
podman container restore cr
|
2020-09-17 17:05:33 +00:00
|
|
|
[ "$(podman ps -f name=cr -q -f status=running | wc -l)" -eq "1" ]
|
2019-07-29 14:21:45 +00:00
|
|
|
podman logs cr
|
|
|
|
done
|
|
|
|
|
2020-09-17 17:05:33 +00:00
|
|
|
for i in $(seq 20); do
|
2019-07-29 14:21:45 +00:00
|
|
|
echo "Test $i for podman container checkpoint --export"
|
|
|
|
podman ps -a
|
|
|
|
podman exec cr ps axf
|
|
|
|
podman logs cr
|
2020-09-17 17:05:33 +00:00
|
|
|
[ "$(podman ps -f name=cr -q -f status=running | wc -l)" -eq "1" ]
|
2019-07-29 14:21:45 +00:00
|
|
|
podman container checkpoint -l --export /tmp/chkpt.tar.gz
|
2020-09-17 17:05:33 +00:00
|
|
|
[ "$(podman ps -f name=cr -q -f status=running | wc -l)" -eq "0" ]
|
2019-07-29 14:21:45 +00:00
|
|
|
podman ps -a
|
|
|
|
podman rm -fa
|
|
|
|
podman ps -a
|
|
|
|
podman container restore --import /tmp/chkpt.tar.gz
|
2020-09-17 17:05:33 +00:00
|
|
|
[ "$(podman ps -f name=cr -q -f status=running | wc -l)" -eq "1" ]
|
2019-07-29 14:21:45 +00:00
|
|
|
podman container restore --name cr2 --import /tmp/chkpt.tar.gz
|
2020-09-17 17:05:33 +00:00
|
|
|
[ "$(podman ps -f name=cr2 -q -f status=running | wc -l)" -eq "1" ]
|
2019-07-29 14:21:45 +00:00
|
|
|
podman ps -a
|
|
|
|
podman logs cr
|
|
|
|
podman logs cr2
|
|
|
|
podman ps -a
|
|
|
|
podman rm -fa
|
|
|
|
podman ps -a
|
|
|
|
podman container restore --import /tmp/chkpt.tar.gz
|
2020-09-17 17:05:33 +00:00
|
|
|
[ "$(podman ps -f name=cr -q -f status=running | wc -l)" -eq "1" ]
|
2019-07-29 14:21:45 +00:00
|
|
|
podman ps -a
|
|
|
|
rm -f /tmp/chkpt.tar.gz
|
|
|
|
done
|