@@ -31,6 +31,7 @@ function teardown() {
3131 ip link del dev dummy0
3232 delete_netns
3333 teardown_bundle
34+ rm -f /etc/criu/default.conf
3435}
3536
3637function setup_pipes() {
@@ -172,7 +173,22 @@ function simple_cr_with_netdevice() {
172173}
173174
174175@test " checkpoint and restore" {
175- simple_cr
176+ ls -l /etc/criu/ || true
177+ tail /etc/criu/* || true
178+ ls -l ~ /.criu/ || true
179+ tail ~ /.criu/* || true
180+
181+ runc -0 run -d --console-socket " $CONSOLE_SOCKET " test_busybox
182+
183+ testcontainer test_busybox running
184+
185+ for _ in $( seq 2) ; do
186+ runc -0 " $@ " checkpoint --work-path ./work-dir test_busybox
187+ testcontainer test_busybox checkpointed
188+
189+ runc -0 " $@ " restore -d --work-path ./work-dir --console-socket " $CONSOLE_SOCKET " test_busybox
190+ testcontainer test_busybox running
191+ done
176192}
177193
178194@test " checkpoint and restore (bind mount, destination is symlink)" {
@@ -381,22 +397,21 @@ function simple_cr_with_netdevice() {
381397
382398@test " checkpoint and restore with container specific CRIU config" {
383399 tmp=$( mktemp /tmp/runc-criu-XXXXXX.conf)
384- # This is the file we write to /etc/criu/default.conf
400+ # Name we write to /etc/criu/default.conf.
385401 tmplog1=$( mktemp /tmp/runc-criu-log-XXXXXX.log)
386402 unlink " $tmplog1 "
387403 tmplog1=$( basename " $tmplog1 " )
388- # That is the actual configuration file to be used
404+ # Actual configuration file name to be used.
389405 tmplog2=$( mktemp /tmp/runc-criu-log-XXXXXX.log)
390406 unlink " $tmplog2 "
391407 tmplog2=$( basename " $tmplog2 " )
392- # This adds the annotation 'org.criu.config' to set a container
393- # specific CRIU config file.
408+ # Add the annotation to set a container specific CRIU config file.
394409 update_config ' .annotations += {"org.criu.config": "' " $tmp " ' "}'
395410
396- # Tell CRIU to use another configuration file
411+ # Tell CRIU to use another configuration file.
397412 mkdir -p /etc/criu
398413 echo " log-file=$tmplog1 " > /etc/criu/default.conf
399- # Make sure the RPC defined configuration file overwrites the previous
414+ # Make sure the RPC defined configuration file overwrites the default.conf.
400415 echo " log-file=$tmplog2 " > " $tmp "
401416
402417 runc -0 run -d --console-socket " $CONSOLE_SOCKET " test_busybox
0 commit comments