Isolate nested IPC sockets and define session ownership policy
This commit is contained in:
1 parent
97026a0db7
commit
ce024d4794
42 files changed
+635
-147
No files matched your search
@@ -6,6 +6,7 @@ Requires target/debug/ferese, feresectl, foot, dbus-daemon, and a Wayland host.
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
from session_socket import ipc_environment, ipc_socket
|
||||
import signal
|
||||
import subprocess
|
||||
import tempfile
|
||||
@@ -35,13 +36,13 @@ class WorkspaceHistoryTest(unittest.TestCase):
|
||||
children = []
|
||||
|
||||
def launch(command, **kwargs):
|
||||
child = subprocess.Popen(command, env=env, start_new_session=True, **kwargs)
|
||||
child = subprocess.Popen(command, env=ipc_environment(env), start_new_session=True, **kwargs)
|
||||
children.append(child)
|
||||
return child
|
||||
|
||||
def command(*args):
|
||||
return json.loads(subprocess.check_output(
|
||||
[str(repo / "target/debug/feresectl"), "-j", *args], env=env, timeout=5
|
||||
[str(repo / "target/debug/feresectl"), "-j", *args], env=ipc_environment(env), timeout=5
|
||||
))
|
||||
|
||||
def active():
|
||||
@@ -55,7 +56,7 @@ class WorkspaceHistoryTest(unittest.TestCase):
|
||||
compositor = launch([str(repo / "target/debug/ferese"), "--backend", "nested"],
|
||||
stdout=log, stderr=log)
|
||||
deadline = time.monotonic() + 10
|
||||
while not (runtime / "ferese/control.sock").is_socket():
|
||||
while not (ipc_socket(runtime)).is_socket():
|
||||
if compositor.poll() is not None or time.monotonic() >= deadline:
|
||||
self.fail((root / "compositor.log").read_text())
|
||||
time.sleep(.025)
|
||||
|
||||
Reference in new issue
Block a user