(t *testing.T)
| 230 | } |
| 231 | |
| 232 | func TestCreateWithPriority(t *testing.T) { |
| 233 | // This feature should work on Windows, but the test is skipped because: |
| 234 | // 1. Linux-specific tools are used here; 2. 'windows' IPAM driver doesn't |
| 235 | // support static allocations. |
| 236 | skip.If(t, testEnv.DaemonInfo.OSType == "windows") |
| 237 | skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.48"), "requires API v1.48") |
| 238 | |
| 239 | ctx := setupTest(t) |
| 240 | apiClient := testEnv.APIClient() |
| 241 | |
| 242 | network.CreateNoError(ctx, t, apiClient, "testnet1", |
| 243 | network.WithIPv6(), |
| 244 | network.WithIPAM("10.100.20.0/24", "10.100.20.1"), |
| 245 | network.WithIPAM("fd54:7a1b:8269::/64", "fd54:7a1b:8269::1")) |
| 246 | defer network.RemoveNoError(ctx, t, apiClient, "testnet1") |
| 247 | |
| 248 | network.CreateNoError(ctx, t, apiClient, "testnet2", |
| 249 | network.WithIPv6(), |
| 250 | network.WithIPAM("10.100.30.0/24", "10.100.30.1"), |
| 251 | network.WithIPAM("fdff:6dfe:37d2::/64", "fdff:6dfe:37d2::1")) |
| 252 | defer network.RemoveNoError(ctx, t, apiClient, "testnet2") |
| 253 | |
| 254 | ctrID := container.Run(ctx, t, apiClient, |
| 255 | container.WithCmd("sleep", "infinity"), |
| 256 | container.WithNetworkMode("testnet1"), |
| 257 | container.WithEndpointSettings("testnet1", &networktypes.EndpointSettings{GwPriority: 10}), |
| 258 | container.WithEndpointSettings("testnet2", &networktypes.EndpointSettings{GwPriority: 100})) |
| 259 | defer container.Remove(ctx, t, apiClient, ctrID, client.ContainerRemoveOptions{Force: true}) |
| 260 | |
| 261 | checkCtrRoutes(t, ctx, apiClient, ctrID, syscall.AF_INET, 3, "default via 10.100.30.1 dev") |
| 262 | // IPv6 routing table will contain for each interface, one route for the LL |
| 263 | // address, one for the ULA, and one multicast. |
| 264 | checkCtrRoutes(t, ctx, apiClient, ctrID, syscall.AF_INET6, 7, "default via fdff:6dfe:37d2::1 dev") |
| 265 | } |
| 266 | |
| 267 | func TestConnectWithPriority(t *testing.T) { |
| 268 | // This feature should work on Windows, but the test is skipped because: |
nothing calls this directly
no test coverage detected
searching dependent graphs…