Skip to content

ci(convert): Ubuntu convert-and-boot coverage - #168

Open
imlk0 wants to merge 5 commits into
masterfrom
convert-ubuntu-ci
Open

imlk0 wants to merge 5 commits into
masterfrom
convert-ubuntu-ci

Conversation

@imlk0

@imlk0 imlk0 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Ubuntu convert-and-boot CI coverage, stacked on #167 (the script-side Ubuntu support). Everything here is test infrastructure; no product code changes.

  • tests/test-convert.sh: --distro <alinux3|ubuntu> (alinux3 path byte-identical), a DEB package option for Ubuntu guests, Ubuntu image sourcing from the ghcr noble test image (or --input), and Ubuntu boot-success detection. The success marker is the getty login: prompt plus the Ubuntu <ver> LTS <host> ttyS<N> banner: the dracut initramfs prints "Welcome to Ubuntu" about 5 seconds into boot, before the FDE services run, so that string would be a premature-success marker.
  • Makefile: the convert-test target learns the ubuntu distro (image tag, DEB package, apt invocation with DEBIAN_FRONTEND=noninteractive, else console-setup's debconf postinst stalls the CI container).
  • build-deb.yml: new test-convert job following the build-rpm job's shape: a privileged ubuntu:24.04 runtime container (docker run -d --privileged + docker exec), the freshly built host DEB installed inside it so the reference-value check actually runs, the noble test image extracted from ghcr, diagnostic log on failure. The runner's /boot and /lib/modules are mounted read-only into the container: Ubuntu images ship no kernel, and cryptpilot-enhance's supermin needs one (the alinux legs get kernel-core incidentally from yum update). Matrix is four legs: (grub, enc, ram), (uki, enc, ram), (grub, noenc, disk-persist), (uki, noenc, disk-persist). The release job now gates on test-convert, mirroring build-rpm's release gate (its convert-and-boot legs already block package publishing).
  • build-test-image.yml: an ubuntu mode that produces the noble test image (stock Noble cloud image, resized to 10G with free space behind the last partition, dracut installed). Validated against the existing noble-dracut-20260518 artifact: that is its entire content. The direct mode is unchanged.

Test plan

  • bash -n + shellcheck clean; both workflows YAML-valid; make -n confirms the matrix-to-flag mapping (alinux path byte-identical to master).
  • A full local end-to-end run of the (grub, enc, ram) leg in the exact CI shape — privileged ubuntu:24.04 runtime container with the host DEB installed, noble image from ghcr, guest DEB 0.9.3 — passed: enhance + convert + reference-value + QEMU boot to login, "All tests passed!", exit 0.
  • Argument-validation and boot-grep match/no-match paths dry-run tested (including that initramfs-stage log prefixes do not match the success markers).
  • The four legs on real GitHub Actions runners (first run on this PR; TCG boot timeout is 1500 s, roughly 2x the locally measured full boot).
  • build-test-image ubuntu mode pushing to ghcr (recipe validated against the existing artifact; the workflow itself needs a manual dispatch).

@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 。

@ostest-bot

Copy link
Copy Markdown

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

@ostest-bot

Copy link
Copy Markdown

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

@imlk0
imlk0 changed the base branch from convert-ubuntu-guest to master October 30, 2026 10:23
@ostest-bot

Copy link
Copy Markdown

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

@ostest-bot

Copy link
Copy Markdown

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

imlk0 added 4 commits October 30, 2026 20:50
…rness

test-convert.sh gains a --distro flag (alinux3 default, ubuntu new) and a
--deb option for the guest package, with loud errors when the distro and
package type disagree. Ubuntu guests boot the ghcr noble test image,
extracted via docker create/cp like the CI workflows do and cached the
same way the alinux download is. Boot-success detection now also matches
the Ubuntu serial-console markers (the getty "login:" prompt and the
/etc/issue banner "Ubuntu <version> LTS <host> ttyS0" that serial-getty
prints once getty.target is up) alongside the alinux issue banner.
"Welcome to Ubuntu" is intentionally not a marker: the dracut initramfs
prints that banner on the serial console seconds into the boot, long
before the FDE services have run. Ubuntu boots get a 25-minute timeout
since their fuller userspace boots much slower under TCG than alinux,
and the QEMU boot container is force-removed after a failed attempt so
the built-in retry does not hit a name conflict with the asynchronously
removed --rm container.

Signed-off-by: Kun Lai <laikun@linux.alibaba.com>

Assisted-by: Claude Code:glm-5.3[1M]
Mirrors the build-rpm test-convert job shape: a privileged ubuntu:24.04
runtime container (docker run -d + docker exec, /dev and udev control
mounted in) runs the harness, the host DEB is installed inside it so
cryptpilot-fde-host show-reference-value really executes, and the noble
test image qcow2 is extracted from ghcr with docker create/cp/rmi.

The 4-leg matrix (grub/enc/ram, uki/enc/ram, grub/noenc/disk-persist,
uki/noenc/disk-persist, fail-fast off) is mapped into test-convert.sh
flags through the existing Makefile run-convert-test-case target, which
now takes DISTRO=ubuntu + CRYPTPILOT_FDE_DEB and picks the apt branch of
install-convert-test-depend when the runtime container is Debian-based
(the alinux path is unchanged). The apt branch sets
DEBIAN_FRONTEND=noninteractive like the other ubuntu jobs: the
cryptsetup-initramfs dependency chain pulls console-setup, whose debconf
postinst stalls in a container without a tty otherwise. The runtime
container also gets the runner's /boot and /lib/modules read-only: it
ships no kernel, but cryptpilot-enhance drives virt-customize on every
leg and supermin needs a kernel to build the libguestfs appliance (the
alinux legs get one incidentally from yum update). The release job's
needs are untouched.

Signed-off-by: Kun Lai <laikun@linux.alibaba.com>

Assisted-by: Claude Code:glm-5.3[1M]
workflow_dispatch gains a mode choice (direct default, ubuntu new). The
ubuntu mode builds the noble guest test image for the convert
integration tests: stock Ubuntu Noble cloud image, virtual size grown
to 10G with the space unallocated behind the last partition (a stock
~3.5G image cannot fit the converted layout), dracut preinstalled via
virt-customize, pushed to ghcr with the same labels as the direct mode.
The direct mode is unchanged apart from the url input becoming optional
(validated at run time instead of by the dispatch form).

Signed-off-by: Kun Lai <laikun@linux.alibaba.com>

Assisted-by: Claude Code:glm-5.3[1M]
build-rpm's release already waits for its convert-and-boot legs; align
the DEB release the same way so a broken Ubuntu conversion cannot
publish packages.

Assisted-by: Claude Code:glm-5.3
Signed-off-by: Kun Lai <laikun@linux.alibaba.com>
@imlk0
imlk0 force-pushed the convert-ubuntu-ci branch from c2ae71a to 277b1e0 Compare October 30, 2026 12:51
@ostest-bot

Copy link
Copy Markdown

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

@ostest-bot

Copy link
Copy Markdown

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

grub2-tools is the RPM package name and does not exist on apt: the grub
tools the UKI setup needs are in grub2-common, already in the base list.
The UKI reassembly and PE-header patch also need binutils and python3,
which the minimal Ubuntu runtime images do not ship. Found by the first
build-deb test-convert run of the uki legs.

Assisted-by: Claude Code:glm-5.3
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