()
| 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() { |
nothing calls this directly
no test coverage detected