Skip to content

Commit

Permalink
✅ zb: Add unixexec connection test case
Browse files Browse the repository at this point in the history
  • Loading branch information
vially committed Oct 1, 2024
1 parent 1e0c17a commit faee7b1
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions zbus/tests/unixexec.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
use ntest::timeout;
use test_log::test;

use zbus::{block_on, conn::Builder, Result};

#[test]
#[timeout(15000)]
fn unixexec_connection_async() {
block_on(test_unixexec_connection()).unwrap();
}

async fn test_unixexec_connection() -> Result<()> {
let connection = Builder::address("unixexec:path=systemd-stdio-bridge")?
.build()
.await?;

match connection
.call_method(
Some("org.freedesktop.DBus"),
"/org/freedesktop/DBus",
Some("org.freedesktop.DBus"),
"Hello",
&(),
)
.await
{
Err(zbus::Error::MethodError(_, _, _)) => (),
Err(e) => panic!("{}", e),

_ => panic!(),
};

Ok(())
}

0 comments on commit faee7b1

Please sign in to comment.