Skip to content

Commit c74f64d

Browse files
committed
tests: Add tmt test for bootc install with LBI
Along with the test, this will install the LBIs on the machine running the tests prior to running the tests. Also refactors the existing LBI test into a separate test plan to make room for the install tests. Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
1 parent 355810f commit c74f64d

File tree

9 files changed

+45
-2
lines changed

9 files changed

+45
-2
lines changed

plans/test-21-logically-bound.fmf renamed to plans/test-21-logically-bound-switch.fmf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ provision:
44
# Generated by make test-tmt
55
image: file://./target/testvm/disk.qcow2
66
disk: 20
7-
summary: Execute logically bound images tests
7+
summary: Execute logically bound images tests for switching images
88
execute:
99
how: tmt
1010
# We avoid writing nontrivial shell script as a general rule,
1111
# so this is written in nu.
12-
script: exec nu tests/booted/test-logically-bound.nu
12+
script: exec nu tests/booted/test-logically-bound-switch.nu
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
environment+:
2+
TMT_PLUGINS: ./tests/plugins
3+
provision:
4+
how: bootc
5+
add_deps: false
6+
containerfile: tests/containerfiles/lbi/Containerfile
7+
containerfile_workdir: tests/containerfiles/lbi
8+
disk: 20
9+
summary: Execute logically bound images tests for installing image
10+
execute:
11+
how: tmt
12+
script: exec nu tests/booted/test-logically-bound-install.nu
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use std assert
2+
use tap.nu
3+
4+
let images = podman --storage-opt=additionalimagestore=/usr/lib/bootc/storage images --format {{.Repository}} | from csv --noheaders
5+
print "IMAGES:"
6+
podman --storage-opt=additionalimagestore=/usr/lib/bootc/storage images # for debugging
7+
assert ($images | any {|item| $item.column1 == "quay.io/curl/curl"})
8+
assert ($images | any {|item| $item.column1 == "quay.io/curl/curl-base"})
9+
10+
tap ok
File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM localhost/bootc
2+
3+
COPY ./usr/. /usr
4+
5+
RUN ln -s /usr/share/containers/systemd/curl.container /usr/lib/bootc/bound-images.d/curl.container && \
6+
ln -s /usr/share/containers/systemd/curl-base.image /usr/lib/bootc/bound-images.d/curl-base.image
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Image]
2+
Image=quay.io/curl/curl-base:latest
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[Container]
2+
Image=quay.io/curl/curl:latest
3+
GlobalArgs=--storage-opt=additionalimagestore=/usr/lib/bootc/storage
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[Image]
2+
Image=registry.redhat.io/jboss-webserver-5/jws5-rhel8-operator:latest
3+
AuthFile=/root/auth.json

xtask/src/xtask.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ fn test_tmt(sh: &Shell) -> Result<()> {
182182

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

185+
// pull some small images that are used for LBI installation tests
186+
cmd!(
187+
sh,
188+
"podman pull quay.io/curl/curl-base:latest quay.io/curl/curl:latest"
189+
)
190+
.run()?;
191+
185192
for (_prio, name) in all_plan_files {
186193
// cc https://pagure.io/testcloud/pull-request/174
187194
cmd!(sh, "rm -vf /var/tmp/tmt/testcloud/images/disk.qcow2").run()?;

0 commit comments

Comments
 (0)