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

Function validate_rejects_too_many_paths

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

Source from the content-addressed store, hash-verified

1770
1771 #[test]
1772 fn validate_rejects_too_many_paths() {
1773 let mut policy = restrictive_default_policy();
1774 let many_paths: Vec<String> = (0..300).map(|i| format!("/path/{i}")).collect();
1775 policy.filesystem = Some(FilesystemPolicy {
1776 include_workdir: true,
1777 read_only: many_paths,
1778 read_write: vec!["/tmp".into()],
1779 });
1780 let violations = validate_sandbox_policy(&policy).unwrap_err();
1781 assert!(
1782 violations
1783 .iter()
1784 .any(|v| matches!(v, PolicyViolation::TooManyPaths { .. }))
1785 );
1786 }
1787
1788 #[test]
1789 fn validate_rejects_path_too_long() {

Callers

nothing calls this directly

Calls 2

validate_sandbox_policyFunction · 0.85

Tested by

no test coverage detected