(t *testing.T)
| 302 | } |
| 303 | |
| 304 | func TestStaticIPOutsideSubpool(t *testing.T) { |
| 305 | skip.If(t, testEnv.IsRemoteDaemon) |
| 306 | skip.If(t, testEnv.DaemonInfo.OSType != "linux") |
| 307 | |
| 308 | ctx := testutil.StartSpan(baseContext, t) |
| 309 | |
| 310 | d := daemon.New(t) |
| 311 | d.StartWithBusybox(ctx, t) |
| 312 | defer d.Stop(t) |
| 313 | |
| 314 | apiClient, err := client.New(client.FromEnv, client.WithAPIVersion("1.43")) |
| 315 | assert.NilError(t, err) |
| 316 | |
| 317 | const netname = "subnet-range" |
| 318 | n := net.CreateNoError(ctx, t, apiClient, netname, net.WithIPAMRange("10.42.0.0/16", "10.42.128.0/24", "10.42.0.1")) |
| 319 | defer net.RemoveNoError(ctx, t, apiClient, n) |
| 320 | |
| 321 | cID := container.Run(ctx, t, apiClient, |
| 322 | container.WithImage("busybox:latest"), |
| 323 | container.WithCmd("sh", "-c", `ip -4 -oneline addr show eth0`), |
| 324 | container.WithNetworkMode(netname), |
| 325 | container.WithIPv4(netname, "10.42.1.3"), |
| 326 | ) |
| 327 | |
| 328 | poll.WaitOn(t, container.IsStopped(ctx, apiClient, cID)) |
| 329 | |
| 330 | out, err := apiClient.ContainerLogs(ctx, cID, client.ContainerLogsOptions{ShowStdout: true}) |
| 331 | assert.NilError(t, err) |
| 332 | defer out.Close() |
| 333 | |
| 334 | var b bytes.Buffer |
| 335 | _, err = io.Copy(&b, out) |
| 336 | assert.NilError(t, err) |
| 337 | |
| 338 | assert.Check(t, is.Contains(b.String(), "inet 10.42.1.3/16")) |
| 339 | } |
| 340 | |
| 341 | func TestWorkingDirNormalization(t *testing.T) { |
| 342 | ctx := setupTest(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…