test/system: Test 'list' with a RHEL Toolbx image
This restores parts of commit e09de9f3e5
.
https://github.com/containers/toolbox/pull/1273
This commit is contained in:
parent
aa9da193c6
commit
164c9eff36
2 changed files with 32 additions and 1 deletions
|
@ -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)"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue