Skip to content

Commit 2307998

Browse files
committed
ci: Add container integration test for rpm and bootc
Generalize qemu-kvm-integration-tests.yml to run some "container-*" environments as well. For "classic rpm" OSes that does not give us too much beyond making sure that the container tests actually work (developers might use them locally, after all). 90% of the logic (setup, compatibility check, status updates, etc.) is the same, so it's not economic to duplicate all of that into a new workflow. Add a "centos-9-bootc" scenario, which is something truly new: This checks that a role works during a bootc container build, without any systemd, processes, or other runtime environment. tox-lsr added support for this in linux-system-roles/tox-lsr#188. See https://issues.redhat.com/browse/RHEL-85652
1 parent f2af39c commit 2307998

File tree

1 file changed

+44
-10
lines changed

1 file changed

+44
-10
lines changed

.github/workflows/qemu-kvm-integration-tests.yml

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: QEMU/KVM Integration tests
2+
name: Test
33
on: # yamllint disable-line rule:truthy
44
pull_request:
55
merge_group:
@@ -17,18 +17,34 @@ permissions:
1717
# This is required for the ability to create/update the Pull request status
1818
statuses: write
1919
jobs:
20-
qemu_kvm:
20+
scenario:
2121
runs-on: ubuntu-latest
2222

2323
strategy:
2424
fail-fast: false
2525
matrix:
2626
scenario:
27+
# QEMU
2728
- { image: "centos-9", env: "qemu-ansible-core-2.16" }
2829
- { image: "centos-10", env: "qemu-ansible-core-2.17" }
2930
# ansible/libdnf5 bug: https://issues.redhat.com/browse/RHELMISC-10110
3031
# - { image: "fedora-41", env: "qemu-ansible-core-2.17" }
3132
- { image: "fedora-42", env: "qemu-ansible-core-2.17" }
33+
34+
# container
35+
- { image: "centos-9", env: "container-ansible-core-2.16" }
36+
- { image: "centos-9-bootc", env: "container-ansible-core-2.16" }
37+
# broken on non-running dbus
38+
# - { image: "centos-10", env: "container-ansible-core-2.17" }
39+
- { image: "centos-10-bootc", env: "container-ansible-core-2.17" }
40+
- { image: "fedora-41", env: "container-ansible-core-2.17" }
41+
- { image: "fedora-42", env: "container-ansible-core-2.17" }
42+
- { image: "fedora-41-bootc", env: "container-ansible-core-2.17" }
43+
- { image: "fedora-42-bootc", env: "container-ansible-core-2.17" }
44+
45+
env:
46+
TOX_ARGS: "--skip-tags tests::infiniband,tests::nvme,tests::scsi"
47+
3248
steps:
3349
- name: Checkout repo
3450
uses: actions/checkout@v4
@@ -38,6 +54,7 @@ jobs:
3854
run: |
3955
set -euxo pipefail
4056
image="${{ matrix.scenario.image }}"
57+
image="${image%-bootc}"
4158
4259
# convert image to tag formats
4360
platform=
@@ -73,7 +90,7 @@ jobs:
7390
set -euxo pipefail
7491
python3 -m pip install --upgrade pip
7592
sudo apt update
76-
sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86
93+
sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86 podman
7794
pip3 install "git+https://github.com/linux-system-roles/[email protected]"
7895
7996
- name: Configure tox-lsr
@@ -82,14 +99,13 @@ jobs:
8299
curl -o ~/.config/linux-system-roles.json
83100
https://raw.githubusercontent.com/linux-system-roles/linux-system-roles.github.io/master/download/linux-system-roles.json
84101
85-
- name: Run qemu/kvm tox integration tests
86-
if: steps.check_platform.outputs.supported
87-
run: >-
88-
tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} --make-batch
89-
--log-level=debug --skip-tags tests::infiniband,tests::nvme,tests::scsi --
102+
- name: Run qemu integration tests
103+
if: steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu')
104+
run: |
105+
tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} --make-batch $TOX_ARGS --
90106
91-
- name: Test result summary
92-
if: steps.check_platform.outputs.supported && always()
107+
- name: Qemu result summary
108+
if: steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu') && always()
93109
run: |
94110
set -euo pipefail
95111
# some platforms may have setup/cleanup playbooks - need to find the
@@ -109,6 +125,24 @@ jobs:
109125
echo "$f"
110126
done < batch.report
111127
128+
- name: Run container tox integration tests
129+
if: steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'container')
130+
run: |
131+
set -euo pipefail
132+
# HACK: debug.py/profile.py setup is broken
133+
export LSR_CONTAINER_PROFILE=false
134+
export LSR_CONTAINER_PRETTY=false
135+
rc=0
136+
for t in tests/tests_*.yml; do
137+
if tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} $t > ${t}.log 2>&1; then
138+
echo "$(basename $t): pass"
139+
else
140+
echo "$(basename $t): FAIL"
141+
rc=1
142+
fi
143+
done
144+
exit $rc
145+
112146
- name: Upload test logs on failure
113147
if: failure()
114148
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)