Skip to content

Commit fc81533

Browse files
committed
ci: Add support for bootc end-to-end validation tests
These tests run the role during a bootc container image build, deploy the container into a QEMU VM, boot that, and validate the expected configuration there. They run in two different tox environments, and thus have to be run in two steps (preparation in buildah, validation in QEMU). The preparation is expected to output a qcow2 image in `tests/tmp/TESTNAME/qcow2/disk.qcow2`, i.e. the output structure of <https://github.com/osbuild/bootc-image-builder>. There are two possibilities: * Have separate bootc end-to-end tests. These are tagged with `tests::bootc-e2` and are skipped in the normal qemu-* scenarios. They run as part of the container-* ones. * Modify an existing test: These need to build a qcow2 image exactly *once* (via calling `bootc-buildah-qcow.sh`) and skip setup/cleanup and role invocations in validation mode, i.e. when `__bootc_validation` is true. In the container scenario, run the QEMU validation as a separate step in the workflow. See https://issues.redhat.com/browse/RHEL-88396
1 parent 70af520 commit fc81533

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
if: steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu')
140140
run: >-
141141
tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} --make-batch
142-
--log-level debug $TOX_ARGS
142+
--log-level debug $TOX_ARGS --skip-tags tests::bootc-e2e
143143
--lsr-report-errors-url DEFAULT --
144144
145145
- name: Qemu result summary
@@ -186,6 +186,28 @@ jobs:
186186
done
187187
exit $rc
188188
189+
- name: Run bootc validation tests in QEMU
190+
if: steps.check_platform.outputs.supported &&
191+
startsWith(matrix.scenario.env, 'container') &&
192+
endsWith(matrix.scenario.image, '-bootc')
193+
run: |
194+
set -euxo pipefail
195+
env=$(echo "${{ matrix.scenario.env }}" | sed 's/^container-/qemu-/')
196+
197+
for image_file in $(ls tests/tmp/*/qcow2/disk.qcow2 2>/dev/null); do
198+
test="tests/$(basename $(dirname $(dirname $image_file))).yml"
199+
if tox -e "$env" -- --image-file "$(pwd)/$image_file" \
200+
--log-level debug $TOX_ARGS \
201+
--lsr-report-errors-url DEFAULT \
202+
-e __bootc_validation=true \
203+
-- "$test" >out 2>&1; then
204+
mv out "${test}-PASS.log"
205+
else
206+
mv out "${test}-FAIL.log"
207+
exit 1
208+
fi
209+
done
210+
189211
- name: Upload test logs on failure
190212
if: failure()
191213
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)