diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-12-19 18:19:43 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-12-21 11:26:03 +0100 |
commit | 0ed55f75abac1311b61a17079ae9314ec5459bfd (patch) | |
tree | 7fe53306e03772b0fae3d8d9c501cae6f8adb046 /test | |
parent | d389ac45e5b7208bbfb776d6724223f3bffb3e1b (diff) | |
download | podman-0ed55f75abac1311b61a17079ae9314ec5459bfd.tar.gz podman-0ed55f75abac1311b61a17079ae9314ec5459bfd.tar.bz2 podman-0ed55f75abac1311b61a17079ae9314ec5459bfd.zip |
test: add test for rootless export
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/rootless_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/e2e/rootless_test.go b/test/e2e/rootless_test.go index 037af9688..5a7f0359a 100644 --- a/test/e2e/rootless_test.go +++ b/test/e2e/rootless_test.go @@ -7,6 +7,7 @@ import ( "os/exec" "path/filepath" "runtime" + "strings" "syscall" . "github.com/containers/libpod/test/utils" @@ -245,6 +246,22 @@ var _ = Describe("Podman rootless", func() { cmd.WaitWithDefaultTimeout() Expect(cmd.ExitCode()).To(Equal(0)) Expect(cmd.LineInOutputContains("hello")).To(BeTrue()) + + cmd = rootlessTest.PodmanAsUser([]string{"ps", "-l", "-q"}, 1000, 1000, env) + cmd.WaitWithDefaultTimeout() + Expect(cmd.ExitCode()).To(Equal(0)) + cid := cmd.OutputToString() + + cmd = rootlessTest.PodmanAsUser([]string{"exec", "-l", "sh", "-c", "echo SeCreTMessage > /file"}, 1000, 1000, env) + cmd.WaitWithDefaultTimeout() + Expect(cmd.ExitCode()).To(Equal(0)) + + path := filepath.Join(home, "export.tar") + cmd = rootlessTest.PodmanAsUser([]string{"export", "-o", path, cid}, 1000, 1000, env) + cmd.WaitWithDefaultTimeout() + content, err := ioutil.ReadFile(path) + Expect(err).To(BeNil()) + Expect(strings.Contains(string(content), "SeCreTMessage")).To(BeTrue()) } runInRootlessContext(f) } |