#!/usr/bin/env bash set -euo pipefail failures=0 check() { local description="$1" shift echo "== $description ==" if "$@"; then echo "OK: $description" else echo "FEJL: $description" failures=$((failures + 1)) fi } check "OS og arkitektur" uname -a check "OLA version" ola_dev_info --version check "olad status" systemctl is-active --quiet olad check "tuxdmx service status" systemctl is-active --quiet tuxdmx.service check "API health" curl -fsS http://127.0.0.1:8000/api/v1/health check "Databasefil findes" test -f /var/lib/tuxdmx/tuxdmx.db check "USB devices list" lsusb check "Audio devices" arecord -l check "Disk plads" df -h / echo "== Simulatorframe ==" curl -fsS http://127.0.0.1:8000/api/v1/dmx/frame >/dev/null || failures=$((failures + 1)) if [[ "${1:-}" == "--hardware-channel-test" ]]; then echo "Hardwarekanaltest er eksplicit valgt. Brugeren skal visuelt bekræfte lampereaktion." curl -fsS -X POST "http://127.0.0.1:8000/api/v1/dmx/test-channel?channel=1&value=64" >/dev/null || failures=$((failures + 1)) fi if (( failures > 0 )); then echo "Smoke test fejlede med $failures fejl" exit 1 fi echo "Smoke test bestået. Bemærk: bestået test dokumenterer ikke i sig selv fysisk DMX-signal ved lampen."