summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2022-07-21 09:44:20 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2022-07-21 17:58:16 +0200
commitdd2b794061aa6734edc15eb69cc298ea197ae676 (patch)
treea3be5dc548664e9b37ca26bd03c165914489fe0a /test
parent039deece50525b1fc812890dfa1ce2fa1f4c98b3 (diff)
downloadpodman-dd2b794061aa6734edc15eb69cc298ea197ae676.tar.gz
podman-dd2b794061aa6734edc15eb69cc298ea197ae676.tar.bz2
podman-dd2b794061aa6734edc15eb69cc298ea197ae676.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() {