@@ -423,8 +423,7 @@ function teardown_recvtty() {
423423
424424function setup_busybox() {
425425 setup_recvtty
426- run mkdir " $BUSYBOX_BUNDLE "
427- run mkdir " $BUSYBOX_BUNDLE " /rootfs
426+ mkdir -p " $BUSYBOX_BUNDLE " /rootfs
428427 if [ -e " /testdata/busybox.tar" ]; then
429428 BUSYBOX_IMAGE=" /testdata/busybox.tar"
430429 fi
@@ -438,8 +437,7 @@ function setup_busybox() {
438437
439438function setup_hello() {
440439 setup_recvtty
441- run mkdir " $HELLO_BUNDLE "
442- run mkdir " $HELLO_BUNDLE " /rootfs
440+ mkdir -p " $HELLO_BUNDLE " /rootfs
443441 tar --exclude ' ./dev/*' -C " $HELLO_BUNDLE " /rootfs -xf " $HELLO_IMAGE "
444442 cd " $HELLO_BUNDLE "
445443 runc_spec
@@ -453,7 +451,7 @@ function setup_debian() {
453451 fi
454452
455453 setup_recvtty
456- run mkdir " $DEBIAN_BUNDLE "
454+ mkdir -p " $DEBIAN_BUNDLE "
457455
458456 if [ ! -d " $DEBIAN_ROOTFS /rootfs" ]; then
459457 get_and_extract_debian " $DEBIAN_BUNDLE "
@@ -468,46 +466,30 @@ function setup_debian() {
468466}
469467
470468function teardown_running_container() {
471- runc list
472- # $1 should be a container name such as "test_busybox"
473- # here we detect "test_busybox "(with one extra blank) to avoid conflict prefix
474- # e.g. "test_busybox" and "test_busybox_update"
475- if [[ " ${output} " == * " $1 " * ]]; then
476- runc kill $1 KILL
477- retry 10 1 eval " __runc state '$1 ' | grep -q 'stopped'"
478- runc delete $1
479- fi
469+ __runc delete -f " $1 "
480470}
481471
482472function teardown_running_container_inroot() {
483- ROOT=$2 runc list
484- # $1 should be a container name such as "test_busybox"
485- # here we detect "test_busybox "(with one extra blank) to avoid conflict prefix
486- # e.g. "test_busybox" and "test_busybox_update"
487- if [[ " ${output} " == * " $1 " * ]]; then
488- ROOT=$2 runc kill $1 KILL
489- retry 10 1 eval " ROOT='$2 ' __runc state '$1 ' | grep -q 'stopped'"
490- ROOT=$2 runc delete $1
491- fi
473+ ROOT=" $2 " __runc delete -f " $1 "
492474}
493475
494476function teardown_busybox() {
495477 cd " $INTEGRATION_ROOT "
496478 teardown_recvtty
497479 teardown_running_container test_busybox
498- run rm -f -r " $BUSYBOX_BUNDLE "
480+ rm -f -r " $BUSYBOX_BUNDLE "
499481}
500482
501483function teardown_hello() {
502484 cd " $INTEGRATION_ROOT "
503485 teardown_recvtty
504486 teardown_running_container test_hello
505- run rm -f -r " $HELLO_BUNDLE "
487+ rm -f -r " $HELLO_BUNDLE "
506488}
507489
508490function teardown_debian() {
509491 cd " $INTEGRATION_ROOT "
510492 teardown_recvtty
511493 teardown_running_container test_debian
512- run rm -f -r " $DEBIAN_BUNDLE "
494+ rm -f -r " $DEBIAN_BUNDLE "
513495}
0 commit comments