Skip to content

Commit

Permalink
tests: Adapt for newer nushell
Browse files Browse the repository at this point in the history
It looks like the default `column1` became `column0` which
broke this. But really we don't need a table, we just need a list;
and piping to `from csv` was a weird way to go about splitting
lines into a list.

Change the assertion to just expect a list which simplifies
the code.

Signed-off-by: Colin Walters <walters@verbum.org>
  • Loading branch information
cgwalters committed Dec 5, 2024
1 parent 8d4bf5c commit 60a63c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/booted/test-logically-bound-install.nu
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ let expected_images = [
"registry.access.redhat.com/ubi9/podman:latest" # this image is signed
]

def validate_images [images: table] {
def validate_images [images: list<string>] {
print $"Validating images ($images)"
for expected in $expected_images {
assert ($images | any {|item| $item.image == $expected})
assert ($expected in $images)
}
}

# 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 }
let images = podman --storage-opt=additionalimagestore=/usr/lib/bootc/storage images --format {{.Repository}}:{{.Tag}} | split row "\n"

# Debug print
print "IMAGES:"
Expand All @@ -30,7 +30,7 @@ def test_logically_bound_images_in_storage [] {
# 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
let images = bootc image list --type logical --format json | from json | get image

validate_images $images
}
Expand Down

0 comments on commit 60a63c8

Please sign in to comment.