From 345fc9f7c7987cb6457709d58298c67a496dfbb9 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 21 Jan 2021 12:19:54 -0800 Subject: [PATCH] tests/int/list.bats: don't use $BUSYBOX_BUNDLE Use the value of $(pwd) as we cd to bundle dir before running a test. Signed-off-by: Kir Kolyshkin --- tests/integration/list.bats | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/integration/list.bats b/tests/integration/list.bats index 1ebb77c1ee1..97d6028ba18 100644 --- a/tests/integration/list.bats +++ b/tests/integration/list.bats @@ -20,6 +20,7 @@ function teardown() { } @test "list" { + bundle=$(pwd) # run a few busyboxes detached ROOT=$ALT_ROOT runc run -d --console-socket "$CONSOLE_SOCKET" test_box1 [ "$status" -eq 0 ] @@ -33,9 +34,9 @@ function teardown() { ROOT=$ALT_ROOT runc list [ "$status" -eq 0 ] [[ ${lines[0]} =~ ID\ +PID\ +STATUS\ +BUNDLE\ +CREATED+ ]] - [[ "${lines[1]}" == *"test_box1"*[0-9]*"running"*$BUSYBOX_BUNDLE*[0-9]* ]] - [[ "${lines[2]}" == *"test_box2"*[0-9]*"running"*$BUSYBOX_BUNDLE*[0-9]* ]] - [[ "${lines[3]}" == *"test_box3"*[0-9]*"running"*$BUSYBOX_BUNDLE*[0-9]* ]] + [[ "${lines[1]}" == *"test_box1"*[0-9]*"running"*$bundle*[0-9]* ]] + [[ "${lines[2]}" == *"test_box2"*[0-9]*"running"*$bundle*[0-9]* ]] + [[ "${lines[3]}" == *"test_box3"*[0-9]*"running"*$bundle*[0-9]* ]] ROOT=$ALT_ROOT runc list -q [ "$status" -eq 0 ] @@ -46,13 +47,13 @@ function teardown() { ROOT=$ALT_ROOT runc list --format table [ "$status" -eq 0 ] [[ ${lines[0]} =~ ID\ +PID\ +STATUS\ +BUNDLE\ +CREATED+ ]] - [[ "${lines[1]}" == *"test_box1"*[0-9]*"running"*$BUSYBOX_BUNDLE*[0-9]* ]] - [[ "${lines[2]}" == *"test_box2"*[0-9]*"running"*$BUSYBOX_BUNDLE*[0-9]* ]] - [[ "${lines[3]}" == *"test_box3"*[0-9]*"running"*$BUSYBOX_BUNDLE*[0-9]* ]] + [[ "${lines[1]}" == *"test_box1"*[0-9]*"running"*$bundle*[0-9]* ]] + [[ "${lines[2]}" == *"test_box2"*[0-9]*"running"*$bundle*[0-9]* ]] + [[ "${lines[3]}" == *"test_box3"*[0-9]*"running"*$bundle*[0-9]* ]] ROOT=$ALT_ROOT runc list --format json [ "$status" -eq 0 ] - [[ "${lines[0]}" == [\[][\{]"\"ociVersion\""[:]"\""*[0-9][\.]*[0-9][\.]*[0-9]*"\""[,]"\"id\""[:]"\"test_box1\""[,]"\"pid\""[:]*[0-9][,]"\"status\""[:]*"\"running\""[,]"\"bundle\""[:]*$BUSYBOX_BUNDLE*[,]"\"rootfs\""[:]"\""*"\""[,]"\"created\""[:]*[0-9]*[\}]* ]] - [[ "${lines[0]}" == *[,][\{]"\"ociVersion\""[:]"\""*[0-9][\.]*[0-9][\.]*[0-9]*"\""[,]"\"id\""[:]"\"test_box2\""[,]"\"pid\""[:]*[0-9][,]"\"status\""[:]*"\"running\""[,]"\"bundle\""[:]*$BUSYBOX_BUNDLE*[,]"\"rootfs\""[:]"\""*"\""[,]"\"created\""[:]*[0-9]*[\}]* ]] - [[ "${lines[0]}" == *[,][\{]"\"ociVersion\""[:]"\""*[0-9][\.]*[0-9][\.]*[0-9]*"\""[,]"\"id\""[:]"\"test_box3\""[,]"\"pid\""[:]*[0-9][,]"\"status\""[:]*"\"running\""[,]"\"bundle\""[:]*$BUSYBOX_BUNDLE*[,]"\"rootfs\""[:]"\""*"\""[,]"\"created\""[:]*[0-9]*[\}][\]] ]] + [[ "${lines[0]}" == [\[][\{]"\"ociVersion\""[:]"\""*[0-9][\.]*[0-9][\.]*[0-9]*"\""[,]"\"id\""[:]"\"test_box1\""[,]"\"pid\""[:]*[0-9][,]"\"status\""[:]*"\"running\""[,]"\"bundle\""[:]*$bundle*[,]"\"rootfs\""[:]"\""*"\""[,]"\"created\""[:]*[0-9]*[\}]* ]] + [[ "${lines[0]}" == *[,][\{]"\"ociVersion\""[:]"\""*[0-9][\.]*[0-9][\.]*[0-9]*"\""[,]"\"id\""[:]"\"test_box2\""[,]"\"pid\""[:]*[0-9][,]"\"status\""[:]*"\"running\""[,]"\"bundle\""[:]*$bundle*[,]"\"rootfs\""[:]"\""*"\""[,]"\"created\""[:]*[0-9]*[\}]* ]] + [[ "${lines[0]}" == *[,][\{]"\"ociVersion\""[:]"\""*[0-9][\.]*[0-9][\.]*[0-9]*"\""[,]"\"id\""[:]"\"test_box3\""[,]"\"pid\""[:]*[0-9][,]"\"status\""[:]*"\"running\""[,]"\"bundle\""[:]*$bundle*[,]"\"rootfs\""[:]"\""*"\""[,]"\"created\""[:]*[0-9]*[\}][\]] ]] }