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
@@ -5,6 +5,7 @@ Requires built debug compositor binaries, a Wayland host and dbus-daemon.
|
||||
"""
|
||||
import os
|
||||
from pathlib import Path
|
||||
from session_socket import ipc_environment, ipc_socket
|
||||
import signal
|
||||
import subprocess
|
||||
import tempfile
|
||||
@@ -34,17 +35,17 @@ class MaterialLifetime(unittest.TestCase):
|
||||
with (root / "compositor.log").open("w") as log:
|
||||
try:
|
||||
bus = subprocess.Popen(["dbus-daemon", "--session", "--nofork", "--print-address=1"],
|
||||
env=env, stdout=subprocess.PIPE, text=True, start_new_session=True)
|
||||
env=ipc_environment(env), stdout=subprocess.PIPE, text=True, start_new_session=True)
|
||||
children.append(bus)
|
||||
env["DBUS_SESSION_BUS_ADDRESS"] = bus.stdout.readline().strip()
|
||||
compositor = subprocess.Popen([str(ROOT / "target/debug/ferese"), "--backend", "nested"],
|
||||
env=env, stdout=log, stderr=log, start_new_session=True)
|
||||
env=ipc_environment(env), stdout=log, stderr=log, start_new_session=True)
|
||||
children.append(compositor)
|
||||
deadline = time.monotonic() + 10
|
||||
while time.monotonic() < deadline:
|
||||
self.assertIsNone(compositor.poll(), (root / "compositor.log").read_text())
|
||||
sockets = [p for p in runtime.glob("wayland-*") if p.is_socket()]
|
||||
if sockets and (runtime / "ferese/control.sock").is_socket():
|
||||
if sockets and (ipc_socket(runtime)).is_socket():
|
||||
break
|
||||
time.sleep(.05)
|
||||
else:
|
||||
@@ -54,7 +55,7 @@ class MaterialLifetime(unittest.TestCase):
|
||||
"cargo", "test", "--workspace", "--locked",
|
||||
"material::tests::attachment_acknowledgement_and_last_clone_release",
|
||||
"--", "--ignored", "--exact",
|
||||
], cwd=ROOT, env=env, capture_output=True, text=True, timeout=120)
|
||||
], cwd=ROOT, env=ipc_environment(env), capture_output=True, text=True, timeout=120)
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
self.assertIn("1 passed", result.stdout)
|
||||
self.assertIsNone(compositor.poll())
|
||||
|
||||
Reference in new issue
Block a user