Files
saphid--frame-control/tests/fakeframe/rootfs/usr/local/bin/steam
T
saphidandClaude Opus 5.5 0181071b83 Tests against a fake Frame, and a headset smoke test
tests/fakeframe: a container that stands in for the Frame (Arch Linux, or
Arch Linux ARM on arm64) with sshd, rsync, Valve's steamos-devkit-service
and hooks (vendored unmodified), a fake Steam client for the devkit pipe and
the DevTools port (the app's JavaScript runs in Node against stand-in
SteamClient/appStore objects), stubs for steam, wpctl, flatpak, podman,
Lepton and friends, battery and thermal files under /sys, and fault
switches (fakeframe-ctl): pairing mode, approve/deny/timeout, Steam not
running, headset asleep, sshd off, disk full, runtimes missing. A second
container is the computer running Frame Control.

tests/e2e: 29 tests driving the real ui/server.py, frame_connect.py and
frame_titles.py against it; skipped unless FRAME_E2E=1. scripts/e2e.sh
builds, runs and tears down; CI runs it on ubuntu-24.04-arm.

tests/smoke + scripts/frame-smoke.sh: the core cases against a real Frame,
recorded with its BUILD_ID, cleaning up after itself; --pair to pair a
throwaway key. docs/testing.md describes the layers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 17:40:09 +10:00

27 lines
925 B
Python
Executable File

#!/usr/bin/env python3
"""Stub for SteamOS's `steam` command: hands steam:// URLs to the running client.
On the Frame, `steam steam://rungameid/N` over SSH starts the game in the
running client (docs/apks.md, docs/steam-games.md, 2026-09-25). How the real
wrapper passes the URL on isn't documented; this writes it as a line on
~/.steam/steam.pipe, which fakesteam reads (guess).
"""
import os
import sys
sys.path.insert(0, '/usr/local/lib/fakeframe')
import fakeframe_state as fs # noqa: E402
args = sys.argv[1:]
running = fs.steam_pid() is not None
fs.log('steam', args=args, client_running=running)
if not running:
# The real command would start the Steam client; this one can't.
print('steam: the Steam client is not running', file=sys.stderr)
sys.exit(0)
fd = os.open(os.path.expanduser('~/.steam/steam.pipe'), os.O_RDWR)
try:
os.write(fd, (' '.join(args) + '\n').encode())
finally:
os.close(fd)