From 8fa8a4aa90d888df853d3ebf72b579e1745994dd Mon Sep 17 00:00:00 2001 From: diviocity Date: Tue, 1 Dec 2026 09:38:02 +0100 Subject: [PATCH] Allow reproducing single-vCPU package guests --- tests/busybox/boot.v | 11 +++++++++-- tests/x11/README.md | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/busybox/boot.v b/tests/busybox/boot.v index c54114f..b4abfbe 100644 --- a/tests/busybox/boot.v +++ b/tests/busybox/boot.v @@ -1,6 +1,7 @@ // v run tests/busybox/boot.v INSTALLED_ROOT VINIX_ISO NEW_OUTPUT_DIRECTORY [MODE] // For ARM provide AARCH64_EFI_CODE and AARCH64_EFI_VARS, and CROSS_COMPILE for a cross GCC. // Set VINIX_QEMU_AMD64_DISK_BUS=nvme to use an NVMe disk for x86_64 fixtures. +// Set VINIX_QEMU_VCPUS=1 to reproduce a single-vCPU guest. module main import crypto.sha256 @@ -37,6 +38,12 @@ fn boot_image(root string, iso string, output string, mode string, fixture strin if memory <= 0 { return error('VINIX_QEMU_MEMORY_MIB must be a positive integer in MiB') } + vcpus := strconv.atoi(os.getenv_opt('VINIX_QEMU_VCPUS') or { '2' }) or { + return error('VINIX_QEMU_VCPUS must be a positive integer') + } + if vcpus <= 0 { + return error('VINIX_QEMU_VCPUS must be a positive integer') + } musl := mode in ['--musl', '--aarch64-musl'] machine := if arm { 'aarch64' } else { 'x86_64' } acceleration := os.getenv_opt('VINIX_QEMU_ACCEL') or { 'tcg' } @@ -155,8 +162,8 @@ fn boot_image(root string, iso string, output string, mode string, fixture strin emulator << ['-drive', 'if=ide,' + drive] } } - emulator << ['-accel', acceleration, '-cpu', cpu, '-m', memory.str(), '-smp', '2', '-nic', - 'none', '-display', 'none', '-monitor', 'none', '-serial', 'file:' + log, '-no-reboot'] + emulator << ['-accel', acceleration, '-cpu', cpu, '-m', memory.str(), '-smp', vcpus.str(), + '-nic', 'none', '-display', 'none', '-monitor', 'none', '-serial', 'file:' + log, '-no-reboot'] run(['timeout', '${deadline}s', ...emulator])! lines := os.read_lines(log)!.map(it.trim_space()) if disk != '' { diff --git a/tests/x11/README.md b/tests/x11/README.md index 34034a0..a0212a4 100644 --- a/tests/x11/README.md +++ b/tests/x11/README.md @@ -134,6 +134,8 @@ The worker built both instrumented probes against the existing signed SDKs and v The first AMD64 ordinary-user fixture compiled with the installed GCC headers and LTO tools and passed EGL. Its readiness timer stopped `xset q` while it queried Xvfb, after the client printed `Keyboard Control:`. The readiness check now allows eight attempts of up to 90 seconds each. Both signed BusyBox shells passed controls for a server that started after retries, persistent timeouts and a server that exited. See `foundation/release-mode-migration-amd64-ordinary-readiness-01` and `foundation/release-mode-migration-glx-readiness-test-01`, receipt SHA-256 `7fc6d9315a94af6cc22611ee72c352c78a6a9df156744023d856cd982897719a` and `212f493acea367d0dad472b89508e4f3c273b4e93679db42300afee9b56534d2`. +The earlier passing AMD64 on-demand X11 fixture used KVM with one virtual CPU. Set `VINIX_QEMU_VCPUS=1` with `VINIX_QEMU_ACCEL=kvm` to reproduce that CPU configuration. The fixture helper defaults to two virtual CPUs. The worker compiled it and verified that it rejects zero, negative, fractional and nonnumeric CPU counts before creating a guest directory. See `foundation/release-mode-migration-vcpu-boot-tool-01`, receipt SHA-256 `d62bec28ce09f8c846c697ac29758a9c7ebd0779732f3192b53c460e362ae745`. + The migration fixture streams the package transaction to serial and keeps a copy for its hook-error check. The worker ran the fixture's logging block with the signed BusyBox shell and tee applet for each target. It observed both output streams before releasing a held package command, verified that tee preserved a failed package command's exit status, and checked that a reported hook failure stopped the fixture. See `foundation/release-mode-migration-stream-fixture-01`, receipt SHA-256 `c5aecd55f7659f68abf295bad3c8a7b86920fc2d884321e344d422433f33faf5`. The 2 GiB AMD64 migration guest reached the 5,400-second QEMU deadline during the GCC update. The worker read the disposable snapshot after QEMU exited. The installed binutils 2.43.1-5 and FreeGLUT 3.4.0-2 records showed PGP validation. The GCC 14.2.0-3 directory existed, but its installed record was absent and the permission migration was unverified. See `foundation/release-mode-migration-amd64-upgrade-terminal-01`, receipt SHA-256 `c66ab9af9e3c0305ba3b03fe2e6add7833da485e9b4cc8b47793dde8bf935a25`. -- 2.56.1