(t *testing.T)
| 147 | } |
| 148 | |
| 149 | func TestNetworkConfigChanged(t *testing.T) { |
| 150 | // fixture is shared with TestNetworks and is not safe to run concurrently |
| 151 | c := NewCLI(t) |
| 152 | const projectName = "network_config_change" |
| 153 | |
| 154 | c.RunDockerComposeCmd(t, "-f", "./fixtures/network-test/compose.subnet.yaml", "--project-name", projectName, "up", "-d") |
| 155 | t.Cleanup(func() { |
| 156 | c.RunDockerComposeCmd(t, "--project-name", projectName, "down") |
| 157 | }) |
| 158 | |
| 159 | res := c.RunDockerComposeCmd(t, "--project-name", projectName, "exec", "test", "hostname", "-i") |
| 160 | res.Assert(t, icmd.Expected{Out: "172.99.0."}) |
| 161 | res.Combined() |
| 162 | |
| 163 | cmd := c.NewCmdWithEnv([]string{"SUBNET=192.168.0.0/16"}, |
| 164 | "docker", "compose", "-f", "./fixtures/network-test/compose.subnet.yaml", "--project-name", projectName, "up", "-d") |
| 165 | res = icmd.RunCmd(cmd) |
| 166 | res.Assert(t, icmd.Success) |
| 167 | out := res.Combined() |
| 168 | fmt.Println(out) |
| 169 | |
| 170 | res = c.RunDockerComposeCmd(t, "--project-name", projectName, "exec", "test", "hostname", "-i") |
| 171 | res.Assert(t, icmd.Expected{Out: "192.168.0."}) |
| 172 | } |
| 173 | |
| 174 | func TestMacAddress(t *testing.T) { |
| 175 | c := NewCLI(t) |
nothing calls this directly
no test coverage detected