@@ -24,22 +24,26 @@ function teardown() {
2424 testcontainer test_busybox running
2525
2626 for i in ` seq 2` ; do
27- # checkpoint the running container
28- runc --criu " $CRIU " checkpoint test_busybox
29- # if you are having problems getting criu to work uncomment the following dump:
30- # cat /run/opencontainer/containers/test_busybox/criu.work/dump.log
31- [ " $status " -eq 0 ]
32-
33- # after checkpoint busybox is no longer running
34- runc state test_busybox
35- [ " $status " -ne 0 ]
36-
37- # restore from checkpoint
38- runc --criu " $CRIU " restore -d --console-socket $CONSOLE_SOCKET test_busybox
39- [ " $status " -eq 0 ]
40-
41- # busybox should be back up and running
42- testcontainer test_busybox running
27+ # checkpoint the running container
28+ runc --criu " $CRIU " checkpoint --work-path ./work-dir test_busybox
29+ ret=$?
30+ # if you are having problems getting criu to work uncomment the following dump:
31+ # cat /run/opencontainer/containers/test_busybox/criu.work/dump.log
32+ cat ./work-dir/dump.log | grep -B 5 Error || true
33+ [ " $ret " -eq 0 ]
34+
35+ # after checkpoint busybox is no longer running
36+ runc state test_busybox
37+ [ " $status " -ne 0 ]
38+
39+ # restore from checkpoint
40+ runc --criu " $CRIU " restore -d --work-path ./work-dir --console-socket $CONSOLE_SOCKET test_busybox
41+ ret=$?
42+ cat ./work-dir/restore.log | grep -B 5 Error || true
43+ [ " $ret " -eq 0 ]
44+
45+ # busybox should be back up and running
46+ testcontainer test_busybox running
4347 done
4448}
4549
0 commit comments