Skip to content

ci(convert): add disk-persist regression coverage for #140 and #141 - #143

Open
imlk0 wants to merge 1 commit into
masterfrom
fix-fsck
Open

imlk0 wants to merge 1 commit into
masterfrom
fix-fsck

Conversation

@imlk0

@imlk0 imlk0 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

What & why

Adds CI regression coverage for #140 and #141 — the two disk-persist failure modes the existing 24-job test-convert matrix cannot see, because it uses the OTP key provider, which recreates the delta every boot and so never exercises real persistence or the dm-integrity AEAD path.

Changes

  • tests/test-convert.sh: new --delta-key <otp|stable>, --integrity <true|false>, --second-boot, --skip-enhance options; create_test_config emits a stable exec-key delta provider (same passphrase as rootfs) so the delta persists across boots; new test_qemu_boot_direct + test_qemu_boot_persist_second. The qemus entrypoint recreates a fresh throwaway overlay per boot and cannot reproduce a second-boot failure, so the new path boots the same persistent qcow2 overlay (relative backing filename so qemu resolves it inside the container) twice.
  • Makefile: run-convert-test-case passes through DELTA_KEY / INTEGRITY / SECOND_BOOT / SKIP_ENHANCE.
  • .github/workflows/build-rpm.yml: new test-convert-persist job — UKI, +4 jobs (2 distros × 2 scenarios: fsck-140, fsck-141). Zero changes to the existing 24-job matrix.

Verification (on unfixed v0.9.2)

Both new tests reproduce the reported failures:

scenario result
fsck-141 device-mapper: crypt: dm-6: INTEGRITY AEAD ERROR, sector 8 + 0: Failed to create dm-snapshot device → emergency mode
fsck-140 boot 1 → login prompt; boot 2 → 0: Failed to resize ext4 filesystem + resize2fs 1.46.0 + Please run 'e2fsck -f /dev/mapper/rootfs' first. → emergency mode

cargo fmt --check OK, shellcheck clean, YAML valid, +4 jobs confirmed via matrix parse.

Merge ordering

These regression tests are expected to fail on this branch until the fix for #140/#141 lands (the repro is encoded as the failing test — TDD red). Merge alongside that fix; the fix flips these two scenarios from red to green.

Refs: #140, #141.

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

The 24-job test-convert matrix uses the OTP key provider, which recreates
the delta every boot, so it never exercises real disk-persist persistence
or the dm-integrity AEAD path. As a result issue #140 (offline resize2fs
runs before fsck; surfaces on the SECOND boot of a persistent disk) and
#141 (disk-persist + integrity=true first-boot dm-snapshot creation fails:
only 4 KiB of the COW header is initialized while the persistent snapshot
reads a 16-sector/8 KiB chunk, so sector 8 fails the integrity AEAD check)
are both invisible to CI.

Add a dedicated test-convert-persist job (UKI; +4 jobs = 2 distros x 2
scenarios: fsck-140 / fsck-141) and extend test-convert.sh with
--delta-key <otp|stable>, --integrity <true|false>, --second-boot and
--skip-enhance, plus a direct-qemu two-boot path. The qemus entrypoint
recreates a fresh throwaway overlay per boot and cannot reproduce a
second-boot failure, so the new path boots the SAME persistent qcow2
overlay (relative backing filename so qemu resolves it inside the
container) twice. The stable exec key makes the delta persist across boots
so the second boot sees the first boot's updated s_mtime.

Both new tests reproduce the reported failures on unfixed v0.9.2
(INTEGRITY AEAD ERROR sector 8; resize2fs "Please run e2fsck -f") and are
expected to go green once the fix for #140/#141 lands; merge alongside
that fix.

Assisted-by: Claude:glm-5.2
Signed-off-by: Kun Lai <laikun@linux.alibaba.com>
@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants