#!/bin/sh # License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree. # test.sh -- the tests of a release, in the order they cost. # # usage: test.sh [-q] # -q the quick part only: no full installation # # What is tested, and why this is enough (Konrad, 2026-11-08): # 1. mediacheck.sh the CDs carry the DVD's files, byte for byte # 2. install-simple.sh -S the one full installation: the DVD with the sources # 2b. install-simple.sh -U the second full installation: the GPT stick (BIOS path), with the # sources (patch 0018, 2026-11-09) # 3. install-simple.sh -B the smoke tests of the other media: they boot to the # disk menu, which offers the target and not the # medium itself (CD 1, the stick, BIOS and UEFI) # The stick under UEFI is smoke-tested on the VGA screen (vm-screendump.sh -U, read # with tesseract): its loader takes the serial port only on a key (eficons.c) and # the kernel's console is the framebuffer, so the serial line says nothing. # Not run here, only when sysinst, the loader or the cgd code changed: # install-cgd.sh (BIOS and UEFI). # # Every step writes build/logs/test--.log. Exit status: 0 if all # steps passed, 1 otherwise. The steps run one after the other, never in # parallel: the tests do not run beside a build. set -u TOP=${TOP:-$(cd "$(dirname "$0")/.." && pwd)} # Tests do not run beside a build (make test/cdtest hold the lock). "$TOP/tools/build-lock.sh" --check || exit 1 # the version of the release, as newvers.sh reads it VER=$(cat "$TOP/src/sys/conf/makronix-release") DAY=$(date +%Y-%m-%d) L=$TOP/build/logs QUICK=no [ "${1:-}" = -q ] && QUICK=yes IMG=$TOP/build/obj/releasedir/images USB=$IMG/Makronix-$VER-amd64-install.img USBBIOS=$IMG/Makronix-$VER-amd64-bios-install.img # The PIIX IDE controller of QEMU 11 loses interrupts under heavy writes and the # guest freezes (the DVD installation copies all packages to the target; hangs # 2026-11-07 and 2026-11-08, build/logs/hang-*). AHCI does not. VMSH_AHCI=yes export VMSH_AHCI failed= run() { name=$1; shift echo "== $name" "$@" > "$L/test-$name-$DAY.log" 2>&1 rc=$? grep -a -E '^(PASS|FAIL)' "$L/test-$name-$DAY.log" | sort | uniq -c | sort -rn | head -4 if [ $rc -ne 0 ]; then echo " FAILED (exit $rc): $L/test-$name-$DAY.log" failed="$failed $name" fi } run mediacheck "$TOP/tools/mediacheck.sh" run smoke-cd1-bios "$TOP/tools/install-simple.sh" -B -f bios run smoke-cd1-uefi "$TOP/tools/install-simple.sh" -B -f uefi run smoke-usb-bios "$TOP/tools/install-simple.sh" -B -f bios -U "$USB" run smoke-usbmbr-bios "$TOP/tools/install-simple.sh" -B -f bios -U "$USBBIOS" # The UEFI stick: OVMF boots the GPT stick and the screen shows sysinst's language # menu. Looked at the VGA screen (vm-screendump.sh -U), not at the serial line: # after efiboot the kernel's console is wscons on the framebuffer, so a serial log # ends at efiboot's last line (":-(" with the memory map before it) although the # boot goes on -- measured 2026-11-17 (the earlier note here took that for a hang). uefi_stick_boot() { shot=$L/usb-uefi-$DAY.ppm if ! "$TOP/tools/vm-screendump.sh" -f uefi -t 70 -U "$USB" -o "$shot"; then echo "FAIL: no screen dump of the stick in OVMF" return 1 fi txt=$(convert "$shot" png:- | tesseract stdin stdout 2>/dev/null) case $txt in *"Installation messages in English"*) echo "PASS: the GPT stick boots under UEFI (OVMF) to sysinst" ;; *) echo "FAIL: no sysinst menu on the screen of the UEFI stick ($shot)" return 1 ;; esac } run smoke-usb-uefi uefi_stick_boot [ $QUICK = yes ] || run install-dvd "$TOP/tools/install-simple.sh" -S # The GPT stick (the image a Mac boots) carries /source (patch 0018): one full # installation from it, through its BIOS path, checks that sysinst installs them. [ $QUICK = yes ] || run install-usb "$TOP/tools/install-simple.sh" -f bios -U "$USB" if [ -n "$failed" ]; then echo "FAILED:$failed" exit 1 fi echo "all steps passed"