From 14ee7ece9a8cbf37d0bda45a89dd5f18822aa3ff Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 22 Mar 2023 08:37:30 +0100 Subject: [PATCH] test/system: Test 'list' with an old Fedora Toolbx image It's good to ensure that older well-known Toolbx images continue to work with newer versions of 'list'. https://github.com/containers/toolbox/pull/1273 --- test/system/102-list.bats | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/system/102-list.bats b/test/system/102-list.bats index 1d0639022..92d3cabb5 100644 --- a/test/system/102-list.bats +++ b/test/system/102-list.bats @@ -118,6 +118,36 @@ teardown() { assert [ ${#stderr_lines[@]} -eq 0 ] } +@test "list: Fedora 34 image" { + pull_distro_image fedora 34 + + 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 "registry.fedoraproject.org/fedora-toolbox:34" + assert [ ${#lines[@]} -eq 3 ] + assert [ ${#stderr_lines[@]} -eq 0 ] +} + +@test "list: Fedora 34 image (using --images)" { + pull_distro_image fedora 34 + + 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 "registry.fedoraproject.org/fedora-toolbox:34" + assert [ ${#lines[@]} -eq 3 ] + assert [ ${#stderr_lines[@]} -eq 0 ] +} + @test "list: An image without a name" { build_image_without_name >/dev/null