11---
2- name : QEMU/KVM Integration tests
2+ name : Test
33on : # 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
1919jobs :
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
3854 run : |
3955 set -euxo pipefail
4056 image="${{ matrix.scenario.image }}"
57+ image="${image%-bootc}"
4158
4259 # convert image to tag formats
4360 platform=
5168 supported=true
5269 fi
5370
71+ # bootc build support (in buildah) has a separate flag
72+ if [ "${{ matrix.scenario.image }}" != "$image" ]; then
73+ if ! yq -e '.galaxy_info.galaxy_tags[] | select(. == "containerbuild")' meta/main.yml; then
74+ supported=
75+ fi
76+ else
77+ # roles need to opt into support for running in a system container
78+ env="${{ matrix.scenario.env }}"
79+ if [ "${env#container}" != "$env" ] &&
80+ ! yq -e '.galaxy_info.galaxy_tags[] | select(. == "container")' meta/main.yml; then
81+ supported=
82+ fi
83+ fi
84+
5485 echo "supported=$supported" >> "$GITHUB_OUTPUT"
5586
5687 - name : Set up /dev/kvm
@@ -74,22 +105,22 @@ jobs:
74105 python3 -m pip install --upgrade pip
75106 sudo apt update
76107 sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86
77- pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.6 .0"
108+ pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.8 .0"
78109
79110 - name : Configure tox-lsr
80111 if : steps.check_platform.outputs.supported
81112 run : >-
82113 curl -o ~/.config/linux-system-roles.json
83114 https://raw.githubusercontent.com/linux-system-roles/linux-system-roles.github.io/master/download/linux-system-roles.json
84115
85- - name : Run qemu/kvm tox integration tests
86- if : steps.check_platform.outputs.supported
116+ - name : Run qemu integration tests
117+ if : steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu')
87118 run : >-
88119 tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} --make-batch
89120 --log-level=debug --skip-tags tests::infiniband,tests::nvme,tests::scsi --
90121
91- - name : Test result summary
92- if : steps.check_platform.outputs.supported && always()
122+ - name : Qemu result summary
123+ if : steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu') && always()
93124 run : |
94125 set -euo pipefail
95126 # some platforms may have setup/cleanup playbooks - need to find the
@@ -109,6 +140,24 @@ jobs:
109140 echo "$f"
110141 done < batch.report
111142
143+ - name : Run container tox integration tests
144+ if : steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'container')
145+ run : |
146+ set -euo pipefail
147+ # HACK: debug.py/profile.py setup is broken
148+ export LSR_CONTAINER_PROFILE=false
149+ export LSR_CONTAINER_PRETTY=false
150+ rc=0
151+ for t in tests/tests_*.yml; do
152+ if tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} $t > ${t}.log 2>&1; then
153+ echo "PASS: $(basename $t)"
154+ else
155+ echo "FAIL: $(basename $t)"
156+ rc=1
157+ fi
158+ done
159+ exit $rc
160+
112161 - name : Upload test logs on failure
113162 if : failure()
114163 uses : actions/upload-artifact@v4
@@ -127,7 +176,7 @@ jobs:
127176 run : |
128177 set -euo pipefail
129178 for f in tests/*.log; do
130- if FAIL=$(grep -B100 -A30 "fatal:" "$f"); then
179+ if FAIL=$(grep -E - B100 -A30 "fatal:|An exception occurred " "$f"); then
131180 echo "::group::$(basename $f)"
132181 echo "$FAIL"
133182 echo "::endgroup::"
@@ -139,6 +188,6 @@ jobs:
139188 uses : myrotvorets/set-commit-status-action@master
140189 with :
141190 status : success
142- context : " ${{ github.workflow }} / qemu_kvm (${{ matrix.scenario.image }}, ${{ matrix.scenario.env }}) (pull_request)"
191+ context : " ${{ github.workflow }} / scenario (${{ matrix.scenario.image }}, ${{ matrix.scenario.env }}) (pull_request)"
143192 description : The role does not support this platform. Skipping.
144193 targetUrl : " "
0 commit comments