mirror of https://github.com/docker/compose.git
Merge pull request #1256 from ulyssessouza/e2e-secrets
Add content based e2e tests for configs and secrets
This commit is contained in:
commit
ec26ba5230
|
@ -280,6 +280,16 @@ func TestLocalComposeVolume(t *testing.T) {
|
||||||
assert.Assert(t, strings.Contains(output, `"Destination":"/myconfig","Mode":"","RW":false,"Propagation":"rprivate"`), output)
|
assert.Assert(t, strings.Contains(output, `"Destination":"/myconfig","Mode":"","RW":false,"Propagation":"rprivate"`), output)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.Run("check config content", func(t *testing.T) {
|
||||||
|
output := c.RunDockerCmd("exec", "compose-e2e-volume_nginx2_1", "cat", "/myconfig").Stdout()
|
||||||
|
assert.Assert(t, strings.Contains(output, `Hello from Nginx container`), output)
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("check secrets content", func(t *testing.T) {
|
||||||
|
output := c.RunDockerCmd("exec", "compose-e2e-volume_nginx2_1", "cat", "/run/secrets/mysecret").Stdout()
|
||||||
|
assert.Assert(t, strings.Contains(output, `Hello from Nginx container`), output)
|
||||||
|
})
|
||||||
|
|
||||||
t.Run("check container bind-mounts specs", func(t *testing.T) {
|
t.Run("check container bind-mounts specs", func(t *testing.T) {
|
||||||
res := c.RunDockerCmd("inspect", "compose-e2e-volume_nginx_1", "--format", "{{ json .HostConfig.Mounts }}")
|
res := c.RunDockerCmd("inspect", "compose-e2e-volume_nginx_1", "--format", "{{ json .HostConfig.Mounts }}")
|
||||||
output := res.Stdout()
|
output := res.Stdout()
|
||||||
|
|
|
@ -16,6 +16,8 @@ services:
|
||||||
- 9090:80
|
- 9090:80
|
||||||
configs:
|
configs:
|
||||||
- myconfig
|
- myconfig
|
||||||
|
secrets:
|
||||||
|
- mysecret
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
staticVol:
|
staticVol:
|
||||||
|
@ -25,3 +27,7 @@ volumes:
|
||||||
configs:
|
configs:
|
||||||
myconfig:
|
myconfig:
|
||||||
file: ./static/index.html
|
file: ./static/index.html
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
mysecret:
|
||||||
|
file: ./static/index.html
|
Loading…
Reference in New Issue