Skip to content

Commit ae0a194

Browse files
committed
tmt: add test test-bootc-install-on-ostree on FCOS
Signed-off-by: Huijing Hei <[email protected]>
1 parent fa5ce7e commit ae0a194

File tree

4 files changed

+82
-1
lines changed

4 files changed

+82
-1
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
fail-fast: false
154154
matrix:
155155
test_os: [fedora-42, fedora-43, fedora-44, centos-9, centos-10]
156-
variant: [ostree, composefs-sealeduki-sdboot]
156+
variant: [ostree, composefs-sealeduki-sdboot, existing-ostree]
157157
exclude:
158158
# centos-9 UKI is experimental/broken (https://github.com/bootc-dev/bootc/issues/1812)
159159
- test_os: centos-9
@@ -205,6 +205,15 @@ jobs:
205205
just test-tmt
206206
fi
207207
208+
- name: "Test install on ostree"
209+
run: |
210+
if [ "${{ matrix.variant }}" = "existing-ostree" ] && [ "${{ matrix.test_os }}" = "fedora-43" ]; then
211+
podman image exists localhost/bootc-integration && \
212+
podman save -q localhost/bootc-integration:latest -o tmt/tests/examples/bootc.tar
213+
tmt run --context=existing-ostree plans -n /tmt/plans/test-install/plan-bootc-install-on-ostree --debug
214+
rm -f tmt/tests/examples/bootc.tar
215+
fi
216+
208217
- name: Archive TMT logs
209218
if: always()
210219
uses: actions/upload-artifact@v5

tmt/plans/tests-install.fmf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
discover:
2+
how: fmf
3+
provision:
4+
how: virtual
5+
hardware:
6+
boot:
7+
method: uefi
8+
image: fedora-coreos-next
9+
user: root
10+
memory: 4096
11+
disk: 20
12+
execute:
13+
how: tmt
14+
15+
/plan-bootc-install-on-ostree:
16+
summary: Execute bootc install on ostree tests
17+
discover:
18+
how: fmf
19+
test:
20+
- /tmt/tests/install/test-bootc-install-on-ostree
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# number: 50
2+
# tmt:
3+
# summary: Test bootc install on ostree env
4+
# duration: 30m
5+
# adjust:
6+
# - when: running_env != existing-ostree
7+
# enabled: false
8+
# because: this needs to start an ostree OS firstly
9+
#
10+
#!/bin/bash
11+
set -eux
12+
13+
echo "Testing bootc install on stree"
14+
15+
bootc_img=localhost/bootc:latest
16+
bootc_tar=examples/bootc.tar
17+
18+
if [ "$TMT_REBOOT_COUNT" -eq 0 ]; then
19+
echo "Running before first reboot"
20+
pwd
21+
ls -l
22+
[ -f "${bootc_tar}" ]
23+
podman load -q -i "${bootc_tar}"
24+
podman image exists ${bootc_img}
25+
# Run bootc install
26+
podman run --rm --privileged -v /dev:/dev -v /var/lib/containers:/var/lib/containers -v /:/target \
27+
--pid=host --security-opt label=type:unconfined_t \
28+
${bootc_img} \
29+
env BOOTC_BOOTLOADER_DEBUG=1 bootc install to-existing-root \
30+
--skip-fetch-check \
31+
--acknowledge-destructive \
32+
--root-ssh-authorized-keys /target/root/.ssh/authorized_keys.d/ignition \
33+
--karg=console=ttyS0,115200n8
34+
35+
image=$(bootc status --json |jq -r ".status.otherDeployments[0].image.image.image")
36+
[ ${image} == ${bootc_img} ]
37+
38+
tmt-reboot -c "systemctl reboot"
39+
elif [ "$TMT_REBOOT_COUNT" -eq 1 ]; then
40+
echo 'After the reboot'
41+
bootc status
42+
fi
43+
44+
echo "Run bootc install on existing ostree successfully"

tmt/tests/install.fmf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/test-bootc-install-on-ostree:
2+
summary: Test bootc install on ostree
3+
duration: 30m
4+
adjust:
5+
- when: running_env != existing-ostree
6+
enabled: false
7+
because: this needs to start an ostree OS firstly
8+
test: bash examples/test-on-ostree/test-install-on-ostree.sh

0 commit comments

Comments
 (0)