mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 01:00:18 +02:00
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>
39 lines
1.4 KiB
Python
Executable File
39 lines
1.4 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""Stub for flatpak: --user installs and removals, and `list`, kept in the state file.
|
|
Nothing is downloaded; an app id containing "missing" fails like an unknown ref."""
|
|
import sys
|
|
|
|
sys.path.insert(0, '/usr/local/lib/fakeframe')
|
|
import fakeframe_state as fs # noqa: E402
|
|
|
|
args = sys.argv[1:]
|
|
fs.log('flatpak', args=args)
|
|
words = [a for a in args if not a.startswith('-')]
|
|
cmd = words[0] if words else ''
|
|
if cmd == 'remote-add':
|
|
pass
|
|
elif cmd == 'install':
|
|
app = words[-1]
|
|
if 'missing' in app:
|
|
sys.exit(f'error: Nothing matches {app} in remote flathub')
|
|
with fs.update() as s:
|
|
if not any(f['id'] == app for f in s['flatpaks']):
|
|
s['flatpaks'].append({'id': app, 'name': app.rsplit('.', 1)[-1], 'version': '1.0', 'installation': 'user'})
|
|
print(f'Installing {app}\nInstallation complete.')
|
|
elif cmd == 'uninstall':
|
|
app = words[-1]
|
|
with fs.update() as s:
|
|
before = len(s['flatpaks'])
|
|
s['flatpaks'] = [f for f in s['flatpaks'] if f['id'] != app]
|
|
gone = len(s['flatpaks']) < before
|
|
if not gone:
|
|
sys.exit(f'error: {app}/*unspecified*/*unspecified* not installed')
|
|
print('Uninstall complete.')
|
|
elif cmd == 'list':
|
|
for f in fs.read()['flatpaks']:
|
|
print('\t'.join((f['id'], f['name'], f['version'], f['installation'])))
|
|
elif cmd == 'run':
|
|
pass
|
|
else:
|
|
sys.exit(f'flatpak stub: unsupported {args}')
|