()
| 2248 | |
| 2249 | #[test] |
| 2250 | fn parse_ports_array() { |
| 2251 | let yaml = r" |
| 2252 | version: 1 |
| 2253 | network_policies: |
| 2254 | test: |
| 2255 | name: test |
| 2256 | endpoints: |
| 2257 | - { host: api.example.com, ports: [80, 443] } |
| 2258 | binaries: |
| 2259 | - { path: /usr/bin/curl } |
| 2260 | "; |
| 2261 | let policy = parse_sandbox_policy(yaml).expect("should parse"); |
| 2262 | let ep = &policy.network_policies["test"].endpoints[0]; |
| 2263 | assert_eq!(ep.ports, vec![80, 443]); |
| 2264 | // port should be set to first element for backwards compat |
| 2265 | assert_eq!(ep.port, 80); |
| 2266 | } |
| 2267 | |
| 2268 | #[test] |
| 2269 | fn parse_single_port_normalized_to_ports() { |
nothing calls this directly
no test coverage detected