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

Function validate_rejects_root_string

crates/openshell-policy/src/lib.rs:2191–2205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2189
2190 #[test]
2191 fn validate_rejects_root_string() {
2192 let mut policy = restrictive_default_policy();
2193 policy.process = Some(ProcessPolicy {
2194 run_as_user: "root".into(),
2195 run_as_group: "sandbox".into(),
2196 });
2197 let violations = validate_sandbox_policy(&policy).unwrap_err();
2198 assert!(violations.iter().any(|v| matches!(
2199 v,
2200 PolicyViolation::InvalidProcessIdentity {
2201 field: "run_as_user",
2202 ..
2203 }
2204 )));
2205 }
2206
2207 #[test]
2208 fn validate_rejects_nobody_string() {

Callers

nothing calls this directly

Calls 2

validate_sandbox_policyFunction · 0.85

Tested by

no test coverage detected