Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ provision:
# Generated by make test-tmt
image: file://./target/testvm/disk.qcow2
disk: 20
summary: Execute logically bound images tests
summary: Execute logically bound images tests for switching images
execute:
how: tmt
# We avoid writing nontrivial shell script as a general rule,
# so this is written in nu.
script: exec nu tests/booted/test-logically-bound.nu
script: exec nu tests/booted/test-logically-bound-switch.nu
12 changes: 12 additions & 0 deletions plans/test-22-logically-bound-install.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
environment+:
TMT_PLUGINS: ./tests/plugins
provision:
how: bootc
add_deps: false
containerfile: tests/containerfiles/lbi/Containerfile
containerfile_workdir: tests/containerfiles/lbi
disk: 20
summary: Execute logically bound images tests for installing image
execute:
how: tmt
script: exec nu tests/booted/test-logically-bound-install.nu
10 changes: 10 additions & 0 deletions tests/booted/test-logically-bound-install.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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"})

tap ok
6 changes: 6 additions & 0 deletions tests/containerfiles/lbi/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM localhost/bootc

COPY ./usr/. /usr

RUN ln -s /usr/share/containers/systemd/curl.container /usr/lib/bootc/bound-images.d/curl.container && \
ln -s /usr/share/containers/systemd/curl-base.image /usr/lib/bootc/bound-images.d/curl-base.image
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Image]
Image=quay.io/curl/curl-base:latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Container]
Image=quay.io/curl/curl:latest
GlobalArgs=--storage-opt=additionalimagestore=/usr/lib/bootc/storage
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This is not symlinked to bound-images.d so it should not be pulled.
# It's here to represent an app image that exists
# in a bootc image but is not logically bound.
[Image]
Image=registry.redhat.io/jboss-webserver-5/jws5-rhel8-operator:latest
AuthFile=/root/auth.json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, added a comment to explain that it's meant to represent a quadlet image that is not logically bound.

4 changes: 4 additions & 0 deletions xtask/src/xtask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use fn_error_context::context;
use xshell::{cmd, Shell};

const NAME: &str = "bootc";
const TEST_IMAGES: &[&str] = &["quay.io/curl/curl-base:latest", "quay.io/curl/curl:latest"];

fn main() {
if let Err(e) = try_main() {
Expand Down Expand Up @@ -182,6 +183,9 @@ fn test_tmt(sh: &Shell) -> Result<()> {

cmd!(sh, "cargo run -p tests-integration run-vm prepare-tmt").run()?;

// pull some small images that are used for LBI installation tests
cmd!(sh, "podman pull {TEST_IMAGES...}").run()?;

for (_prio, name) in all_plan_files {
// cc https://pagure.io/testcloud/pull-request/174
cmd!(sh, "rm -vf /var/tmp/tmt/testcloud/images/disk.qcow2").run()?;
Expand Down