summaryrefslogtreecommitdiff
path: root/test/e2e/run_test.go
diff options
context:
space:
mode:
authorumohnani8 <umohnani@redhat.com>2018-04-12 14:41:17 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-13 21:25:15 +0000
commit9aafc25a3d5c34b89ccd1e9866fbe57b171cf001 (patch)
tree86a0c5352bf5504b0a894bec653cacb3224a4171 /test/e2e/run_test.go
parentac910c7aa8246669a9b5ef0957f825e81d09f044 (diff)
downloadpodman-9aafc25a3d5c34b89ccd1e9866fbe57b171cf001.tar.gz
podman-9aafc25a3d5c34b89ccd1e9866fbe57b171cf001.tar.bz2
podman-9aafc25a3d5c34b89ccd1e9866fbe57b171cf001.zip
Fix secrets patch
The secrets code was just tarring and copying the contents of the secrets directory on host as is. This meant it was not accounting for any symlinks inside the directory, leading up to the contents not being copied over. Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #611 Approved by: mheon
Diffstat (limited to 'test/e2e/run_test.go')
-rw-r--r--test/e2e/run_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 17b61533b..94a1fef57 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -278,10 +278,26 @@ var _ = Describe("Podman run", func() {
err = ioutil.WriteFile(secretsFile, []byte(secretsString), 0755)
Expect(err).To(BeNil())
+ targetDir := "/tmp/symlink/target"
+ err = os.MkdirAll(targetDir, 0755)
+ Expect(err).To(BeNil())
+ keyFile := filepath.Join(targetDir, "key.pem")
+ err = ioutil.WriteFile(keyFile, []byte(mountString), 0755)
+ Expect(err).To(BeNil())
+ execSession := podmanTest.SystemExec("ln", []string{"-s", targetDir, filepath.Join(secretsDir, "mysymlink")})
+ execSession.WaitWithDefaultTimeout()
+ Expect(execSession.ExitCode()).To(Equal(0))
+
session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "cat", "/run/secrets/test.txt"})
session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(Equal(secretsString))
+ session = podmanTest.Podman([]string{"run", "--rm", ALPINE, "ls", "/run/secrets/mysymlink"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("key.pem"))
+
err = os.RemoveAll(containersDir)
Expect(err).To(BeNil())
})