summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/libpod_suite_test.go2
-rw-r--r--test/e2e/rootless_test.go2
-rw-r--r--test/e2e/run_ns_test.go31
-rw-r--r--test/e2e/run_test.go43
-rw-r--r--test/e2e/search_test.go4
5 files changed, 77 insertions, 5 deletions
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go
index 88ec6bc19..a1e9ba57a 100644
--- a/test/e2e/libpod_suite_test.go
+++ b/test/e2e/libpod_suite_test.go
@@ -132,7 +132,7 @@ func PodmanCreate(tempDir string) PodmanTest {
podmanBinary = os.Getenv("PODMAN_BINARY")
}
conmonBinary := filepath.Join("/usr/libexec/podman/conmon")
- altConmonBinary := "/usr/libexec/podman/conmon"
+ altConmonBinary := "/usr/libexec/crio/conmon"
if _, err := os.Stat(altConmonBinary); err == nil {
conmonBinary = altConmonBinary
}
diff --git a/test/e2e/rootless_test.go b/test/e2e/rootless_test.go
index 72ca37d6e..bd782a5fc 100644
--- a/test/e2e/rootless_test.go
+++ b/test/e2e/rootless_test.go
@@ -39,6 +39,7 @@ var _ = Describe("Podman rootless", func() {
os.Exit(1)
}
podmanTest = PodmanCreate(tempdir)
+ podmanTest.CgroupManager = "cgroupfs"
podmanTest.RestoreAllArtifacts()
})
@@ -90,6 +91,7 @@ var _ = Describe("Podman rootless", func() {
tempdir, err := CreateTempDirInTempDir()
Expect(err).To(BeNil())
rootlessTest := PodmanCreate(tempdir)
+ rootlessTest.CgroupManager = "cgroupfs"
err = filepath.Walk(tempdir, chownFunc)
Expect(err).To(BeNil())
diff --git a/test/e2e/run_ns_test.go b/test/e2e/run_ns_test.go
index a61b4ab03..88c0b1ad2 100644
--- a/test/e2e/run_ns_test.go
+++ b/test/e2e/run_ns_test.go
@@ -3,6 +3,7 @@ package integration
import (
"fmt"
"os"
+ "strings"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -59,6 +60,36 @@ var _ = Describe("Podman run ns", func() {
Expect(session.OutputToString()).To(Equal(hostShm))
})
+ It("podman run ipcns ipcmk host test", func() {
+ setup := podmanTest.SystemExec("ipcmk", []string{"-M", "1024"})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+ output := strings.Split(setup.OutputToString(), " ")
+ ipc := output[len(output)-1]
+ session := podmanTest.Podman([]string{"run", "--ipc=host", fedoraMinimal, "ipcs", "-m", "-i", ipc})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ setup = podmanTest.SystemExec("ipcrm", []string{"-m", ipc})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+ })
+
+ It("podman run ipcns ipcmk container test", func() {
+ setup := podmanTest.Podman([]string{"run", "-d", "--name", "test1", fedoraMinimal, "sleep", "999"})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"exec", "test1", "ipcmk", "-M", "1024"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ output := strings.Split(session.OutputToString(), " ")
+ ipc := output[len(output)-1]
+ session = podmanTest.Podman([]string{"run", "--ipc=container:test1", fedoraMinimal, "ipcs", "-m", "-i", ipc})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
+
It("podman run bad ipc pid test", func() {
session := podmanTest.Podman([]string{"run", "--ipc=badpid", fedoraMinimal, "bash", "-c", "echo $$"})
session.WaitWithDefaultTimeout()
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 3d487db66..5cec4f04b 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -50,10 +50,10 @@ var _ = Describe("Podman run", func() {
It("podman run a container based on local image with short options and args", func() {
// regression test for #714
- session := podmanTest.Podman([]string{"run", ALPINE, "find", "/", "-name", "etc"})
+ session := podmanTest.Podman([]string{"run", ALPINE, "find", "/etc", "-name", "hosts"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- match, _ := session.GrepString("/etc")
+ match, _ := session.GrepString("/etc/hosts")
Expect(match).Should(BeTrue())
})
@@ -234,6 +234,32 @@ var _ = Describe("Podman run", func() {
Expect(session.OutputToString()).To(ContainSubstring("/run/test rw,relatime, shared"))
})
+ It("podman run with mount flag", func() {
+ mountPath := filepath.Join(podmanTest.TempDir, "secrets")
+ os.Mkdir(mountPath, 0755)
+ session := podmanTest.Podman([]string{"run", "--rm", "--mount", fmt.Sprintf("type=bind,src=%s,target=/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"))
+
+ session = podmanTest.Podman([]string{"run", "--rm", "--mount", fmt.Sprintf("type=bind,src=%s,target=/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"))
+
+ session = podmanTest.Podman([]string{"run", "--rm", "--mount", fmt.Sprintf("type=bind,src=%s,target=/run/test,shared", 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 shared"))
+
+ mountPath = filepath.Join(podmanTest.TempDir, "scratchpad")
+ os.Mkdir(mountPath, 0755)
+ session = podmanTest.Podman([]string{"run", "--rm", "--mount", "type=tmpfs,target=/run/test", ALPINE, "grep", "/run/test", "/proc/self/mountinfo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("/run/test rw,nosuid,nodev,noexec,relatime - tmpfs"))
+ })
+
It("podman run with cidfile", func() {
session := podmanTest.Podman([]string{"run", "--cidfile", tempdir + "cidfile", ALPINE, "ls"})
session.WaitWithDefaultTimeout()
@@ -565,6 +591,19 @@ USER mail`
Expect(session.ExitCode()).To(Equal(0))
})
+ It("podman run --mount flag with multiple mounts", func() {
+ vol1 := filepath.Join(podmanTest.TempDir, "vol-test1")
+ err := os.MkdirAll(vol1, 0755)
+ Expect(err).To(BeNil())
+ vol2 := filepath.Join(podmanTest.TempDir, "vol-test2")
+ err = os.MkdirAll(vol2, 0755)
+ Expect(err).To(BeNil())
+
+ session := podmanTest.Podman([]string{"run", "--mount", "type=bind,src=" + vol1 + ",target=/myvol1,z", "--mount", "type=bind,src=" + vol2 + ",target=/myvol2,z", ALPINE, "touch", "/myvol2/foo.txt"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
+
It("podman run findmnt nothing shared", func() {
vol1 := filepath.Join(podmanTest.TempDir, "vol-test1")
err := os.MkdirAll(vol1, 0755)
diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go
index 2c85ca765..1f06bf4a1 100644
--- a/test/e2e/search_test.go
+++ b/test/e2e/search_test.go
@@ -60,10 +60,10 @@ var _ = Describe("Podman search", func() {
})
It("podman search single registry flag", func() {
- search := podmanTest.Podman([]string{"search", "registry.fedoraproject.org/fedora-minimal"})
+ search := podmanTest.Podman([]string{"search", "registry.fedoraproject.org/fedora"})
search.WaitWithDefaultTimeout()
Expect(search.ExitCode()).To(Equal(0))
- Expect(search.LineInOutputContains("fedoraproject.org/fedora-minimal")).To(BeTrue())
+ Expect(search.LineInOutputContains("fedoraproject.org/fedora")).To(BeTrue())
})
It("podman search format flag", func() {