Commit Graph

5 Commits

Author SHA1 Message Date
Alberto Faria 7b026358b9 tests/env.sh: Expose TEST_ID variable to tests
Its value is a random identifier unique to the current run of the
current test.

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-07-11 15:31:27 +01:00
Alberto Faria a9118ee63c Add support for running bootc bootable containers
We attempt to detect if a container image is bootable. We can't easily
retrieve the image's labels, so we check if /usr/lib/bootc/install
exists and is a directory. If so, it is a bootable container. If it is a
bootable container but we're not running under Podman, we fail with an
error.

Once our container's entrypoint starts running, a background process on
the host (outside the container) queries Podman for the image's name and
ID, which the OCI runtime does not get but bootc-install needs. It then
saves the container image as an OCI archive.

It then runs the original container to generate the VM image. We do this
using krun [1] so that elevated privileges aren't necessary. Our
entrypoint blocks until this is done, and all subsequent logic remains
the same.

We could potentially avoid the OCI archive creation step by mounting the
host's container storage into the container running under krun. This
isn't trivial to achieve due to SELinux label and context mismatches
between the host and the krun environment, so we leave this optimization
for a future date.

Closes #26.

[1] https://github.com/containers/crun/blob/main/krun.1.md

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-07-11 15:31:11 +01:00
Alberto Faria 55756dfa7f tests/t/publish.sh: Retry curl a few times
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-04-28 12:36:24 +01:00
Alberto Faria 9fbf17928e Switch to Fedora 40 everywhere
Containerdisks now set their entrypoint to "no-entrypoint", so we can
drop the empty "" argument to podman-run and equivalents in most cases.

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-04-25 01:10:54 +01:00
Alberto Faria bc246172f6 tests: Add a test for --publish
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-04-15 23:21:43 +01:00