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

Function test_include_workdir_no_duplicate

crates/openshell-prover/src/lib.rs:145–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143 // 5. No duplicate when workdir already in read_write.
144 #[test]
145 fn test_include_workdir_no_duplicate() {
146 let yaml = r"
147version: 1
148filesystem_policy:
149 include_workdir: true
150 read_write:
151 - /sandbox
152 - /tmp
153";
154 let model = policy::parse_policy_str(yaml).expect("parse");
155 let readable = model.filesystem_policy.readable_paths();
156 let sandbox_count = readable.iter().filter(|p| *p == "/sandbox").count();
157 assert_eq!(sandbox_count, 1);
158 }
159
160 // 6. End-to-end: testdata policy with a github credential in scope and a
161 // bypass-L7 binary (git) emits an `l7_bypass_credentialed` finding.

Callers

nothing calls this directly

Calls 2

parse_policy_strFunction · 0.85
readable_pathsMethod · 0.80

Tested by

no test coverage detected