rootless: fix pod top

we need to join the namespace of the target pod.

Closes: https://github.com/containers/libpod/issues/2682

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2019-03-17 21:46:37 +01:00
parent 8aed32acea
commit 46b74a8ff8
3 changed files with 42 additions and 0 deletions

View File

@@ -138,6 +138,21 @@ var _ = Describe("Podman rootless", func() {
cmd.WaitWithDefaultTimeout()
Expect(cmd.ExitCode()).To(Equal(0))
Expect(cmd.LineInOutputContains("hello")).To(BeTrue())
args = []string{"pod", "top", podId}
cmd = rootlessTest.PodmanAsUser(args, 1000, 1000, "", env)
cmd.WaitWithDefaultTimeout()
Expect(cmd.ExitCode()).To(Not(Equal(0)))
args = []string{"run", "--pod", podId, "-d", "--rootfs", mountPath, "sleep", "100"}
cmd = rootlessTest.PodmanAsUser(args, 1000, 1000, "", env)
cmd.WaitWithDefaultTimeout()
Expect(cmd.ExitCode()).To(Equal(0))
args = []string{"pod", "top", podId}
cmd = rootlessTest.PodmanAsUser(args, 1000, 1000, "", env)
cmd.WaitWithDefaultTimeout()
Expect(cmd.ExitCode()).To(Equal(0))
}
runInRootlessContext(f)
})