summaryrefslogtreecommitdiff
path: root/test/e2e/run_volume_test.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-04-30 13:40:04 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-05-02 15:17:03 -0400
commitbb564b68e163dfa96ba5533ed3255a338ccfe6e6 (patch)
treee204c39ea576de41f54768dca96874c56f4a5b69 /test/e2e/run_volume_test.go
parent606cee93bfabe2b8177dad53168e51cd1aeeb9ee (diff)
downloadpodman-bb564b68e163dfa96ba5533ed3255a338ccfe6e6.tar.gz
podman-bb564b68e163dfa96ba5533ed3255a338ccfe6e6.tar.bz2
podman-bb564b68e163dfa96ba5533ed3255a338ccfe6e6.zip
Fix podman-in-podman volume test
When running inside Podman, we get an extra `nodev` mount option. It doesn't seem to be a bug, more an artifact of running in a somewhat locked-down container. So instead of checking explicitly for a set of mount options, just verify the ones we set are present. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test/e2e/run_volume_test.go')
-rw-r--r--test/e2e/run_volume_test.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go
index c86491109..e27b2aa55 100644
--- a/test/e2e/run_volume_test.go
+++ b/test/e2e/run_volume_test.go
@@ -12,7 +12,7 @@ import (
. "github.com/onsi/gomega"
)
-var _ = Describe("Podman run", func() {
+var _ = Describe("Podman run with volumes", func() {
var (
tempdir string
err error
@@ -41,21 +41,25 @@ var _ = Describe("Podman run", func() {
session := podmanTest.Podman([]string{"run", "--rm", "-v", fmt.Sprintf("%s:/run/test", mountPath), ALPINE, "grep", "/run/test", "/proc/self/mountinfo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- Expect(session.OutputToString()).To(ContainSubstring("/run/test rw,relatime"))
+ found, matches := session.GrepString("/run/test")
+ Expect(found).Should(BeTrue())
+ Expect(matches[0]).To(ContainSubstring("rw"))
mountPath = filepath.Join(podmanTest.TempDir, "secrets")
os.Mkdir(mountPath, 0755)
session = podmanTest.Podman([]string{"run", "--rm", "-v", fmt.Sprintf("%s:/run/test:ro", mountPath), ALPINE, "grep", "/run/test", "/proc/self/mountinfo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- Expect(session.OutputToString()).To(ContainSubstring("/run/test ro,relatime"))
+ found, matches = session.GrepString("/run/test")
+ Expect(found).Should(BeTrue())
+ Expect(matches[0]).To(ContainSubstring("ro"))
mountPath = filepath.Join(podmanTest.TempDir, "secrets")
os.Mkdir(mountPath, 0755)
session = podmanTest.Podman([]string{"run", "--rm", "-v", fmt.Sprintf("%s:/run/test:shared", mountPath), ALPINE, "grep", "/run/test", "/proc/self/mountinfo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- found, matches := session.GrepString("/run/test")
+ found, matches = session.GrepString("/run/test")
Expect(found).Should(BeTrue())
Expect(matches[0]).To(ContainSubstring("rw"))
Expect(matches[0]).To(ContainSubstring("shared"))