Skip to content

Commit 18ee550

Browse files
committed
fix(proxy): remove unnecessary path qualifications in L4 denial smoke test
1 parent 2bcc30e commit 18ee550

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

crates/openshell-sandbox/src/proxy.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6446,19 +6446,31 @@ network_policies:
64466446

64476447
#[test]
64486448
fn test_emit_denial_enqueues_denial_event() {
6449-
let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel::<crate::denial_aggregator::DenialEvent>();
6449+
let (tx, mut rx) = mpsc::unbounded_channel::<DenialEvent>();
64506450
let decision = ConnectDecision {
6451-
action: NetworkAction::Deny { reason: "no matching policy".into() },
6451+
action: NetworkAction::Deny {
6452+
reason: "no matching policy".into(),
6453+
},
64526454
generation: 0,
6453-
binary: Some(std::path::PathBuf::from("/usr/bin/curl")),
6455+
binary: Some(PathBuf::from("/usr/bin/curl")),
64546456
binary_pid: Some(1234),
64556457
ancestors: vec![],
64566458
cmdline_paths: vec![],
64576459
};
64586460

6459-
emit_denial(&Some(tx), "blocked.invalid", 443, "/usr/bin/curl", &decision, "no matching policy", "connect");
6461+
emit_denial(
6462+
&Some(tx),
6463+
"blocked.invalid",
6464+
443,
6465+
"/usr/bin/curl",
6466+
&decision,
6467+
"no matching policy",
6468+
"connect",
6469+
);
64606470

6461-
let event = rx.try_recv().expect("DenialEvent should be enqueued after L4 deny");
6471+
let event = rx
6472+
.try_recv()
6473+
.expect("DenialEvent should be enqueued after L4 deny");
64626474
assert_eq!(event.host, "blocked.invalid");
64636475
assert_eq!(event.port, 443);
64646476
assert_eq!(event.binary, "/usr/bin/curl");

0 commit comments

Comments
 (0)