mirror of
https://github.com/theupriser/steamify-cachyos-dev.git
synced 2026-10-05 12:45:56 +02:00
feat: the menu suite (R1.1-R1.6, R1.10) and one shared log Konsole for every test run
Scripted menu input and Steamify's own status functions, journals free of duplicates, --backend status as JSON, an older item shown as (update). The test scripts append to $TEST_LOG and share one Konsole (common.sh view_start) instead of opening one each; vmsuite.sh streams its output (sed -u). 36 checks pass.
This commit is contained in:
1 parent
ea1207580f
commit
fcffceb941
7 files changed
+62
-19
No files matched your search
@@ -19,3 +19,13 @@ if [[ -z "${VM_SSH_KEY:-}" && -f "$VM_DIR/ssh-key" ]]; then VM_SSH_KEY="$(cat "$
|
||||
[[ -n "${VM_SSH_KEY:-}" ]] && VM_SSH_OPTS+=(-i "$VM_SSH_KEY" -o IdentitiesOnly=yes)
|
||||
vm_ssh() { ssh -p "$VM_PORT" "${VM_SSH_OPTS[@]}" "$VM_USER@$VM_HOST" "$@"; }
|
||||
vm_scp() { scp -q -P "$VM_PORT" "${VM_SSH_OPTS[@]}" "$@"; }
|
||||
|
||||
# One Konsole for every test run: it follows $TEST_LOG, which the test scripts append to.
|
||||
# Started only when there is a desktop, the run is headless and no such window exists.
|
||||
TEST_LOG="${TEST_LOG:-$HOME/vms/test.log}"
|
||||
view_start() {
|
||||
[[ -n "${VM_HEADLESS:-}" && -z "${CI:-}" && -n "${WAYLAND_DISPLAY:-}${DISPLAY:-}" ]] && command -v konsole >/dev/null || return 0
|
||||
systemctl --user is-active --quiet vmtest-view 2>/dev/null && return 0
|
||||
mkdir -p "$(dirname "$TEST_LOG")"; touch "$TEST_LOG"
|
||||
systemd-run --user -q --collect --unit=vmtest-view konsole --hold -e tail -n 60 -F "$TEST_LOG" >/dev/null 2>&1 || true
|
||||
}
|
||||
Executable → Regular
+3
-5
@@ -42,14 +42,12 @@ stop_vm() {
|
||||
}
|
||||
start_vm() { stop_vm; cp "$repo/run.sh" "$VM_DIR/run.sh"; (cd "$VM_DIR" && REPO="${REPO:-$repo/../steamify-cachyos}" setsid nohup ./run.sh --fremont > vm.log 2>&1 &); }
|
||||
reboot_vm() { gssh 'sudo systemctl reboot' >/dev/null 2>&1; sleep 25; waitssh; }
|
||||
# Headless on a desktop: a Konsole following the log (vmtest.sh opens one for all loaders; CI has no desktop).
|
||||
if [[ -n "${VM_HEADLESS:-}" && -z "${CI:-}${VMTEST_NO_VIEW:-}" && -n "${WAYLAND_DISPLAY:-}${DISPLAY:-}" ]] && command -v konsole >/dev/null; then
|
||||
systemd-run --user -q --collect --unit="vmtest-view-$loader-$$" konsole --hold -e tail -n +1 -F "$log" >/dev/null 2>&1 || true
|
||||
fi
|
||||
view_start # one shared Konsole (common.sh)
|
||||
# The guest checks print PASS/FAIL lines; the summary at the end counts them in the log.
|
||||
check() { cat; }
|
||||
|
||||
{
|
||||
printf '\n===== vmbootloadertest.sh %s (%s) =====\n' "$loader" "$(date +%T)"
|
||||
if $install; then
|
||||
step "install $loader VM in $VM_DIR"
|
||||
stop_vm
|
||||
@@ -112,7 +110,7 @@ b="$(gssh uname -r)"
|
||||
|
||||
step "DONE"
|
||||
stop_vm
|
||||
} 2>&1 | tee "$log" | sed 's/\x1b\[[0-9;]*m//g'
|
||||
} 2>&1 | tee "$log" | tee -a "$TEST_LOG" | sed 's/\x1b\[[0-9;]*m//g'
|
||||
fails="$(grep -c '^FAIL' "$log")"
|
||||
echo; echo "== $loader: $(grep -c '^PASS' "$log") passed, $fails failed (log: $log)"
|
||||
grep '^FAIL' "$log"
|
||||
|
||||
Executable → Regular
+4
-6
@@ -17,18 +17,16 @@ dir="$repo/share/vmtest/$suite"
|
||||
[[ -d "$dir" ]] || { echo "No suite $suite (folders in share/vmtest/)" >&2; exit 2; }
|
||||
. "$here/common.sh"
|
||||
log="$VM_DIR.$suite.log"
|
||||
# Headless on a desktop: a Konsole following the log (CI has no desktop; vmtest.sh opens its own).
|
||||
if [[ -n "${VM_HEADLESS:-}" && -z "${CI:-}${VMTEST_NO_VIEW:-}" && -n "${WAYLAND_DISPLAY:-}${DISPLAY:-}" ]] && command -v konsole >/dev/null; then
|
||||
systemd-run --user -q --collect --unit="vmsuite-view-$suite-$$" konsole --hold -e tail -n +1 -F "$log" >/dev/null 2>&1 || true
|
||||
fi
|
||||
view_start # one shared Konsole (common.sh), headless on a desktop
|
||||
{
|
||||
printf '\n===== vmsuite.sh %s (%s) =====\n' "$suite" "$(date +%T)"
|
||||
for block in "$dir"/*.sh; do
|
||||
[[ -z "${ONLY:-}" || "$(basename "$block")" == "$ONLY"* ]] || continue # ONLY=50: just that block
|
||||
printf '\n##### %s %s\n' "$(date +%T)" "$(basename "$block" .sh)"
|
||||
"$here/vmreset.sh" --fremont > /tmp/vmsuite-reset.out 2>&1 || { echo "FAIL vmreset.sh failed: $(tail -n 1 /tmp/vmsuite-reset.out)"; continue; }
|
||||
cat "$repo/share/vmtest/prelude.sh" "$block" | vm_ssh -o ConnectTimeout=6 -o LogLevel=ERROR bash -s 2>&1 | sed 's/\x1b\[[0-9;]*m//g'
|
||||
cat "$repo/share/vmtest/prelude.sh" "$block" | vm_ssh -o ConnectTimeout=6 -o LogLevel=ERROR bash -s 2>&1 | sed -u 's/\x1b\[[0-9;]*m//g'
|
||||
done
|
||||
} 2>&1 | tee "$log"
|
||||
} 2>&1 | tee "$log" | tee -a "$TEST_LOG"
|
||||
fails="$(grep -c '^FAIL' "$log")"
|
||||
echo; echo "== $suite: $(grep -c '^PASS' "$log") passed, $fails failed, $(grep -c '^SKIP' "$log") skipped (log: $log)"
|
||||
grep '^FAIL' "$log"
|
||||
|
||||
Executable → Regular
+1
-6
@@ -27,12 +27,7 @@ for l in $advertised; do
|
||||
[[ " $tested " == *" $l "* ]] || { echo "FAIL the ISO advertises $l, but there is no test for it (scripts/vmbootloadertest.sh)"; missing=$((missing + 1)); }
|
||||
done
|
||||
total=$missing
|
||||
# No human is needed: headless. One Konsole for all the logs (the loader scripts open none).
|
||||
export VMTEST_NO_VIEW=1
|
||||
if [[ -z "$window" && -z "${CI:-}" && -n "${WAYLAND_DISPLAY:-}${DISPLAY:-}" ]] && command -v konsole >/dev/null; then
|
||||
logs=(); for l in "${loaders[@]}"; do logs+=("$HOME/vms/bl-$l.test.log"); done
|
||||
systemd-run --user -q --collect --unit="vmtest-view-$$" konsole --hold -e tail -n +1 -F "${logs[@]}" >/dev/null 2>&1 || true
|
||||
fi
|
||||
# No human is needed: headless; the scripts share one Konsole (common.sh, $TEST_LOG).
|
||||
for l in "${loaders[@]}"; do
|
||||
"$here/vmbootloadertest.sh" "$l" $install $window > "/tmp/vmtest-$l.out" 2>&1; rc=$?
|
||||
sed -n '/^== /,$p' "/tmp/vmtest-$l.out"
|
||||
|
||||
Reference in new issue
Block a user