summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-08-29 10:02:15 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-29 16:25:20 +0000
commit2ed79f6315a35a76b405f62aa85088a5b9bd9af4 (patch)
tree9342616cae1cabe1e9ce75b962ff3d6538a7ba2d /test/e2e
parent1789242933ddbc3e4a29662f5218b5b94ee30863 (diff)
downloadpodman-2ed79f6315a35a76b405f62aa85088a5b9bd9af4.tar.gz
podman-2ed79f6315a35a76b405f62aa85088a5b9bd9af4.tar.bz2
podman-2ed79f6315a35a76b405f62aa85088a5b9bd9af4.zip
rootless: fix top
join the user namespace used to create the container so that psgo can work in the same way as with root containers. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1371 Approved by: rhatdan
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/rootless_test.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/e2e/rootless_test.go b/test/e2e/rootless_test.go
index 84af927ea..fb19b7c87 100644
--- a/test/e2e/rootless_test.go
+++ b/test/e2e/rootless_test.go
@@ -71,6 +71,7 @@ var _ = Describe("Podman rootless", func() {
if err != nil {
Skip("User namespaces not supported.")
}
+ canUseExec := canExec()
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
setup.WaitWithDefaultTimeout()
@@ -122,6 +123,22 @@ var _ = Describe("Podman rootless", func() {
Expect(cmd.ExitCode()).To(Equal(0))
allArgs = append([]string{"run", "-d"}, args...)
+ allArgs = append(allArgs, "--security-opt", "seccomp=unconfined", "--rootfs", mountPath, "top")
+ cmd = podmanTest.PodmanAsUser(allArgs, 1000, 1000, env)
+ cmd.WaitWithDefaultTimeout()
+ Expect(cmd.ExitCode()).To(Equal(0))
+
+ if canUseExec {
+ cmd = podmanTest.PodmanAsUser([]string{"top", "-l"}, 1000, 1000, env)
+ cmd.WaitWithDefaultTimeout()
+ Expect(cmd.ExitCode()).To(Equal(0))
+ }
+
+ cmd = podmanTest.PodmanAsUser([]string{"rm", "-l", "-f"}, 1000, 1000, env)
+ cmd.WaitWithDefaultTimeout()
+ Expect(cmd.ExitCode()).To(Equal(0))
+
+ allArgs = append([]string{"run", "-d"}, args...)
allArgs = append(allArgs, "--security-opt", "seccomp=unconfined", "--rootfs", mountPath, "unshare", "-r", "unshare", "-r", "top")
cmd = podmanTest.PodmanAsUser(allArgs, 1000, 1000, env)
cmd.WaitWithDefaultTimeout()
@@ -143,7 +160,7 @@ var _ = Describe("Podman rootless", func() {
cmd.WaitWithDefaultTimeout()
Expect(cmd.ExitCode()).To(Equal(0))
- if !canExec() {
+ if !canUseExec {
Skip("ioctl(NS_GET_PARENT) not supported.")
}