testing: Add subprocess dbus session interface for test isolation

This commit is contained in:
Vicki Pfau 2024-07-19 18:10:02 -07:00
parent 24223a4827
commit 6e925e91d9
4 changed files with 91 additions and 12 deletions

View file

@ -368,7 +368,7 @@ mod test {
use std::time::Duration;
use tokio::fs::read;
use tokio::time::sleep;
use zbus::{Connection, ConnectionBuilder, Interface};
use zbus::{Connection, Interface};
use zbus_xml::{Method, Node, Property};
struct TestHandle {
@ -377,9 +377,9 @@ mod test {
}
async fn start() -> Result<TestHandle> {
let handle = testing::start();
let mut handle = testing::start();
let (tx, _rx) = channel::<UserContext>();
let connection = ConnectionBuilder::session()?.build().await?;
let connection = handle.new_dbus().await?;
let manager = SteamOSManager::new(connection.clone(), &connection, tx).await?;
connection
.object_server()
@ -485,7 +485,5 @@ mod test {
assert_eq!(local_property.ty(), remote_property.ty());
assert_eq!(local_property.access(), remote_property.access());
}
test.connection.close().await.unwrap();
}
}