-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #871 from omertuc/imagelist
List logically bound images
- Loading branch information
Showing
5 changed files
with
263 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,41 @@ | ||
use std assert | ||
use tap.nu | ||
|
||
let images = podman --storage-opt=additionalimagestore=/usr/lib/bootc/storage images --format {{.Repository}} | from csv --noheaders | ||
print "IMAGES:" | ||
podman --storage-opt=additionalimagestore=/usr/lib/bootc/storage images # for debugging | ||
assert ($images | any {|item| $item.column1 == "quay.io/curl/curl"}) | ||
assert ($images | any {|item| $item.column1 == "quay.io/curl/curl-base"}) | ||
assert ($images | any {|item| $item.column1 == "registry.access.redhat.com/ubi9/podman"}) # this image is signed | ||
# This list reflects the LBIs specified in bootc/tests/containerfiles/lbi/usr/share/containers/systemd | ||
let expected_images = [ | ||
"quay.io/curl/curl:latest", | ||
"quay.io/curl/curl-base:latest", | ||
"registry.access.redhat.com/ubi9/podman:latest" # this image is signed | ||
] | ||
|
||
def validate_images [images: table] { | ||
print $"Validating images ($images)" | ||
for expected in $expected_images { | ||
assert ($images | any {|item| $item.image == $expected}) | ||
} | ||
} | ||
|
||
# This test checks that bootc actually populated the bootc storage with the LBI images | ||
def test_logically_bound_images_in_storage [] { | ||
# Use podman to list the images in the bootc storage | ||
let images = podman --storage-opt=additionalimagestore=/usr/lib/bootc/storage images --format {{.Repository}}:{{.Tag}} | from csv --noheaders | rename --column { column1: image } | ||
|
||
# Debug print | ||
print "IMAGES:" | ||
podman --storage-opt=additionalimagestore=/usr/lib/bootc/storage images | ||
|
||
validate_images $images | ||
} | ||
|
||
# This test makes sure that bootc itself knows how to list the LBI images in the bootc storage | ||
def test_bootc_image_list [] { | ||
# Use bootc to list the images in the bootc storage | ||
let images = bootc image list --type logical --format json | from json | ||
|
||
validate_images $images | ||
} | ||
|
||
test_logically_bound_images_in_storage | ||
test_bootc_image_list | ||
|
||
tap ok |