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
@@ -0,0 +1,17 @@
|
||||
"""Find the compositor endpoint in an isolated test runtime."""
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def ipc_socket(runtime):
|
||||
runtime = Path(runtime)
|
||||
default = runtime / "ferese/control.sock"
|
||||
instances = sorted(path for path in runtime.glob("ferese/instances/*/control.sock") if path.is_socket())
|
||||
if default.is_socket():
|
||||
instances.append(default)
|
||||
if len(instances) > 1:
|
||||
raise RuntimeError("Isolated test runtime contains multiple compositor instances")
|
||||
return instances[0] if instances else default
|
||||
|
||||
|
||||
def ipc_environment(environment):
|
||||
return dict(environment, FERESE_SOCKET=str(ipc_socket(environment["XDG_RUNTIME_DIR"])))
|
||||
Reference in new issue
Block a user