@@ -126,18 +126,14 @@ function simple_cr() {
126126 testcontainer test_busybox running
127127
128128 for _ in $( seq 2) ; do
129- # checkpoint the running container
130129 runc " $@ " checkpoint --work-path ./work-dir test_busybox
131130 [ " $status " -eq 0 ]
132131
133- # after checkpoint busybox is no longer running
134132 testcontainer test_busybox checkpointed
135133
136- # restore from checkpoint
137134 runc " $@ " restore -d --work-path ./work-dir --console-socket " $CONSOLE_SOCKET " test_busybox
138135 [ " $status " -eq 0 ]
139136
140- # busybox should be back up and running
141137 testcontainer test_busybox running
142138 done
143139}
@@ -160,27 +156,23 @@ function simple_cr_with_netdevice() {
160156 [ " $status " -eq 0 ]
161157
162158 testcontainer test_busybox_netdevice running
163- run runc exec test_busybox_netdevice ip address show dev dummy0
159+ runc exec test_busybox_netdevice ip address show dev dummy0
164160 [ " $status " -eq 0 ]
165161 [[ " $output " == * " $global_ip " * ]]
166162 [[ " $output " == * " ether $mac_address " * ]]
167163 [[ " $output " == * " mtu $mtu_value " * ]]
168164
169165 for _ in $( seq 2) ; do
170- # checkpoint the running container
171166 runc " $@ " checkpoint --work-path ./work-dir test_busybox_netdevice
172167 [ " $status " -eq 0 ]
173168
174- # after checkpoint busybox is no longer running
175169 testcontainer test_busybox_netdevice checkpointed
176170
177- # restore from checkpoint
178171 runc " $@ " restore -d --work-path ./work-dir --console-socket " $CONSOLE_SOCKET " test_busybox_netdevice
179172 [ " $status " -eq 0 ]
180173
181- # busybox should be back up and running
182174 testcontainer test_busybox_netdevice running
183- run runc exec test_busybox_netdevice ip address show dev dummy0
175+ runc exec test_busybox_netdevice ip address show dev dummy0
184176 [ " $status " -eq 0 ]
185177 [[ " $output " == * " $global_ip " * ]]
186178 [[ " $output " == * " ether $mac_address " * ]]
@@ -271,15 +263,12 @@ function simple_cr_with_netdevice() {
271263 setup_pipes
272264 runc_run_with_pipes test_busybox
273265
274- # test checkpoint pre-dump
275266 mkdir parent-dir
276267 runc checkpoint --pre-dump --image-path ./parent-dir test_busybox
277268 [ " $status " -eq 0 ]
278269
279- # busybox should still be running
280270 testcontainer test_busybox running
281271
282- # checkpoint the running container
283272 mkdir image-dir
284273 mkdir work-dir
285274 runc checkpoint --parent-path ../parent-dir --work-path ./work-dir --image-path ./image-dir test_busybox
@@ -288,7 +277,6 @@ function simple_cr_with_netdevice() {
288277 # check parent path is valid
289278 [ -e ./image-dir/parent ]
290279
291- # after checkpoint busybox is no longer running
292280 testcontainer test_busybox checkpointed
293281
294282 runc_restore_with_pipes ./work-dir test_busybox
@@ -302,7 +290,6 @@ function simple_cr_with_netdevice() {
302290 setup_pipes
303291 runc_run_with_pipes test_busybox
304292
305- # checkpoint the running container
306293 mkdir image-dir
307294 mkdir work-dir
308295
@@ -391,14 +378,12 @@ function simple_cr_with_netdevice() {
391378 runc checkpoint --work-path ./work-dir test_busybox
392379 [ " $status " -eq 0 ]
393380
394- # after checkpoint busybox is no longer running
395381 testcontainer test_busybox checkpointed
396382
397383 # restore from checkpoint; this should restore the container into the existing network namespace
398384 runc restore -d --work-path ./work-dir --console-socket " $CONSOLE_SOCKET " test_busybox
399385 [ " $status " -eq 0 ]
400386
401- # busybox should be back up and running
402387 testcontainer test_busybox running
403388
404389 # container should be running in same network namespace as before
@@ -436,23 +421,20 @@ function simple_cr_with_netdevice() {
436421
437422 testcontainer test_busybox running
438423
439- # checkpoint the running container
440424 runc checkpoint --work-path ./work-dir test_busybox
441425 [ " $status " -eq 0 ]
442426 run ! test -f ./work-dir/" $tmplog1 "
443427 test -f ./work-dir/" $tmplog2 "
444428
445- # after checkpoint busybox is no longer running
446429 testcontainer test_busybox checkpointed
447430
448431 test -f ./work-dir/" $tmplog2 " && unlink ./work-dir/" $tmplog2 "
449- # restore from checkpoint
432+
450433 runc restore -d --work-path ./work-dir --console-socket " $CONSOLE_SOCKET " test_busybox
451434 [ " $status " -eq 0 ]
452435 run ! test -f ./work-dir/" $tmplog1 "
453436 test -f ./work-dir/" $tmplog2 "
454437
455- # busybox should be back up and running
456438 testcontainer test_busybox running
457439 unlink " $tmp "
458440 test -f ./work-dir/" $tmplog2 " && unlink ./work-dir/" $tmplog2 "
@@ -479,22 +461,18 @@ function simple_cr_with_netdevice() {
479461
480462 testcontainer test_busybox running
481463
482- # checkpoint the running container
483464 runc checkpoint --work-path ./work-dir test_busybox
484465 [ " $status " -eq 0 ]
485466
486- # after checkpoint busybox is no longer running
487467 testcontainer test_busybox checkpointed
488468
489469 # cleanup mountpoints created by runc during creation
490470 # the mountpoints should be recreated during restore - that is the actual thing tested here
491471 rm -rf " ${bind1:? } " /*
492472
493- # restore from checkpoint
494473 runc restore -d --work-path ./work-dir --console-socket " $CONSOLE_SOCKET " test_busybox
495474 [ " $status " -eq 0 ]
496475
497- # busybox should be back up and running
498476 testcontainer test_busybox running
499477}
500478
@@ -545,18 +523,14 @@ function simple_cr_with_netdevice() {
545523
546524 local execed_pid=" "
547525 for _ in $( seq 2) ; do
548- # checkpoint the running container
549526 runc checkpoint --work-path ./work-dir test_busybox
550527 [ " $status " -eq 0 ]
551528
552- # after checkpoint busybox is no longer running
553529 testcontainer test_busybox checkpointed
554530
555- # restore from checkpoint
556531 runc restore -d --work-path ./work-dir --console-socket " $CONSOLE_SOCKET " test_busybox
557532 [ " $status " -eq 0 ]
558533
559- # busybox should be back up and running
560534 testcontainer test_busybox running
561535
562536 # verify that previously exec'd process is restored.
0 commit comments