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

Function assert_resolves_outside_workspace

e2e/rust/tests/sync.rs:445–452  ·  view source on GitHub ↗

Assert that an error string carries the two markers of a remote-side canonicalisation refusal: `resolves to` (proving `realpath -e` ran) and `outside the` + `sandbox workspace` (proving the boundary check fired). miette renders the long single-line error wrapped across multiple lines at terminal width and inserts a `│ ` continuation marker, so a single long substring like `"outside the sandbox wo

(err: &str, label: &str)

Source from the content-addressed store, hash-verified

443/// long substring like `"outside the sandbox workspace"` is fragile —
444/// match the short markers individually instead.
445fn assert_resolves_outside_workspace(err: &str, label: &str) {
446 assert!(
447 err.contains("resolves to")
448 && err.contains("outside the")
449 && err.contains("sandbox workspace"),
450 "expected resolves-outside-workspace error for {label}, got: {err}"
451 );
452}
453
454/// Regression for the Codex high-severity finding: `validate_sandbox_source_path`
455/// is purely lexical, so a sandbox-side symlink that escapes `/sandbox` could

Calls

no outgoing calls

Tested by

no test coverage detected