diff --git a/test/system/000-setup.bats b/test/system/000-setup.bats index b84fadf..a55d9e5 100644 --- a/test/system/000-setup.bats +++ b/test/system/000-setup.bats @@ -1,6 +1,6 @@ #!/usr/bin/env bats # -# Copyright © 2021 – 2022 Red Hat, Inc. +# Copyright © 2021 – 2023 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ load 'libs/helpers' _pull_and_cache_distro_image "$system_id" "$system_version" || false # Cache all images that will be needed during the tests _pull_and_cache_distro_image fedora 34 || false + _pull_and_cache_distro_image rhel 8.7 || false _pull_and_cache_distro_image busybox || false # If run on Fedora Rawhide, cache 2 extra images (previous Fedora versions) local rawhide_res="$(awk '/rawhide/' $os_release)" diff --git a/test/system/102-list.bats b/test/system/102-list.bats index 92d3cab..1586ed1 100644 --- a/test/system/102-list.bats +++ b/test/system/102-list.bats @@ -148,6 +148,36 @@ teardown() { assert [ ${#stderr_lines[@]} -eq 0 ] } +@test "list: RHEL 8.7 image" { + pull_distro_image rhel 8.7 + + 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.access.redhat.com/ubi8/toolbox:8.7" + assert [ ${#lines[@]} -eq 3 ] + assert [ ${#stderr_lines[@]} -eq 0 ] +} + +@test "list: RHEL 8.7 image (using --images)" { + pull_distro_image rhel 8.7 + + 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.access.redhat.com/ubi8/toolbox:8.7" + assert [ ${#lines[@]} -eq 3 ] + assert [ ${#stderr_lines[@]} -eq 0 ] +} + @test "list: An image without a name" { build_image_without_name >/dev/null