()
| 1498 | |
| 1499 | #[test] |
| 1500 | fn parse_policy_with_network_rules() { |
| 1501 | let yaml = r" |
| 1502 | version: 1 |
| 1503 | network_policies: |
| 1504 | test: |
| 1505 | name: test_policy |
| 1506 | endpoints: |
| 1507 | - { host: example.com, port: 443 } |
| 1508 | binaries: |
| 1509 | - { path: /usr/bin/curl } |
| 1510 | "; |
| 1511 | let policy = parse_sandbox_policy(yaml).expect("should parse"); |
| 1512 | assert_eq!(policy.network_policies.len(), 1); |
| 1513 | let rule = &policy.network_policies["test"]; |
| 1514 | assert_eq!(rule.name, "test_policy"); |
| 1515 | assert_eq!(rule.endpoints.len(), 1); |
| 1516 | assert_eq!(rule.endpoints[0].host, "example.com"); |
| 1517 | assert_eq!(rule.endpoints[0].port, 443); |
| 1518 | assert_eq!(rule.binaries.len(), 1); |
| 1519 | assert_eq!(rule.binaries[0].path, "/usr/bin/curl"); |
| 1520 | } |
| 1521 | |
| 1522 | #[test] |
| 1523 | fn parse_l7_query_matchers_and_round_trip() { |
nothing calls this directly
no test coverage detected