summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/25-containersMore.at55
-rw-r--r--test/e2e/run_passwd_test.go13
2 files changed, 68 insertions, 0 deletions
diff --git a/test/apiv2/25-containersMore.at b/test/apiv2/25-containersMore.at
new file mode 100644
index 000000000..e0e6f7222
--- /dev/null
+++ b/test/apiv2/25-containersMore.at
@@ -0,0 +1,55 @@
+# -*- sh -*-
+#
+# test more container-related endpoints
+#
+
+podman pull $IMAGE &>/dev/null
+
+# Ensure clean slate
+podman rm -a -f &>/dev/null
+
+podman run -d --name foo $IMAGE top
+
+# Check exists for none such
+t GET libpod/containers/nonesuch/exists 404
+
+# Check container foo exists
+t GET libpod/containers/foo/exists 204
+
+# Pause the container
+t POST libpod/containers/foo/pause '' 204
+
+t GET libpod/containers/foo/json 200 \
+ .Id~[0-9a-f]\\{64\\} \
+ .State.Status=paused \
+ .ImageName=$IMAGE \
+ .Config.Cmd[0]=top \
+ .Name=foo
+
+# Unpause the container
+t POST libpod/containers/foo/unpause '' 204
+
+t GET libpod/containers/foo/json 200 \
+ .Id~[0-9a-f]\\{64\\} \
+ .State.Status=running \
+ .ImageName=$IMAGE \
+ .Config.Cmd[0]=top \
+ .Name=foo
+
+# List processes of the container
+t GET libpod/containers/foo/top 200 \
+ length=2
+
+# List processes of none such
+t GET libpod/containers/nonesuch/top 404
+
+# Mount the container to host filesystem
+t POST libpod/containers/foo/mount '' 200
+like "$output" ".*merged" "Check container mount"
+
+# Unmount the container
+t POST libpod/containers/foo/unmount '' 204
+
+t DELETE libpod/containers/foo?force=true 204
+
+# vim: filetype=sh
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")))
+ })
})