(t *testing.T)
| 110 | } |
| 111 | |
| 112 | func TestIPAMConfig(t *testing.T) { |
| 113 | c := NewParallelCLI(t) |
| 114 | |
| 115 | const projectName = "ipam_e2e" |
| 116 | |
| 117 | t.Run("ensure we do not reuse previous networks", func(t *testing.T) { |
| 118 | c.RunDockerOrExitError(t, "network", "rm", projectName+"_default") |
| 119 | }) |
| 120 | |
| 121 | t.Run("up", func(t *testing.T) { |
| 122 | c.RunDockerComposeCmd(t, "-f", "./fixtures/ipam/compose.yaml", "--project-name", projectName, "up", "-d") |
| 123 | }) |
| 124 | |
| 125 | t.Run("ensure service get fixed IP assigned", func(t *testing.T) { |
| 126 | res := c.RunDockerCmd(t, "inspect", projectName+"-foo-1", "-f", |
| 127 | fmt.Sprintf(`{{ $network := index .NetworkSettings.Networks "%s_default" }}{{ $network.IPAMConfig.IPv4Address }}`, projectName)) |
| 128 | res.Assert(t, icmd.Expected{Out: "10.1.0.100"}) |
| 129 | }) |
| 130 | |
| 131 | t.Run("down", func(t *testing.T) { |
| 132 | _ = c.RunDockerComposeCmd(t, "--project-name", projectName, "down") |
| 133 | }) |
| 134 | } |
| 135 | |
| 136 | func TestNetworkModes(t *testing.T) { |
| 137 | // fixture is shared with TestNetworks and is not safe to run concurrently |
nothing calls this directly
no test coverage detected