diff options
author | umohnani8 <umohnani@redhat.com> | 2018-03-23 16:38:55 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-03-29 14:15:27 +0000 |
commit | 8a96b4acbc97d5c34ff0160ab1a1b585fdd5d156 (patch) | |
tree | 822c9d92ee38b8a85f7f41cc85edc6c388be00f2 /test | |
parent | d0c983563129c804d2c974b05cc7d3604957f51a (diff) | |
download | podman-8a96b4acbc97d5c34ff0160ab1a1b585fdd5d156.tar.gz podman-8a96b4acbc97d5c34ff0160ab1a1b585fdd5d156.tar.bz2 podman-8a96b4acbc97d5c34ff0160ab1a1b585fdd5d156.zip |
Add secrets patch to podman
Adds support for mounting secrets especially on RHEL where the container
can use the host subsription to run yum
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #544
Approved by: rhatdan
Diffstat (limited to 'test')
-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()) + }) + }) |