summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2022-07-21 09:44:20 +0200
committerMatthew Heon <matthew.heon@pm.me>2022-07-26 13:58:18 -0400
commit3edaa174e8bc22f57818a69b284b7535dd99a657 (patch)
tree75f8e03d9b61d7ceb4a6ab440efb508b1ac49711 /test
parente41113dcac329104b81727131cf52c2fcbc39f85 (diff)
downloadpodman-3edaa174e8bc22f57818a69b284b7535dd99a657.tar.gz
podman-3edaa174e8bc22f57818a69b284b7535dd99a657.tar.bz2
podman-3edaa174e8bc22f57818a69b284b7535dd99a657.zip
libpod: create /etc/passwd if missing
create the /etc/passwd and /etc/group files if they are missing in the image. Closes: https://github.com/containers/podman/issues/14966 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_passwd_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/e2e/run_passwd_test.go b/test/e2e/run_passwd_test.go
index 411e12218..20a6ee3b1 100644
--- a/test/e2e/run_passwd_test.go
+++ b/test/e2e/run_passwd_test.go
@@ -66,10 +66,15 @@ RUN rm -f /etc/passwd /etc/shadow /etc/group
USER 1000`, ALPINE)
imgName := "testimg"
podmanTest.BuildImage(dockerfile, imgName, "false")
- session := podmanTest.Podman([]string{"run", "--rm", imgName, "ls", "/etc/"})
+ session := podmanTest.Podman([]string{"run", "--passwd=false", "--rm", imgName, "ls", "/etc/"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).To(Not(ContainSubstring("passwd")))
+
+ // test that the /etc/passwd file is created
+ session = podmanTest.Podman([]string{"run", "--rm", "--user", "0:0", imgName, "ls", "/etc/passwd"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
})
It("podman run with no user specified does not change --group specified", func() {