From 9a1c986744a07293b71db93b1c59aa096982f6d8 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 15:18:54 +0100 Subject: [PATCH] Exercise signed X11 installation from the desktop guest --- tests/combined-feed.py | 12 +++++++++--- tests/disk-root.py | 26 ++++++++++++++++++++------ tests/userland/desktop.sh | 3 +++ tests/x11/README.md | 4 ++++ tests/x11/graphics.sh | 16 +++++++++++++++- 5 files changed, 51 insertions(+), 10 deletions(-) diff --git a/tests/combined-feed.py b/tests/combined-feed.py index 0e05fe7..35bcbc7 100644 --- a/tests/combined-feed.py +++ b/tests/combined-feed.py @@ -76,8 +76,12 @@ def run(args): table.writerow(["name", "version", "sha256", "archive"]) table.writerows((name, *selected[name]) for name in names) repo, client = args.work / "repo", args.work / "client" + with (args.work / "publish.log").open("w") as log: + subprocess.run(["feed", "publish", args.keys, repo, args.arch, *[selected[n][2] for n in names]], + check=True, stdout=log, stderr=subprocess.STDOUT) + if args.publish_only: + return for label, command in [ - ("publish", ["feed", "publish", args.keys, repo, args.arch, *[selected[n][2] for n in names]]), ("install", ["feed", "install", args.keys, repo, args.arch, client, "--fakeroot", *(args.install or names)]), ("audit", [args.auditor, args.arch, client]), ]: @@ -93,6 +97,8 @@ if __name__ == "__main__": parser.add_argument(option, type=lambda x: Path(x).resolve()) parser.add_argument("sources", nargs="+", type=lambda x: Path(x).resolve(), help="artifact directory, individual .sha256 receipt, or signed feed's packages.tsv") - parser.add_argument("--install", metavar="NAME", action="append", - help="install this root and its dependencies; repeat for additional roots (default: every package)") + mode = parser.add_mutually_exclusive_group() + mode.add_argument("--install", metavar="NAME", action="append", + help="install this root and its dependencies; repeat for additional roots (default: every package)") + mode.add_argument("--publish-only", action="store_true", help="publish the signed repository for a separate clean install") run(parser.parse_args()) diff --git a/tests/disk-root.py b/tests/disk-root.py index 78947da..9d8d9d7 100644 --- a/tests/disk-root.py +++ b/tests/disk-root.py @@ -34,7 +34,8 @@ def prepare(args): raise ValueError(f"invalid mount point: {directory}") directory.mkdir(exist_ok=True) (root / "tmp").chmod(0o1777) - for dest in (".vinix-image-id", "userland-check.sh", "etc/inittab"): + launcher = "usr/libexec/vinix-version-check" if args.desktop_init else "etc/inittab" + for dest in (".vinix-image-id", "userland-check.sh", launcher): if os.path.lexists(root / dest): raise ValueError(f"fixture would overwrite /{dest}") (root / ".vinix-image-id").write_text(identity) @@ -44,12 +45,21 @@ def prepare(args): script.write(b'#!/bin/sh\nIFS= read -r volume_id {console} 2>&1'\n") - # Account for data, directory blocks, inode tables and free working space. - usage = int(subprocess.check_output(["du", "-sB1", root], text=True).split()[0]) - entries = sum(len(dirs) + len(files) for _, dirs, files in os.walk(root)) + 1 + command = f"exec /bin/sh /userland-check.sh >{console} 2>&1" + launch = root / launcher + if launch.parent.resolve() != launch.parent: + raise ValueError(f"fixture launcher parent is a symlink: /{launcher}") + launch.parent.mkdir(parents=True, exist_ok=True) + if args.desktop_init: + launch.write_text(f"#!/bin/sh\n{command}\n") + launch.chmod(0o755) + else: + launch.write_text(f"::sysinit:/bin/sh -c '{command}'\n") + # Account for the staged files and the files the guest will install. + trees = [root, args.space_for] if args.space_for else [root] + usage = sum(int(subprocess.check_output(["du", "-sB1", tree], text=True).split()[0]) for tree in trees) + entries = sum(1 + sum(len(dirs) + len(files) for _, dirs, files in os.walk(tree)) for tree in trees) mib = 1024**2 size = (usage * 5 // 4 + 64 * mib + mib - 1) // mib * mib with disk.open("xb") as output: @@ -89,6 +99,10 @@ def run(args): if __name__ == "__main__": parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("arch", choices=("x86_64", "aarch64")) + parser.add_argument("--desktop-init", action="store_true", + help="launch the fixture through the native desktop PID 1 hook") + parser.add_argument("--space-for", type=lambda path: Path(path).resolve(), + help="reserve bytes and inodes for a separate installed package tree") for arg in ("root", "fixture", "iso", "boot", "work"): parser.add_argument(arg, type=lambda path: Path(path).resolve()) run(parser.parse_args()) diff --git a/tests/userland/desktop.sh b/tests/userland/desktop.sh index 0f63276..5ecf64b 100644 --- a/tests/userland/desktop.sh +++ b/tests/userland/desktop.sh @@ -40,6 +40,9 @@ for attempt in $(seq 1 60); do echo "desktop watchdog PID $watchdog" fi echo "graphical session PID $session, registration PID $registration" + if [ -n "${VINIX_DESKTOP_NEXT_FIXTURE:-}" ]; then + exec /bin/sh "$VINIX_DESKTOP_NEXT_FIXTURE" + fi echo 'VPAC FIXTURE GUEST PASS' exit 0 fi diff --git a/tests/x11/README.md b/tests/x11/README.md index acc7712..0c61c23 100644 --- a/tests/x11/README.md +++ b/tests/x11/README.md @@ -49,6 +49,10 @@ The Mesa 24.2.8 recipe compiles Gallium once and uses one Meson installation to For those checks, install `vinix-release-x11` and `busybox-init` from the signed feed into a clean root and audit it. Build `egl.v` and `glx.v` against that SDK and place the executables at `/vinix-egl-check` and `/vinix-glx-check` in a disposable guest root. Boot `graphics.sh` using `tests/disk-root.py`. The fixture reads back the expected pixel from current Mesa's surfaceless EGL and again from an authenticated indirect GLX connection to `Xvfb-glx` using the legacy DRI directory. +For the on-demand release test, combine the signed desktop and X11 package lists with `tests/combined-feed.py --publish-only`. Pass the combined feed to `tools/desktop-root.py` to install the desktop metapackage and embed the signed feed. Add the native desktop programs and framebuffer probe as in `tests/desktop-guest.py`. Set `VINIX_DESKTOP_NEXT_FIXTURE` in the desktop fixture to the guest path of `graphics.sh` and set `VINIX_X11_INSTALL_FROM_PKG=1` in that script. With `tests/disk-root.py --desktop-init --space-for "$x11_sdk/root"`, the guest must reach graphical registration, resolve `x11` by exact name, install the signed X11 metapackage, verify the server and Mesa owners, and pass both rendered pixel checks. + +Both architectures passed the desktop PID 1 and framebuffer checks from a disposable ext2 image. Those runs used the five checksum-pinned native programs from the November 28 release. The x86_64 chained fixture also ran its second script after registration and verified the larger disk size. A separate test published a signed feed with `--publish-only`, then installed musl and netbase into a clean root using the pinned public key. See `foundation/native-desktop-disk-path-01`, `foundation/native-desktop-chained-fixture-01` and `foundation/combined-publish-only-01`, receipt SHA-256 `86c564cb9415859d2411343f74b8ad8926418c16bedb4a612aab85db46137ccd`, `cb2d6c6afbdf2733676080f49792aa11b10907d1778d2bc3d01ae3317874a7e0` and `afde40678739b96cf16db58803ef87447ae4499a9e70f3425814a244e12d6883`. The complete desktop and X11 transaction still needs both graphics feeds. + Set `VINIX_MESA_NATIVE_FILE` to a Meson native machine file whose `pkg_config_path` includes a build-host `wayland-scanner.pc`. The worker reused the source-built x86_64 Wayland scanner from an audited signed root. Meson found the native scanner through that file, found the target Wayland client in the SDK, and generated a protocol header. Mako and Intel CLC run in the build environment. See `xorg/mesa-host-tools-03/generator-check`, receipt SHA-256 `8df63367710d4ead9e968d30fe97eb3c63b45b4eba0f444447f5bf75b0cd4229`. The refreshed source plan includes the AArch64 GCC runtime release 2 and the split Mesa archives. The graphics dependency inventory found ready archives for 88 x86_64 and 71 AArch64 package names at their planned versions. AArch64 libxml2 had two different archives for 2.13.9-1. The graphics queue uses the archive already installed in the audited LLVM SDK, SHA-256 `b5cda4ef51da15ed533f54354aa54bdadf0b604fa3db5cfa1b903ed914206a5e`. See `xorg/mesa-dependency-pool-01` and `release-inputs/upstream-7f173671/order-02`, receipt SHA-256 `b5c322922dc200c50a7ac7d36fa9f07f5c09a699c1ca40dd7e13a6182bd01959` and `0432bbc6fff489421b88046086cd2de6f8cddc6242fd40605c2bbc70b2d0ff2b`. diff --git a/tests/x11/graphics.sh b/tests/x11/graphics.sh index 3ed0a8d..079694a 100644 --- a/tests/x11/graphics.sh +++ b/tests/x11/graphics.sh @@ -3,7 +3,7 @@ set -eu export PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/tmp export DISPLAY=:71 XAUTHORITY=/tmp/vinix-glx.Xauthority LIBGL_ALWAYS_SOFTWARE=1 server= -phase=egl +phase=identity finish() { status=$? if [ "$status" -ne 0 ]; then @@ -16,6 +16,20 @@ finish() { trap finish EXIT test "$(uname -o)" = Vinix +if [ "${VINIX_X11_INSTALL_FROM_PKG:-0}" = 1 ]; then + phase=package-install + test ! -e /usr/bin/Xvfb-glx + test "$(vpac o --quiet /usr/bin/pkg)" = vinix-pkg + test "$(pkg search --exact x11)" = x11 + pkg install x11 + vpac q -F validation local/vinix-release-x11 >/tmp/x11-validation + grep -Eq '^validation[[:space:]]+signature$' /tmp/x11-validation + test "$(vpac o --quiet /usr/bin/Xvfb-glx)" = xorg-server + test "$(vpac o --quiet /usr/lib/libgallium-24.2.8.so)" = mesa + echo 'Vinix installed the signed X11 packages' +fi + +phase=egl LIBGL_DRIVERS_PATH=/usr/lib/mesa24/dri /vinix-egl-check phase=glx-server -- 2.56.1