Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit ec26ba5

Browse files
authored
Merge pull request #1256 from ulyssessouza/e2e-secrets
Add content based e2e tests for configs and secrets
2 parents 66fb790 + b9f34a1 commit ec26ba5

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

local/e2e/compose/compose_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,16 @@ func TestLocalComposeVolume(t *testing.T) {
280280
assert.Assert(t, strings.Contains(output, `"Destination":"/myconfig","Mode":"","RW":false,"Propagation":"rprivate"`), output)
281281
})
282282

283+
t.Run("check config content", func(t *testing.T) {
284+
output := c.RunDockerCmd("exec", "compose-e2e-volume_nginx2_1", "cat", "/myconfig").Stdout()
285+
assert.Assert(t, strings.Contains(output, `Hello from Nginx container`), output)
286+
})
287+
288+
t.Run("check secrets content", func(t *testing.T) {
289+
output := c.RunDockerCmd("exec", "compose-e2e-volume_nginx2_1", "cat", "/run/secrets/mysecret").Stdout()
290+
assert.Assert(t, strings.Contains(output, `Hello from Nginx container`), output)
291+
})
292+
283293
t.Run("check container bind-mounts specs", func(t *testing.T) {
284294
res := c.RunDockerCmd("inspect", "compose-e2e-volume_nginx_1", "--format", "{{ json .HostConfig.Mounts }}")
285295
output := res.Stdout()

local/e2e/compose/fixtures/volume-test/compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ services:
1616
- 9090:80
1717
configs:
1818
- myconfig
19+
secrets:
20+
- mysecret
1921

2022
volumes:
2123
staticVol:
@@ -25,3 +27,7 @@ volumes:
2527
configs:
2628
myconfig:
2729
file: ./static/index.html
30+
31+
secrets:
32+
mysecret:
33+
file: ./static/index.html

0 commit comments

Comments
 (0)