From 1d7bc42d595660dac386f0817162d629160beed3 Mon Sep 17 00:00:00 2001 From: jasonwitty Date: Fri, 21 Nov 2025 00:07:44 -0800 Subject: [PATCH] fix unit test, move to macro cargo_bin! --- socktop_agent/tests/tls_cert_creation.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/socktop_agent/tests/tls_cert_creation.rs b/socktop_agent/tests/tls_cert_creation.rs index 09933d7..ca38546 100644 --- a/socktop_agent/tests/tls_cert_creation.rs +++ b/socktop_agent/tests/tls_cert_creation.rs @@ -1,3 +1,4 @@ +use assert_cmd::cargo::cargo_bin; use assert_cmd::prelude::*; use std::fs; use std::path::PathBuf; @@ -17,7 +18,7 @@ fn generates_self_signed_cert_and_key_in_xdg_path() { let xdg = tmpdir.path().to_path_buf(); // Run the agent once with --enableSSL, short timeout so it exits quickly when killed - let mut cmd = Command::cargo_bin("socktop_agent").expect("binary exists"); + let mut cmd = Command::new(cargo_bin!("socktop_agent")); // Bind to an ephemeral port (-p 0) to avoid conflicts/flakes cmd.env("XDG_CONFIG_HOME", &xdg) .arg("--enableSSL")