mirror of
https://github.com/theupriser/steamify-cachyos-dev.git
synced 2026-10-05 12:45:56 +02:00
feat: vmtest.sh runs the plain-PC install check (generic) for every loader; vmprogress.sh knows the new jobs
This commit is contained in:
1 parent
90fe42da5f
commit
b2fc992745
3 files changed
+25
-17
No files matched your search
@@ -144,6 +144,6 @@ fails="$(grep -c '^FAIL' "$log")"
|
|||||||
if [[ $rc -ne 0 && $fails -eq 0 ]]; then
|
if [[ $rc -ne 0 && $fails -eq 0 ]]; then
|
||||||
echo "FAIL $loader aborted (exit $rc): $(grep -v '^$' "$log" | tail -n 1)" | tee -a "$log"; fails=1
|
echo "FAIL $loader aborted (exit $rc): $(grep -v '^$' "$log" | tail -n 1)" | tee -a "$log"; fails=1
|
||||||
fi
|
fi
|
||||||
echo; echo "== $loader: $(grep -c '^PASS' "$log") passed, $fails failed (log: $log)"
|
echo; echo "== $loader$suffix: $(grep -c '^PASS' "$log") passed, $fails failed (log: $log)"
|
||||||
grep '^FAIL' "$log"
|
grep '^FAIL' "$log"
|
||||||
exit "$fails"
|
exit "$fails"
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Progress of test jobs, one line per change (for a monitor; see the progress-report skill).
|
# Progress of test jobs, one line per change (for a monitor; see the progress-report skill).
|
||||||
# scripts/vmprogress.sh [--once] [job...] jobs: limine systemd-boot grub cli menu hw installer toggles (default all)
|
# scripts/vmprogress.sh [--once] [job...] jobs: limine systemd-boot grub limine-generic systemd-boot-generic grub-generic cli menu hw installer toggles (default all)
|
||||||
# Per job (only a new step, a finished job or a FAIL counts as a change): state (install NN% <stage> / <test step> / done / -), checks passed/expected, failed.
|
# Per job (only a new step, a finished job or a FAIL counts as a change): state (install NN% <stage> / <test step> / done / -), checks passed/expected, failed.
|
||||||
# Line: "HH:MM total P/E F failed ;; job | state | P/E | F failed ;; ...". Prints nothing while nothing
|
# Line: "HH:MM total P/E F failed ;; job | state | P/E | F failed ;; ...". Prints nothing while nothing
|
||||||
# changes (checked every 30 s), "ALLDONE" and exits once every started job has its summary line.
|
# changes (checked every 30 s), "ALLDONE" and exits once every started job has its summary line.
|
||||||
# Expected counts: the last complete run of each (AGENTS.md "State"); update them when checks are added.
|
# Expected counts: the last complete run of each (AGENTS.md "State"); update them when checks are added.
|
||||||
set -uo pipefail
|
set -uo pipefail
|
||||||
declare -A expect=([limine]=43 [systemd-boot]=42 [grub]=42 [cli]=55 [menu]=36 [hw]=77 [installer]=4 [toggles]=42)
|
declare -A expect=([limine]=43 [systemd-boot]=42 [grub]=42 [cli]=55 [menu]=36 [hw]=77 [installer]=4 [toggles]=42 [limine-generic]=25 [systemd-boot-generic]=25 [grub-generic]=25)
|
||||||
once=false; jobs=()
|
once=false; jobs=()
|
||||||
for a in "$@"; do [[ "$a" == --once ]] && once=true || jobs+=("$a"); done
|
for a in "$@"; do [[ "$a" == --once ]] && once=true || jobs+=("$a"); done
|
||||||
[[ ${#jobs[@]} -gt 0 ]] || jobs=(limine systemd-boot grub cli menu hw installer toggles)
|
[[ ${#jobs[@]} -gt 0 ]] || jobs=(limine systemd-boot grub limine-generic systemd-boot-generic grub-generic cli menu hw installer toggles)
|
||||||
vms="$HOME/vms"
|
vms="$HOME/vms"
|
||||||
|
|
||||||
status() { # status <job>: "state|pass|fail|finished(0/1)|started(0/1)"
|
status() { # status <job>: "state|pass|fail|finished(0/1)|started(0/1)"
|
||||||
local j="$1" log dir
|
local j="$1" log dir
|
||||||
case "$j" in limine|systemd-boot|grub) log="$vms/bl-$j.test.log" dir="$vms/bl-$j" ;; *) log="$vms/run-$j.log" dir="$vms/run-$j" ;; esac
|
case "$j" in limine|systemd-boot|grub|limine-generic|systemd-boot-generic|grub-generic) log="$vms/bl-$j.test.log" dir="$vms/bl-$j" ;; *) log="$vms/run-$j.log" dir="$vms/run-$j" ;; esac
|
||||||
[[ -f "$log" ]] || { echo "-|0|0|0|0"; return; }
|
[[ -f "$log" ]] || { echo "-|0|0|0|0"; return; }
|
||||||
local p f st run
|
local p f st run
|
||||||
# The logs are appended to: only the latest run counts (from its "===== vm..." header on).
|
# The logs are appended to: only the latest run counts (from its "===== vm..." header on).
|
||||||
|
|||||||
+20
-12
@@ -4,6 +4,8 @@
|
|||||||
# scripts/vmtest.sh [--install] [--window] [--screen] [boot | <loader>... | <suite>...]
|
# scripts/vmtest.sh [--install] [--window] [--screen] [boot | <loader>... | <suite>...]
|
||||||
# no argument everything: boot (all advertised loaders) and all suites
|
# no argument everything: boot (all advertised loaders) and all suites
|
||||||
# boot the boot loader test (limine, systemd-boot, grub), or name loaders
|
# boot the boot loader test (limine, systemd-boot, grub), or name loaders
|
||||||
|
# generic the plain-PC install check for every loader (vmbootloadertest.sh --quick --generic: a PC that is not a
|
||||||
|
# Steam Machine must get no Steam Machine items and no DKMS modules); part of the default run
|
||||||
# <suite> cli, menu, hw, installer, toggles (folders in share/vmtest/)
|
# <suite> cli, menu, hw, installer, toggles (folders in share/vmtest/)
|
||||||
# --install install the boot loader VMs first from the newest Steamify ISO (asks before replacing a disk)
|
# --install install the boot loader VMs first from the newest Steamify ISO (asks before replacing a disk)
|
||||||
# --window show the VMs' windows (default: headless; one shared Konsole follows ~/vms/test.log)
|
# --window show the VMs' windows (default: headless; one shared Konsole follows ~/vms/test.log)
|
||||||
@@ -18,13 +20,14 @@ here="$(cd "$(dirname "$0")" && pwd)"
|
|||||||
repo="$(cd "$here/.." && pwd)"
|
repo="$(cd "$here/.." && pwd)"
|
||||||
iso_repo="$repo/../steamify-cachyos-live-iso"
|
iso_repo="$repo/../steamify-cachyos-live-iso"
|
||||||
args=("$@")
|
args=("$@")
|
||||||
install=""; window=""; screen=false; loaders=(); suites=(); want_boot=false
|
install=""; window=""; screen=false; loaders=(); suites=(); want_boot=false; want_generic=false
|
||||||
for a in "$@"; do
|
for a in "$@"; do
|
||||||
case "$a" in
|
case "$a" in
|
||||||
--install) install=--install ;;
|
--install) install=--install ;;
|
||||||
--window) window=--window ;;
|
--window) window=--window ;;
|
||||||
--screen) screen=true ;;
|
--screen) screen=true ;;
|
||||||
boot) want_boot=true ;;
|
boot) want_boot=true ;;
|
||||||
|
generic) want_generic=true ;;
|
||||||
limine|systemd-boot|grub) loaders+=("$a"); want_boot=true ;;
|
limine|systemd-boot|grub) loaders+=("$a"); want_boot=true ;;
|
||||||
*) [[ -d "$repo/share/vmtest/$a" ]] && suites+=("$a") || { echo "Unknown argument: $a" >&2; exit 2; } ;;
|
*) [[ -d "$repo/share/vmtest/$a" ]] && suites+=("$a") || { echo "Unknown argument: $a" >&2; exit 2; } ;;
|
||||||
esac
|
esac
|
||||||
@@ -37,14 +40,16 @@ if $screen; then
|
|||||||
echo "Running in the screen session vmtest: screen -r vmtest (Ctrl-a d to leave it running); the summary lands in ~/vms/last-test.txt"
|
echo "Running in the screen session vmtest: screen -r vmtest (Ctrl-a d to leave it running); the summary lands in ~/vms/last-test.txt"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [[ ${#loaders[@]} -eq 0 && ${#suites[@]} -eq 0 ]] && ! $want_boot; then
|
if [[ ${#loaders[@]} -eq 0 && ${#suites[@]} -eq 0 ]] && ! $want_boot && ! $want_generic; then
|
||||||
want_boot=true
|
want_boot=true; want_generic=true
|
||||||
for d in cli menu hw installer toggles; do [[ -d "$repo/share/vmtest/$d" ]] && suites+=("$d"); done
|
for d in cli menu hw installer toggles; do [[ -d "$repo/share/vmtest/$d" ]] && suites+=("$d"); done
|
||||||
fi
|
fi
|
||||||
# What the ISO advertises: the boot loaders calamares-online.sh keeps.
|
# What the ISO advertises: the boot loaders calamares-online.sh keeps.
|
||||||
advertised="$(sed -n 's/.*"bootloader:\([^"]*\)".*/\1/p' "$iso_repo/archiso/airootfs/usr/local/bin/calamares-online.sh" 2>/dev/null | head -n 1)"
|
advertised="$(sed -n 's/.*"bootloader:\([^"]*\)".*/\1/p' "$iso_repo/archiso/airootfs/usr/local/bin/calamares-online.sh" 2>/dev/null | head -n 1)"
|
||||||
[[ -n "$advertised" ]] || { echo "Can't read the advertised boot loaders from $iso_repo (calamares-online.sh)" >&2; exit 2; }
|
[[ -n "$advertised" ]] || { echo "Can't read the advertised boot loaders from $iso_repo (calamares-online.sh)" >&2; exit 2; }
|
||||||
$want_boot && [[ ${#loaders[@]} -eq 0 ]] && read -r -a loaders <<< "$advertised"
|
$want_boot && [[ ${#loaders[@]} -eq 0 ]] && read -r -a loaders <<< "$advertised"
|
||||||
|
gloaders=() # the plain-PC install check: the same loaders as the boot loader test, or all advertised ones
|
||||||
|
if $want_generic; then if [[ ${#loaders[@]} -gt 0 ]]; then gloaders=("${loaders[@]}"); else read -r -a gloaders <<< "$advertised"; fi; fi
|
||||||
tested="limine systemd-boot grub" # the loaders vmbootloadertest.sh has a way to boot the other kernel for
|
tested="limine systemd-boot grub" # the loaders vmbootloadertest.sh has a way to boot the other kernel for
|
||||||
summary="$HOME/vms/last-test.txt"
|
summary="$HOME/vms/last-test.txt"
|
||||||
maxp="${MAX_PARALLEL:-3}" # VMs at once (4 GB RAM each in the suites, see vmsuite.sh); 5 ran fine on a 9800X3D with 64 GB
|
maxp="${MAX_PARALLEL:-3}" # VMs at once (4 GB RAM each in the suites, see vmsuite.sh); 5 ran fine on a 9800X3D with 64 GB
|
||||||
@@ -53,11 +58,14 @@ jobs_list=()
|
|||||||
for s in toggles hw cli menu installer; do [[ " ${suites[*]} " == *" $s "* ]] && jobs_list+=("suite:$s"); done
|
for s in toggles hw cli menu installer; do [[ " ${suites[*]} " == *" $s "* ]] && jobs_list+=("suite:$s"); done
|
||||||
for s in "${suites[@]}"; do [[ " toggles hw cli menu installer " == *" $s "* ]] || jobs_list+=("suite:$s"); done
|
for s in "${suites[@]}"; do [[ " toggles hw cli menu installer " == *" $s "* ]] || jobs_list+=("suite:$s"); done
|
||||||
for l in "${loaders[@]}"; do jobs_list+=("loader:$l"); done
|
for l in "${loaders[@]}"; do jobs_list+=("loader:$l"); done
|
||||||
run_job() { # run_job <kind:name>: output in /tmp/vmtest-<name>.out, exit status in /tmp/vmtest-<name>.rc
|
for l in "${gloaders[@]}"; do jobs_list+=("generic:$l"); done
|
||||||
local kind="${1%%:*}" name="${1#*:}"
|
jobtag() { [[ "${1%%:*}" == generic ]] && echo "${1#*:}-generic" || echo "${1#*:}"; } # files and names of a job
|
||||||
if [[ "$kind" == loader ]]; then bash "$here/vmbootloadertest.sh" "$name" $install $window > "/tmp/vmtest-$name.out" 2>&1
|
run_job() { # run_job <kind:name>: output in /tmp/vmtest-<tag>.out, exit status in /tmp/vmtest-<tag>.rc
|
||||||
else bash "$here/vmsuite.sh" "$name" $window > "/tmp/vmtest-$name.out" 2>&1; fi
|
local kind="${1%%:*}" name="${1#*:}" tag; tag="$(jobtag "$1")"
|
||||||
echo $? > "/tmp/vmtest-$name.rc"
|
if [[ "$kind" == loader ]]; then bash "$here/vmbootloadertest.sh" "$name" $install $window > "/tmp/vmtest-$tag.out" 2>&1
|
||||||
|
elif [[ "$kind" == generic ]]; then bash "$here/vmbootloadertest.sh" "$name" $install --quick --generic $window > "/tmp/vmtest-$tag.out" 2>&1
|
||||||
|
else bash "$here/vmsuite.sh" "$name" $window > "/tmp/vmtest-$tag.out" 2>&1; fi
|
||||||
|
echo $? > "/tmp/vmtest-$tag.rc"
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
echo "vmtest.sh $(date '+%F %T') branch $(git -C "$repo" branch --show-current) $(git -C "$repo" rev-parse --short HEAD)"
|
echo "vmtest.sh $(date '+%F %T') branch $(git -C "$repo" branch --show-current) $(git -C "$repo" rev-parse --short HEAD)"
|
||||||
@@ -73,12 +81,12 @@ for job in "${jobs_list[@]}"; do
|
|||||||
done
|
done
|
||||||
wait
|
wait
|
||||||
for job in "${jobs_list[@]}"; do
|
for job in "${jobs_list[@]}"; do
|
||||||
name="${job#*:}"
|
tag="$(jobtag "$job")"
|
||||||
sed -n '/^== /,$p' "/tmp/vmtest-$name.out"
|
sed -n '/^== /,$p' "/tmp/vmtest-$tag.out"
|
||||||
total=$((total + $(cat "/tmp/vmtest-$name.rc" 2>/dev/null || echo 1)))
|
total=$((total + $(cat "/tmp/vmtest-$tag.rc" 2>/dev/null || echo 1)))
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
echo "SKIP (needs a person, TESTPLAN.md): U1-U9 the app's screens, R2.2 the first desktop login, H-Real the real Steam Machine"
|
echo "SKIP (needs a person, TESTPLAN.md): U1-U9 the app's screens, R2.2 the first desktop login, H-Real the real Steam Machine"
|
||||||
echo "== total: $total failed check(s); boot loaders: ${loaders[*]:-none}; suites: ${suites[*]:-none}"
|
echo "== total: $total failed check(s); boot loaders: ${loaders[*]:-none}; plain PC: ${gloaders[*]:-none}; suites: ${suites[*]:-none}"
|
||||||
} 2>&1 | tee "$summary"
|
} 2>&1 | tee "$summary"
|
||||||
exit "$(grep -c '^FAIL' "$summary")"
|
exit "$(grep -c '^FAIL' "$summary")"
|
||||||
Reference in new issue
Block a user