1111
1212# --------------------------------------------------------------------
1313
14+ # This image is just the base image plus our updated bootc binary
15+ base_img := " localhost/bootc"
16+ # Derives from the above and adds nushell, cloudinit etc.
17+ integration_img := base_img + " -integration"
18+ # Has a synthetic upgrade
19+ integration_upgrade_img := integration_img + " -upgrade"
20+
1421# ostree: The default
1522# composefs-sealeduki-sdboot: A system with a sealed composefs using systemd-boot
1623variant := env (" BOOTC_variant" , " ostree" )
@@ -33,8 +40,8 @@ buildargs := "--build-arg=base=" + base + " --build-arg=variant=" + variant
3340# Note commonly you might want to override the base image via e.g.
3441# `just build --build-arg=base=quay.io/fedora/fedora-bootc:42`
3542build :
36- podman build {{ base_buildargs}} -t localhost / bootc -bin {{ buildargs}} .
37- ./ tests/ build-sealed {{ variant}} localhost / bootc -bin localhost / bootc
43+ podman build {{ base_buildargs}} -t {{ base_img }} -bin {{ buildargs}} .
44+ ./ tests/ build-sealed {{ variant}} {{ base_img }} -bin {{ base_img }}
3845
3946# Build a sealed image from current sources.
4047build-sealed :
@@ -66,8 +73,8 @@ package: _packagecontainer
6673
6774# This container image has additional testing content and utilities
6875build-integration-test-image : build
69- cd hack && podman build {{ base_buildargs}} -t localhost / bootc-integration -bin -f Containerfile .
70- ./ tests/ build-sealed {{ variant}} localhost / bootc-integration- bin localhost / bootc-integration
76+ cd hack && podman build {{ base_buildargs}} -t {{ integration_img }} -bin -f Containerfile .
77+ ./ tests/ build-sealed {{ variant}} {{ integration_img }} - bin {{ integration_img }}
7178 # Keep these in sync with what's used in hack/lbi
7279 podman pull -q --retry 5 --retry-delay 5 s quay.io/ curl/ curl:latest quay.io/ curl/ curl-base:latest registry.access.redhat.com/ ubi9/ podman:latest
7380
@@ -76,17 +83,17 @@ test-composefs:
7683 # These first two are currently a distinct test suite from tmt that directly
7784 # runs an integration test binary in the base image via bcvk
7885 just variant=composefs-sealeduki-sdboot build
79- cargo run --release -p tests-integration -- composefs-bcvk localhost / bootc
86+ cargo run --release -p tests-integration -- composefs-bcvk {{ base_img }}
8087 # We're trying to move more testing to tmt, so
8188 just variant=composefs-sealeduki-sdboot test-tmt readonly
8289
8390# Only used by ci.yml right now
8491build-install-test-image : build-integration-test-image
85- cd hack && podman build {{ base_buildargs}} -t localhost / bootc-integration -install -f Containerfile.drop-lbis
92+ cd hack && podman build {{ base_buildargs}} -t {{ integration_img }} -install -f Containerfile.drop-lbis
8693
8794# These tests accept the container image as input, and may spawn it.
8895run-container-external-tests :
89- ./ tests/ container/ run localhost / bootc
96+ ./ tests/ container/ run {{ base_img }}
9097
9198# We build the unit tests into a container image
9299build-units :
@@ -101,8 +108,18 @@ validate:
101108#
102109# To run an individual test, pass it as an argument like:
103110# `just test-tmt readonly`
104- test-tmt * ARGS : build-integration-test-image
105- cargo xtask run-tmt --env =BOOTC_variant={{ variant}} localhost/ bootc-integration {{ ARGS}}
111+ test-tmt * ARGS : build-integration-test-image _build-upgrade-image
112+ @ just test-tmt-nobuild {{ ARGS}}
113+
114+ # Generate a local synthetic upgrade
115+ _ build-upgrade-image :
116+ podman build -t {{ integration_upgrade_img}} -bin --from={{ integration_img}} -bin -f tmt/ tests/ Dockerfile.upgrade / usr/ share/ empty
117+ ./ tests/ build-sealed {{ variant}} {{ integration_upgrade_img}} -bin {{ integration_upgrade_img}}
118+
119+ # Assume the localhost/bootc-integration image is up to date, and just run tests.
120+ # Useful for iterating on tests quickly.
121+ test-tmt-nobuild * ARGS :
122+ cargo xtask run-tmt --env =BOOTC_variant={{ variant}} --env =BOOTC_upgrade_image={{ integration_upgrade_img}} {{ integration_img}} {{ ARGS}}
106123
107124# Cleanup all test VMs created by tmt tests
108125tmt-vm-cleanup :
@@ -112,7 +129,7 @@ tmt-vm-cleanup:
112129test-container : build-units build-integration-test-image
113130 podman run --rm --read -only localhost/ bootc-units / usr/ bin/ bootc-units
114131 # Pass these through for cross-checking
115- podman run --rm --env =BOOTC_variant={{ variant}} --env =BOOTC_base={{ base}} localhost / bootc-integration bootc-integration-tests container
132+ podman run --rm --env =BOOTC_variant={{ variant}} --env =BOOTC_base={{ base}} {{ integration_img }} bootc-integration-tests container
116133
117134# Remove all container images built (locally) via this Justfile, by matching a label
118135clean -local-images:
0 commit comments