From 2547b8d0ef4eefc2ed62c89f95d1954d71cf16e3 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 21 Jan 2025 17:16:22 -0800 Subject: [PATCH] testing: Use local tcp session for DBus to avoid leftover socket files --- data/test-dbus.conf | 15 +++++++++++++++ src/testing.rs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 data/test-dbus.conf diff --git a/data/test-dbus.conf b/data/test-dbus.conf new file mode 100644 index 0000000..aeb6ef3 --- /dev/null +++ b/data/test-dbus.conf @@ -0,0 +1,15 @@ + + + session + + tcp:host=localhost,port=0 + EXTERNAL + ANONYMOUS + + + + + + + diff --git a/src/testing.rs b/src/testing.rs index 18d6023..e677293 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -112,7 +112,7 @@ pub struct TestHandle { impl MockDBus { pub async fn new() -> Result { let mut process = Command::new("/usr/bin/dbus-daemon") - .args(["--session", "--nofork", "--print-address"]) + .args(["--nofork", "--print-address", "--config-file=data/test-dbus.conf"]) .stdout(Stdio::piped()) .spawn()?;