Skip to content

Commit ece3c3a

Browse files
authored
test: add Kairos Fedora e2e boot validation (#765)
## Summary - Add a Kairos Fedora e2e harness that builds or reuses the produced OCI image, generates an installer ISO with AuroraBoot, installs through the Kairos WebUI over HTTP, then boots the installed disk under QEMU/KVM. - Verify the installed OS over SSH, including Fedora identity, Kairos active boot state, K3s node readiness, and failed systemd units. - Wire the image workflow to run the e2e check before pushing release images, add a `just e2e-kairos-fedora` entrypoint, and document local/devcontainer usage. ## Validation - [Build Kairos-Fedora / run 100](https://github.com/marinatedconcrete/config/actions/runs/27395814468) passed on commit `3ed000dc673d036f520f28dad4db88ddb3e91dd0`: built the OCI image, built an installer ISO from it, installed via the Kairos WebUI HTTP flow under QEMU/KVM, booted the installed disk, verified SSH access, Fedora identity, Kairos active boot state, K3s node readiness, and no failed systemd units. - [Semantic Pull Request / run 1380](https://github.com/marinatedconcrete/config/actions/runs/27395814476) passed. ## Notes The e2e harness is designed to run directly in the devcontainer or CI environment with `/dev/kvm` available. It avoids cidata mounting and performs the install through the HTTP installer flow so it better reflects a bare-metal install path while still verifying post-install SSH connectivity.
1 parent a62c490 commit ece3c3a

5 files changed

Lines changed: 518 additions & 5 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ FROM mcr.microsoft.com/devcontainers/python:3-3.14@sha256:882b17d068262c7af43001
33
RUN apt-get update \
44
&& apt-get upgrade -y \
55
&& apt-get install -y --no-install-recommends \
6+
curl \
67
libssh-dev \
8+
openssh-client \
9+
ovmf \
10+
qemu-system-x86 \
11+
qemu-utils \
712
shellcheck \
813
yq \
914
&& apt-get clean \

.github/workflows/image-kairos-fedora.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@ on: # yamllint disable-line rule:truthy
66
branches:
77
- main
88
paths:
9+
- .devcontainer/Dockerfile
910
- .github/workflows/image-kairos-fedora.yml
1011
- images/kairos-fedora/**
12+
- justfile
1113
tags:
1214
- kairos-fedora-*
1315
pull_request:
1416
branches:
1517
- main
1618
paths:
19+
- .devcontainer/Dockerfile
1720
- .github/workflows/image-kairos-fedora.yml
1821
- images/kairos-fedora/**
22+
- justfile
1923

2024
jobs:
2125
build-container:
22-
runs-on: ubuntu-latest
26+
runs-on: ubuntu-24.04
27+
timeout-minutes: 90
2328
permissions:
2429
contents: read
2530
packages: write
@@ -36,7 +41,7 @@ jobs:
3641
# Note: this must start with a number for the build to work correctly!
3742
- name: Compute Version Tag
3843
env:
39-
BRANCH: ${{ github.ref_type == 'tag' && github.ref_name || github.event_name != 'pull_request' && format('{0}.{1}.{2}', github.run_id, github.run_number, github.run_attempt) || format('{0}-pr', github.event.number) }}
44+
BRANCH: ${{ github.ref_type == 'tag' && github.ref_name || github.event_name == 'pull_request' && format('{0}-pr', github.event.number) || format('{0}.{1}.{2}', github.run_id, github.run_number, github.run_attempt) }}
4045
id: version_tag
4146
run: echo "tag=$BRANCH" | sed -e 's/kairos-fedora-//' >> "$GITHUB_OUTPUT"
4247
- name: Generate Metadata
@@ -52,5 +57,34 @@ jobs:
5257
context: images/kairos-fedora
5358
file: images/kairos-fedora/Containerfile
5459
labels: ${{ steps.metadata.outputs.labels }}
55-
push: ${{ github.ref_type == 'tag' }}
60+
load: true
61+
push: false
5662
tags: ghcr.io/${{ github.repository_owner }}/kairos-fedora:${{ steps.version_tag.outputs.tag }}
63+
- name: Install E2E Dependencies
64+
run: |
65+
sudo apt-get update
66+
sudo apt-get install --no-install-recommends --yes curl openssh-client ovmf qemu-system-x86 qemu-utils
67+
- name: Enable KVM Access
68+
run: |
69+
test -e /dev/kvm
70+
sudo chmod a+rw /dev/kvm
71+
test -r /dev/kvm
72+
test -w /dev/kvm
73+
ls -l /dev/kvm
74+
- name: Run Kairos Fedora E2E
75+
env:
76+
KAIROS_IMAGE: ghcr.io/${{ github.repository_owner }}/kairos-fedora:${{ steps.version_tag.outputs.tag }}
77+
run: bash images/kairos-fedora/e2e.sh
78+
- name: Upload E2E Logs
79+
if: always()
80+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
81+
with:
82+
name: kairos-fedora-e2e
83+
path: |
84+
build/e2e/kairos-fedora/install-cloud-config.yaml
85+
build/e2e/kairos-fedora/id_ed25519.pub
86+
build/e2e/kairos-fedora/logs
87+
if-no-files-found: ignore
88+
- name: Push Image
89+
if: github.ref_type == 'tag'
90+
run: docker push ghcr.io/${{ github.repository_owner }}/kairos-fedora:${{ steps.version_tag.outputs.tag }}

images/kairos-fedora/README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11
# Marinated Concrete's Custom Fedora-Based Kairos Image
22

3-
This utilizes the [Kairos Factory](https://kairos.io/docs/reference/kairos-factory/) to produce our very own custom
4-
image!
3+
This utilizes the [Kairos Factory](https://kairos.io/docs/reference/kairos-factory/) to produce our very own custom image.
4+
5+
## End-to-End Boot Test
6+
7+
Run the e2e test from the devcontainer:
8+
9+
```sh
10+
just e2e-kairos-fedora
11+
```
12+
13+
The devcontainer includes QEMU, OVMF, Docker, and SSH client tooling, so the test runs directly in the current environment. It requires `/dev/kvm` to be present and readable/writable by the container user.
14+
15+
The harness validates the same path a bare-metal install uses:
16+
17+
1. Build or reuse the Kairos Fedora OCI image.
18+
2. Generate an installer ISO from that OCI image with AuroraBoot.
19+
3. Boot the installer ISO in QEMU.
20+
4. Submit the install through the Kairos WebUI on port 8080.
21+
5. Power off, detach the ISO, boot from the installed disk, and verify the OS over SSH.
22+
23+
By default, `just e2e-kairos-fedora` builds `images/kairos-fedora/Containerfile` locally as `kairos-fedora:0.0.0-e2e`. Set `KAIROS_IMAGE` to test a specific image ref that already exists in Docker or can be pulled by AuroraBoot:
24+
25+
```sh
26+
KAIROS_IMAGE=ghcr.io/marinatedconcrete/kairos-fedora:0.8.1 just e2e-kairos-fedora
27+
```
28+
29+
Useful overrides:
30+
31+
- `KAIROS_IMAGE`: OCI image ref to convert into an installer ISO.
32+
- `KAIROS_ISO`: existing ISO path for debugging the boot/install path without regenerating media.
33+
- `E2E_WORKDIR`: artifact and log directory, default `build/e2e/kairos-fedora`.
34+
- `E2E_INSTALL_TIMEOUT`, `E2E_BOOT_TIMEOUT`, `E2E_K3S_TIMEOUT`: timeout overrides.
35+
36+
The CI workflow runs the same script after building the image into the local Docker daemon. On release tags, the workflow pushes the image only after the e2e test passes.

0 commit comments

Comments
 (0)