summaryrefslogtreecommitdiff
path: root/test/e2e/run_passwd_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-01 06:07:08 -0400
committerGitHub <noreply@github.com>2020-09-01 06:07:08 -0400
commit65036cc49dcfc1bbd032cf06bfce2b9e45243b90 (patch)
treef0a1f653a502eb5ab861f0acbffee2084d952a53 /test/e2e/run_passwd_test.go
parent138132e16357c1c6103e6ffa770398b663462736 (diff)
parent3875040f134de0aef01d4f360fe563f52ae7b441 (diff)
downloadpodman-65036cc49dcfc1bbd032cf06bfce2b9e45243b90.tar.gz
podman-65036cc49dcfc1bbd032cf06bfce2b9e45243b90.tar.bz2
podman-65036cc49dcfc1bbd032cf06bfce2b9e45243b90.zip
Merge pull request #7516 from mheon/handle_no_passwd_file
Ensure rootless containers without a passwd can start
Diffstat (limited to 'test/e2e/run_passwd_test.go')
-rw-r--r--test/e2e/run_passwd_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/e2e/run_passwd_test.go b/test/e2e/run_passwd_test.go
index 8dea7d39b..c48876dee 100644
--- a/test/e2e/run_passwd_test.go
+++ b/test/e2e/run_passwd_test.go
@@ -58,4 +58,17 @@ var _ = Describe("Podman run passwd", func() {
Expect(session.ExitCode()).To(Equal(0))
Expect(session.LineInOutputContains("passwd")).To(BeTrue())
})
+
+ It("podman can run container without /etc/passwd", func() {
+ SkipIfRemote()
+ dockerfile := `FROM alpine
+RUN rm -f /etc/passwd /etc/shadow /etc/group
+USER 1000`
+ imgName := "testimg"
+ podmanTest.BuildImage(dockerfile, imgName, "false")
+ session := podmanTest.Podman([]string{"run", "--rm", imgName, "ls", "/etc/"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Not(ContainSubstring("passwd")))
+ })
})