From cd92f589df96d717ccc145aa3ff93456c8a19eca Mon Sep 17 00:00:00 2001 From: Jamie King Date: Mon, 8 Jun 2026 22:06:13 -0600 Subject: [PATCH] test(mxc): fix lifecycle and policy unit-test compile drift - Bring futures::StreamExt into scope for the watch-stream `.next()` call in driver::lifecycle_tests so the negative policy proof test compiles. - Bind a local `mapper` and drop the unused/deprecated NetworkBinary in the embedded-mapper network-policy rejection test. Signed-off-by: Jamie King (cherry picked from commit 039b0baf98735ca672dae52be8d3af2417dc0c1a) Signed-off-by: Jamie King --- crates/openshell-driver-mxc/src/driver.rs | 1 + crates/openshell-driver-mxc/src/policy.rs | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/openshell-driver-mxc/src/driver.rs b/crates/openshell-driver-mxc/src/driver.rs index cdbfee55c..b1bc68f85 100644 --- a/crates/openshell-driver-mxc/src/driver.rs +++ b/crates/openshell-driver-mxc/src/driver.rs @@ -662,6 +662,7 @@ fn make_sandbox_with_condition( #[cfg(test)] mod lifecycle_tests { use super::*; + use futures::StreamExt; use openshell_core::proto::compute::v1::DriverSandboxSpec; use openshell_core::proto::{FilesystemPolicy, SandboxPolicy}; use std::time::Duration; diff --git a/crates/openshell-driver-mxc/src/policy.rs b/crates/openshell-driver-mxc/src/policy.rs index 40268ab22..da1ea94f4 100644 --- a/crates/openshell-driver-mxc/src/policy.rs +++ b/crates/openshell-driver-mxc/src/policy.rs @@ -325,7 +325,8 @@ mod tests { #[test] fn embedded_rejects_network_policy_on_isolation_session() { - use openshell_core::proto::{NetworkBinary, NetworkEndpoint, NetworkPolicyRule}; + use openshell_core::proto::{NetworkEndpoint, NetworkPolicyRule}; + let mapper = EmbeddedPolicyMapper; let mut policy = fs_policy(&["C:/work/demo"], &[]); policy.network_policies.insert( "api".to_string(), @@ -335,10 +336,7 @@ mod tests { host: "example.com".into(), ..Default::default() }], - binaries: vec![NetworkBinary { - path: "/usr/bin/curl".into(), - harness: false, - }], + binaries: Vec::new(), }, ); let ctx = demo_ctx(Some("C:/work/demo"));