Fix compose volume creation and check this in volume e2e test

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
Guillaume Tardif 2020-12-07 16:57:55 +01:00
parent fe363fd146
commit d0728d94f2
1 changed files with 3 additions and 1 deletions

View File

@ -95,12 +95,14 @@ func TestLocalComposeVolume(t *testing.T) {
t.Run("up with build and no image name, volume", func(t *testing.T) {
//ensure local test run does not reuse previously build image
c.RunDockerOrExitError("--context", "default", "rmi", "compose-e2e-volume_nginx")
c.RunDockerOrExitError("rmi", "compose-e2e-volume_nginx")
c.RunDockerOrExitError("volume", "rm", projectName+"_staticVol")
c.RunDockerCmd("compose", "up", "-d", "--workdir", "volume-test", "--project-name", projectName)
output := HTTPGetWithRetry(t, "http://localhost:8090", http.StatusOK, 2*time.Second, 20*time.Second)
assert.Assert(t, strings.Contains(output, "Hello from Nginx container"))
_ = c.RunDockerCmd("compose", "down", "--project-name", projectName)
_ = c.RunDockerCmd("volume", "rm", projectName+"_staticVol")
})
}