()
| 1392 | /// Verify that `allowed_ips` survives the round-trip. |
| 1393 | #[test] |
| 1394 | fn round_trip_preserves_allowed_ips() { |
| 1395 | let yaml = r#" |
| 1396 | version: 1 |
| 1397 | network_policies: |
| 1398 | internal: |
| 1399 | name: internal |
| 1400 | endpoints: |
| 1401 | - host: db.internal.corp |
| 1402 | port: 5432 |
| 1403 | allowed_ips: |
| 1404 | - "10.0.5.0/24" |
| 1405 | - "10.0.6.0/24" |
| 1406 | binaries: |
| 1407 | - path: /usr/bin/curl |
| 1408 | "#; |
| 1409 | let proto1 = parse_sandbox_policy(yaml).expect("parse failed"); |
| 1410 | let yaml_out = serialize_sandbox_policy(&proto1).expect("serialize failed"); |
| 1411 | let proto2 = parse_sandbox_policy(&yaml_out).expect("re-parse failed"); |
| 1412 | |
| 1413 | let ep1 = &proto1.network_policies["internal"].endpoints[0]; |
| 1414 | let ep2 = &proto2.network_policies["internal"].endpoints[0]; |
| 1415 | assert_eq!(ep1.allowed_ips, ep2.allowed_ips); |
| 1416 | assert_eq!(ep1.allowed_ips, vec!["10.0.5.0/24", "10.0.6.0/24"]); |
| 1417 | } |
| 1418 | |
| 1419 | /// Verify that the network policy `name` field survives the round-trip. |
| 1420 | #[test] |
nothing calls this directly
no test coverage detected