summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorumohnani8 <umohnani@redhat.com>2018-03-23 16:38:55 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-29 14:15:27 +0000
commit8a96b4acbc97d5c34ff0160ab1a1b585fdd5d156 (patch)
tree822c9d92ee38b8a85f7f41cc85edc6c388be00f2 /test/e2e
parentd0c983563129c804d2c974b05cc7d3604957f51a (diff)
downloadpodman-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/e2e')
-rw-r--r--test/e2e/run_test.go28
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())
+ })
+
})