Skip to content

Commit ccafa76

Browse files
committed
test user as well
1 parent 8239008 commit ccafa76

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

integration/integration_test.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,8 @@ RUN date --utc > /root/date.txt`, testImageAlpine),
13201320
ctx, cancel := context.WithCancel(context.Background())
13211321
t.Cleanup(cancel)
13221322

1323-
wantOverrides := []string{
1323+
wantOutput := []string{
1324+
"containeruser",
13241325
"FROM_CONTAINER_ENV=containerEnv",
13251326
"FROM_REMOTE_ENV=remoteEnv",
13261327
"CONTAINER_OVERRIDE_C=containerEnv",
@@ -1336,15 +1337,20 @@ RUN date --utc > /root/date.txt`, testImageAlpine),
13361337
ENV CONTAINER_OVERRIDE_C=container
13371338
ENV CONTAINER_OVERRIDE_CR=container
13381339
ENV CONTAINER_OVERRIDE_R=container
1340+
RUN adduser -D containeruser
1341+
RUN adduser -D remoteuser
1342+
USER root
13391343
`, testImageAlpine),
13401344
".devcontainer/devcontainer.json": `
13411345
{
13421346
"dockerFile": "Dockerfile",
1347+
"containerUser": "containeruser",
13431348
"containerEnv": {
13441349
"CONTAINER_OVERRIDE_C": "containerEnv",
13451350
"CONTAINER_OVERRIDE_CR": "containerEnv",
13461351
"FROM_CONTAINER_ENV": "containerEnv",
13471352
},
1353+
"remoteUser": "remoteuser",
13481354
"remoteEnv": {
13491355
"CONTAINER_OVERRIDE_CR": "remoteEnv",
13501356
"CONTAINER_OVERRIDE_R": "remoteEnv",
@@ -1429,7 +1435,7 @@ RUN date --utc > /root/date.txt`, testImageAlpine),
14291435
t.Fatalf("unexpected output (-want +got):\n%s", diff)
14301436
}
14311437

1432-
for _, want := range wantOverrides {
1438+
for _, want := range wantOutput {
14331439
assert.Contains(t, gotEnv, want, "expected env var %q to be present", want)
14341440
}
14351441
})

0 commit comments

Comments
 (0)