diff options
Diffstat (limited to 'test/e2e/run_test.go')
-rw-r--r-- | test/e2e/run_test.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 3abaab783..16fae5898 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -2,6 +2,7 @@ package integration import ( "fmt" + "io/ioutil" "os" "path/filepath" @@ -216,4 +217,31 @@ var _ = Describe("Podman run", func() { Expect(session.ExitCode()).To(Equal(0)) }) + It("podman run with secrets", func() { + containersDir := "/usr/share/containers" + err := os.MkdirAll(containersDir, 0755) + Expect(err).To(BeNil()) + + secretsDir := filepath.Join(podmanTest.TempDir, "rhel", "secrets") + err = os.MkdirAll(secretsDir, 0755) + Expect(err).To(BeNil()) + + mountsFile := filepath.Join(containersDir, "mounts.conf") + mountString := secretsDir + ":/run/secrets" + err = ioutil.WriteFile(mountsFile, []byte(mountString), 0755) + Expect(err).To(BeNil()) + + secretsFile := filepath.Join(secretsDir, "test.txt") + secretsString := "Testing secrets mount. I am mounted!" + err = ioutil.WriteFile(secretsFile, []byte(secretsString), 0755) + Expect(err).To(BeNil()) + + session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "cat", "/run/secrets/test.txt"}) + session.WaitWithDefaultTimeout() + Expect(session.OutputToString()).To(Equal(secretsString)) + + err = os.RemoveAll(containersDir) + Expect(err).To(BeNil()) + }) + }) |