Skip to content

Commit

Permalink
test/system: Test 'list' with the default Toolbx image
Browse files Browse the repository at this point in the history
This is the 'simple' case of having a well-known named Toolbx image
(ie., not a copy, not an image without a name, not a non-Toolbx image).
It's good to ensure that the default image works as expected with 'list'
before moving on to more complex scenarios.

containers#1273
  • Loading branch information
debarshiray committed Mar 22, 2023
1 parent b713e34 commit f45423a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/system/102-list.bats
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,42 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "list: Default image" {
local default_image
default_image="$(get_default_image)"

pull_default_image

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

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

assert_success
assert_line --index 1 --partial "$default_image"
assert [ ${#lines[@]} -eq 3 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "list: Default image (using --images)" {
local default_image
default_image="$(get_default_image)"

pull_default_image

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

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

assert_success
assert_line --index 1 --partial "$default_image"
assert [ ${#lines[@]} -eq 3 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "list: An image without a name" {
build_image_without_name >/dev/null

Expand Down

0 comments on commit f45423a

Please sign in to comment.