cat / goq
clone

turns a linux box into a private steam streaming appliance: plug in, tap your key, play from another computer

fix/release-build-and-order
goq / scripts / tests / sigil-host-activation-guide.sh
sigil-host-activation-guide.sh 2.6K executable
1#!/usr/bin/env bash23set -euo pipefail45script_dir="$(CDPATH='' cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"6repo_dir="$(CDPATH='' cd -- "$script_dir/../.." && pwd -P)"7guide="$repo_dir/docs/sigil-host-activation.md"8installer="$repo_dir/scripts/install-bazzite-package.sh"9bootstrap="$repo_dir/website/install-sigil"10temp_parent="${TMPDIR:-/tmp}"11temp_parent="${temp_parent%/}"12temp_root="$(mktemp -d "$temp_parent/sigil-activation-guide.XXXXXX")"1314cleanup() {15 local status=$?16 trap - EXIT INT TERM HUP17 case "$temp_root" in18 "$temp_parent"/sigil-activation-guide.??????) rm -rf -- "$temp_root" ;;19 esac20 exit "$status"21}22trap cleanup EXIT INT TERM HUP2324fail() {25 printf 'FAIL: %s\n' "$1" >&226 exit 127}2829[[ -f "$guide" && ! -L "$guide" ]] || fail 'the activation guide is missing or unsafe'3031awk '32 /^```bash$/ { inside = 1; next }33 /^```$/ && inside { inside = 0; print ""; next }34 inside { print }35' "$guide" >"$temp_root/guide-code.sh"36bash -n "$temp_root/guide-code.sh"3738if grep -Eq 'tank@|/Users/dami|Developer/sigil-spark|scripts/' "$guide"; then39 fail 'the product activation guide contains a maintainer or source-checkout path'40fi41if grep -Eq '/dev/dri/renderD128|vaapi_encoder = "vah264enc"' "$guide"; then42 fail 'the activation guide pins the original test host GPU contract'43fi4445grep -Fq 'refusing to replace existing host configuration' "$guide" \46 || fail 'the activation guide can overwrite an existing host configuration'47grep -Fq 'set -o noclobber' "$guide" \48 || fail 'the activation guide does not create host.toml exclusively'49grep -Fq -- '--kill-after=2s 5s' "$guide" \50 || fail 'the activation guide does not time-bound GStreamer inspection'51grep -Fq 'inspect_max_bytes=1048576' "$guide" \52 || fail 'the activation guide does not size-bound GStreamer inspection'53grep -Fq 'current/assets/72-sigil-uinput.rules' "$guide" \54 || fail 'the activation guide does not use its packaged early uinput rule'55grep -Fq 'current/assets/99-sigil-uinput.rules' "$guide" \56 || fail 'the activation guide does not use its packaged final uinput rule'57grep -Fq 'native Gamescope' "$guide" \58 || fail 'the activation guide does not preserve dynamic native resolution'5960for output_script in "$installer" "$bootstrap"; do61 grep -Fq 'current/docs/sigil-host-activation.md' "$output_script" \62 || fail "$(basename "$output_script") does not print the persistent guide path"63 if grep -Fq 'fresh-bazzite-host.md' "$output_script"; then64 fail "$(basename "$output_script") still delegates activation to the lab runbook"65 fi66done6768printf 'sigil_host_activation_guide_tests=ok\n'