(t *testing.T)
| 121 | } |
| 122 | |
| 123 | func TestUpSwitchVolumes(t *testing.T) { |
| 124 | c := NewCLI(t) |
| 125 | const projectName = "compose-e2e-switch-volumes" |
| 126 | t.Cleanup(func() { |
| 127 | c.cleanupWithDown(t, projectName) |
| 128 | c.RunDockerCmd(t, "volume", "rm", "-f", "test_external_volume") |
| 129 | c.RunDockerCmd(t, "volume", "rm", "-f", "test_external_volume_2") |
| 130 | }) |
| 131 | |
| 132 | c.RunDockerCmd(t, "volume", "create", "test_external_volume") |
| 133 | c.RunDockerCmd(t, "volume", "create", "test_external_volume_2") |
| 134 | |
| 135 | c.RunDockerComposeCmd(t, "-f", "./fixtures/switch-volumes/compose.yaml", "--project-name", projectName, "up", "-d") |
| 136 | |
| 137 | res := c.RunDockerCmd(t, "inspect", fmt.Sprintf("%s-app-1", projectName), "-f", "{{ (index .Mounts 0).Name }}") |
| 138 | res.Assert(t, icmd.Expected{Out: "test_external_volume"}) |
| 139 | |
| 140 | c.RunDockerComposeCmd(t, "-f", "./fixtures/switch-volumes/compose2.yaml", "--project-name", projectName, "up", "-d") |
| 141 | res = c.RunDockerCmd(t, "inspect", fmt.Sprintf("%s-app-1", projectName), "-f", "{{ (index .Mounts 0).Name }}") |
| 142 | res.Assert(t, icmd.Expected{Out: "test_external_volume_2"}) |
| 143 | } |
| 144 | |
| 145 | func TestUpRecreateVolumes(t *testing.T) { |
| 146 | c := NewCLI(t) |
nothing calls this directly
no test coverage detected