MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / claim_relay_success

Function claim_relay_success

crates/openshell-server/src/supervisor_session.rs:1300–1312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1298
1299 #[test]
1300 fn claim_relay_success() {
1301 let registry = SupervisorSessionRegistry::new();
1302 let (relay_tx, _relay_rx) = oneshot::channel();
1303 registry.pending_relays.lock().unwrap().insert(
1304 "ch-1".to_string(),
1305 pending_relay("sbx-test", relay_tx, Instant::now()),
1306 );
1307
1308 let principal = sandbox_principal("sbx-test");
1309 let result = registry.claim_relay("ch-1", Some(&principal));
1310 assert!(result.is_ok());
1311 assert!(!registry.pending_relays.lock().unwrap().contains_key("ch-1"));
1312 }
1313
1314 #[test]
1315 fn claim_relay_rejects_cross_sandbox_principal_without_consuming_channel() {

Callers

nothing calls this directly

Calls 3

pending_relayFunction · 0.85
claim_relayMethod · 0.80
sandbox_principalFunction · 0.70

Tested by

no test coverage detected