test: check C/R for a container with an external terminal
We have two test cases with and without pre-dump. Terminals and
pre-dump features are orthogonal, so we can modify one of these test cases.
@@ -17,15 +17,9 @@ function teardown() {
# criu does not work with external terminals so..
# setting terminal and root:readonly: to false
- sed -i 's;"terminal": true;"terminal": false;' config.json
- sed -i 's;"readonly": true;"readonly": false;' config.json
- sed -i 's/"sh"/"sh","-c","while :; do date; sleep 1; done"/' config.json
- (
- # run busybox (not detached)
- runc run test_busybox
+ runc run -d --console-socket $CONSOLE_SOCKET test_busybox
[ "$status" -eq 0 ]
- ) &
# check state
wait_for_container 15 1 test_busybox
@@ -34,6 +28,7 @@ function teardown() {
[ "$status" -eq 0 ]
[[ "${output}" == *"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:
@@ -46,12 +41,13 @@ function teardown() {
# restore from checkpoint
(
- runc --criu "$CRIU" restore test_busybox
+ runc --criu "$CRIU" restore -d --console-socket $CONSOLE_SOCKET test_busybox
[ "$status" -eq 0 ]
) &
# check state
wait_for_container 15 1 test_busybox
+ done
# busybox should be back up and running
runc state test_busybox
@@ -63,8 +59,6 @@ function teardown() {
# XXX: currently criu require root containers.
requires criu root
- # criu does not work with external terminals so..
- # setting terminal and root:readonly: to false
sed -i 's;"terminal": true;"terminal": false;' config.json
sed -i 's;"readonly": true;"readonly": false;' config.json
sed -i 's/"sh"/"sh","-c","while :; do date; sleep 1; done"/' config.json
