Skip to content

Commit

Permalink
test/system: Ensure that both non-Toolbx containers & images are skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
debarshiray committed Mar 22, 2023
1 parent 11f5cde commit 701ce32
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/system/102-list.bats
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,26 @@ teardown() {
assert [ ${#lines[@]} -eq 5 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "list: With just one non-Toolbx container and one non-Toolbx image" {
local busybox_image
busybox_image="$(get_busybox_image)"

pull_distro_image busybox

local num_of_images
num_of_images="$(list_images)"
assert_equal "$num_of_images" 1

$PODMAN create --name busybox-container "$busybox_image"

local num_of_containers
num_of_containers="$(list_containers)"
assert_equal "$num_of_containers" 1

run --keep-empty-lines --separate-stderr $TOOLBOX list

assert_success
assert [ ${#lines[@]} -eq 0 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}
8 changes: 8 additions & 0 deletions test/system/libs/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ function check_bats_version() {
}


function get_busybox_image() {
local image
image="${IMAGES[busybox]}"
echo "$image"
return 0
}


function get_default_image() {
local distro
local image
Expand Down

0 comments on commit 701ce32

Please sign in to comment.