1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 06:45:13 +01:00

tests: Use --bind-storage-ro with bcvk

To make it easier to do upgrade tests.

Signed-off-by: Colin Walters <walters@verbum.org>
Co-authored-by: Xiaofeng Wang <henrywangxf@me.com>
Signed-off-by: Colin Walters <walters@verbum.org>
This commit is contained in:
Colin Walters
2025-11-20 13:36:10 -05:00
parent 17ff4bcd48
commit 7f2b73d51d
3 changed files with 39 additions and 1 deletions

View File

@@ -12,3 +12,10 @@ export def reboot [] {
tmt-reboot
}
# True if we're running in bcvk with `--bind-storage-ro` and
# we can expect to be able to pull container images from the host.
# See xtask.rs
export def have_hostexports [] {
$env.BCVK_EXPORT? == "1"
}

View File

@@ -0,0 +1,27 @@
# Verify that we have host container storage with bcvk
use std assert
use tap.nu
use ../bootc_testlib.nu
if not (bootc_testlib have_hostexports) {
print "No host exports, skipping"
exit 0
}
bootc status
let st = bootc status --json | from json
let is_composefs = ($st.status.booted.composefs? != null)
if $is_composefs {
# TODO we don't have imageDigest yet in status
exit 0
}
let booted = $st.status.booted
let imgref = $booted.image.image.image
let digest = $booted.image.imageDigest
let imgref_untagged = $imgref | split row ':' | first
let digested_imgref = $"($imgref_untagged)@($digest)"
systemd-run -dqP /bin/env
podman inspect $digested_imgref
tap ok