mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 02:00:19 +02:00
Fix the review's findings in the test harness
Headset smoke test: drop the paired key from authorized_keys with a same-mode copy swapped in, so a failed write can't truncate it; check the throwaway key with no ssh_config or agent; clean up idempotently (tracked and leftover titles, their json files, Steam's shortcuts via steamos-delete, and ~/devkit-utils if it wasn't there before), with a failed cleanup a failed step; count a launch only with fresh evidence (the process, Steam's log, or the known missing-runtime line), matching with [d]evkit-game so pgrep doesn't find its own shell. The test programs sleep 10 s. Fake Frame: log a launch before its reaper can look for it. e2e: kill a pairing client's process group when a test ends; accept an aarch64 program running under QEMU on x86 hosts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
0181071b83
commit
93aebb5019
6 files changed
+173
-66
No files matched your search
@@ -2,6 +2,7 @@
|
||||
steamos-devkit-service on the fake Frame, and its password fallback."""
|
||||
import json
|
||||
import os
|
||||
import signal
|
||||
import stat
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -28,9 +29,20 @@ class Pairing(harness.FrameTestCase):
|
||||
f.write(f'#!/bin/sh\necho {askpass}\n')
|
||||
os.chmod(script, stat.S_IRWXU)
|
||||
env.update(SSH_ASKPASS=script, SSH_ASKPASS_REQUIRE='force')
|
||||
return subprocess.Popen([sys.executable, str(ROOT / 'ui' / 'frame_connect.py'), FAKE_HOST],
|
||||
proc = subprocess.Popen([sys.executable, str(ROOT / 'ui' / 'frame_connect.py'), FAKE_HOST],
|
||||
stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
||||
text=True, env=env, start_new_session=True)
|
||||
self.addCleanup(self.stop, proc) # a failed test mustn't leave it pairing into the next one
|
||||
return proc
|
||||
|
||||
@staticmethod
|
||||
def stop(proc):
|
||||
if proc.poll() is None:
|
||||
try:
|
||||
os.killpg(proc.pid, signal.SIGKILL) # frame_connect.py and its ssh children
|
||||
except OSError:
|
||||
pass
|
||||
proc.communicate()
|
||||
|
||||
def finish(self, proc, timeout=120):
|
||||
out, _ = proc.communicate(timeout=timeout)
|
||||
|
||||
Reference in new issue
Block a user