Skip to content

Commit c168e11

Browse files
committed
ci: fix RPM path handling and add QEMU boot test
Fix missing --package rpm specification in CI workflow and add QEMU boot testing to validate converted images. Changes: - build-rpm.yml: Export RPM path via GITHUB_OUTPUT for test step - Makefile: Pass CRYPTPILOT_FDE_RPM to test-convert.sh via --rpm flag - test-convert.sh: Add test_qemu_boot() function to verify images boot correctly using QEMU container (ghcr.io/qemus/qemu) - Tests for login prompt (success) or emergency shell (failure) - 2-minute timeout for boot completion - Full boot log output for debugging Signed-off-by: Kun Lai <laikun@linux.alibaba.com>
1 parent 76917cb commit c168e11

3 files changed

Lines changed: 206 additions & 69 deletions

File tree

.github/workflows/build-rpm.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,14 @@ jobs:
243243
merge-multiple: false
244244

245245
- name: Install RPM packages
246+
id: install-rpm
246247
run: |
248+
# Find the RPM path and export it
249+
RPM_PATH=$(ls ./rpm-packages/RPMS/*/cryptpilot-fde-[0-9]*.rpm | head -1)
250+
echo "Found RPM: ${RPM_PATH}"
251+
echo "cryptpilot_fde_rpm=${RPM_PATH}" >> $GITHUB_OUTPUT
247252
docker exec test-container bash -c "
248-
yum install -y /workspace/rpm-packages/RPMS/*/cryptpilot-fde-[0-9]*.rpm
253+
yum install -y ${RPM_PATH}
249254
cryptpilot-fde --version
250255
"
251256
@@ -258,7 +263,7 @@ jobs:
258263
- name: Run convert test
259264
run: |
260265
docker exec -w /workspace/repo test-container bash -c "
261-
make run-convert-test-case CASE=${{ matrix.case }} INPUT_IMAGE=/workspace/test-images/test-image.qcow2
266+
make run-convert-test-case CASE=${{ matrix.case }} INPUT_IMAGE=/workspace/test-images/test-image.qcow2 CRYPTPILOT_FDE_RPM=${{ steps.install-rpm.outputs.cryptpilot_fde_rpm }}
262267
"
263268
264269
- name: Cleanup

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,15 @@ install-test-depend:
158158
.PHONY: install-convert-test-depend
159159
install-convert-test-depend:
160160
yum install -y wget qemu-img cryptsetup lvm2 parted e2fsprogs util-linux libguestfs-tools-c
161+
which docker || { yum install -y docker ; }
161162

162163
.PHONY: run-convert-test
163164
run-convert-test: install-convert-test-depend
164-
bash tests/test-convert.sh --all
165+
bash tests/test-convert.sh --rpm $(CRYPTPILOT_FDE_RPM) --all $(if $(INPUT_IMAGE),--input $(INPUT_IMAGE),)
165166

166167
.PHONY: run-convert-test-case
167168
run-convert-test-case: install-convert-test-depend
168-
bash tests/test-convert.sh --case $(CASE)
169+
bash tests/test-convert.sh --rpm $(CRYPTPILOT_FDE_RPM) $(if $(CASE),--case $(CASE),--all) $(if $(INPUT_IMAGE),--input $(INPUT_IMAGE),)
169170

170171
.PHONE: shellcheck
171172
shellcheck:

0 commit comments

Comments
 (0)