test/system: Test 'list' with the default Toolbx image

This is the 'simple' case of having a well-known 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.

https://github.com/containers/toolbox/pull/1278
This commit is contained in:
Debarshi Ray 2023-03-21 18:26:11 +01:00
parent 20fa122820
commit 96d629c21f

View file

@ -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