Skip to content

Commit 4f637b8

Browse files
committed
ci: Add support for bootc end-to-end validation tests
NOTE: This also requires upgrading to tox-lsr 3.10.0, and some hacks to workaround a podman issue in ubuntu. 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 Signed-off-by: Rich Megginson <[email protected]>
1 parent 458dd09 commit 4f637b8

File tree

6 files changed

+51
-6
lines changed

6 files changed

+51
-6
lines changed

.codespell_ignores

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
passt

.github/workflows/ansible-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install tox, tox-lsr
3333
run: |
3434
set -euxo pipefail
35-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.9.0"
35+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.10.0"
3636
3737
- name: Convert role to collection format
3838
id: collection

.github/workflows/ansible-managed-var-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install tox, tox-lsr
3131
run: |
3232
set -euxo pipefail
33-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.9.0"
33+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.10.0"
3434
3535
- name: Run ansible-plugin-scan
3636
run: |

.github/workflows/ansible-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install tox, tox-lsr
3434
run: |
3535
set -euxo pipefail
36-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.9.0"
36+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.10.0"
3737
3838
- name: Convert role to collection format
3939
run: |

.github/workflows/python-unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
tox=tox
6666
virtualenv=virtualenv
6767
fi
68-
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@3.9.0"
68+
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@3.10.0"
6969
# If you have additional OS dependency packages e.g. libcairo2-dev
7070
# then put them in .github/config/ubuntu-requirements.txt, one
7171
# package per line.

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

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,29 @@ jobs:
105105
python3 -m pip install --upgrade pip
106106
sudo apt update
107107
sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86
108-
pip3 install "git+https://github.com/linux-system-roles/[email protected]"
108+
pip3 install "git+https://github.com/linux-system-roles/[email protected]"
109+
110+
# HACK: Drop this when moving this workflow to 26.04 LTS
111+
- name: Update podman to 5.x for compatibility with bootc-image-builder's podman 5
112+
if: steps.check_platform.outputs.supported && endsWith(matrix.scenario.image, '-bootc')
113+
run: |
114+
sed 's/noble/plucky/g' /etc/apt/sources.list.d/ubuntu.sources | sudo tee /etc/apt/sources.list.d/plucky.sources >/dev/null
115+
cat <<EOF | sudo tee /etc/apt/preferences.d/podman.pref >/dev/null
116+
Package: podman buildah golang-github-containers-common crun libgpgme11t64 libgpg-error0 golang-github-containers-image catatonit conmon containers-storage
117+
Pin: release n=plucky
118+
Pin-Priority: 991
119+
120+
Package: libsubid4 netavark passt aardvark-dns containernetworking-plugins libslirp0 slirp4netns
121+
Pin: release n=plucky
122+
Pin-Priority: 991
123+
124+
Package: *
125+
Pin: release n=plucky
126+
Pin-Priority: 400
127+
EOF
128+
129+
sudo apt update
130+
sudo apt install -y podman crun conmon containers-storage
109131
110132
- name: Configure tox-lsr
111133
if: steps.check_platform.outputs.supported
@@ -117,7 +139,7 @@ jobs:
117139
if: steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu')
118140
run: >-
119141
tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} --make-batch
120-
--log-level debug --skip-tags tests::infiniband,tests::nvme,tests::scsi
142+
--log-level debug $TOX_ARGS --skip-tags tests::bootc-e2e
121143
--lsr-report-errors-url DEFAULT --
122144
123145
- name: Qemu result summary
@@ -164,6 +186,28 @@ jobs:
164186
done
165187
exit $rc
166188
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+
167211
- name: Upload test logs on failure
168212
if: failure()
169213
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)