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:
@@ -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"
|
||||
}
|
||||
|
||||
27
tmt/tests/booted/readonly/017-test-bound-storage.nu
Normal file
27
tmt/tests/booted/readonly/017-test-bound-storage.nu
Normal 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
|
||||
Reference in New Issue
Block a user