summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/config.go1
-rw-r--r--test/e2e/config_amd64.go2
-rw-r--r--test/e2e/healthcheck_run_test.go85
-rw-r--r--test/e2e/images_test.go27
-rw-r--r--test/e2e/pod_infra_container_test.go17
-rw-r--r--test/e2e/run_device_test.go8
6 files changed, 139 insertions, 1 deletions
diff --git a/test/e2e/config.go b/test/e2e/config.go
index 8116d993b..3fdb9e116 100644
--- a/test/e2e/config.go
+++ b/test/e2e/config.go
@@ -6,4 +6,5 @@ var (
ALPINE = "docker.io/library/alpine:latest"
infra = "k8s.gcr.io/pause:3.1"
BB = "docker.io/library/busybox:latest"
+ healthcheck = "docker.io/libpod/alpine_healthcheck:latest"
)
diff --git a/test/e2e/config_amd64.go b/test/e2e/config_amd64.go
index 3459bea6d..d02de7a6e 100644
--- a/test/e2e/config_amd64.go
+++ b/test/e2e/config_amd64.go
@@ -3,7 +3,7 @@ package integration
var (
STORAGE_OPTIONS = "--storage-driver vfs"
ROOTLESS_STORAGE_OPTIONS = "--storage-driver vfs"
- CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, nginx, redis, registry, infra, labels}
+ CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, nginx, redis, registry, infra, labels, healthcheck}
nginx = "quay.io/libpod/alpine_nginx:latest"
BB_GLIBC = "docker.io/library/busybox:glibc"
registry = "docker.io/library/registry:2"
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go
new file mode 100644
index 000000000..921d325c3
--- /dev/null
+++ b/test/e2e/healthcheck_run_test.go
@@ -0,0 +1,85 @@
+// +build !remoteclient
+
+package integration
+
+import (
+ "fmt"
+ "os"
+
+ . "github.com/containers/libpod/test/utils"
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+)
+
+var _ = Describe("Podman healthcheck run", func() {
+ var (
+ tempdir string
+ err error
+ podmanTest *PodmanTestIntegration
+ )
+
+ BeforeEach(func() {
+ tempdir, err = CreateTempDirInTempDir()
+ if err != nil {
+ os.Exit(1)
+ }
+ podmanTest = PodmanTestCreate(tempdir)
+ podmanTest.RestoreAllArtifacts()
+ })
+
+ AfterEach(func() {
+ podmanTest.Cleanup()
+ f := CurrentGinkgoTestDescription()
+ timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
+ GinkgoWriter.Write([]byte(timedResult))
+
+ })
+
+ It("podman healthcheck run bogus container", func() {
+ session := podmanTest.Podman([]string{"healthcheck", "run", "foobar"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+ })
+
+ It("podman healthcheck on valid container", func() {
+ podmanTest.RestoreArtifact(healthcheck)
+ session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", healthcheck})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ hc := podmanTest.Podman([]string{"healthcheck", "run", "hc"})
+ hc.WaitWithDefaultTimeout()
+ Expect(hc.ExitCode()).To(Equal(0))
+ })
+
+ It("podman healthcheck that should fail", func() {
+ session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "docker.io/libpod/badhealthcheck:latest"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ hc := podmanTest.Podman([]string{"healthcheck", "run", "hc"})
+ hc.WaitWithDefaultTimeout()
+ Expect(hc.ExitCode()).To(Equal(1))
+ })
+
+ It("podman healthcheck on stopped container", func() {
+ podmanTest.RestoreArtifact(healthcheck)
+ session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", healthcheck, "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ hc := podmanTest.Podman([]string{"healthcheck", "run", "hc"})
+ hc.WaitWithDefaultTimeout()
+ Expect(hc.ExitCode()).To(Equal(125))
+ })
+
+ It("podman healthcheck on container without healthcheck", func() {
+ session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ hc := podmanTest.Podman([]string{"healthcheck", "run", "hc"})
+ hc.WaitWithDefaultTimeout()
+ Expect(hc.ExitCode()).To(Equal(125))
+ })
+})
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go
index e26f4affd..4cf58e5bf 100644
--- a/test/e2e/images_test.go
+++ b/test/e2e/images_test.go
@@ -114,6 +114,33 @@ var _ = Describe("Podman images", func() {
Expect(len(session.OutputToStringArray())).To(Equal(1))
})
+ It("podman images filter reference", func() {
+ if podmanTest.RemoteTest {
+ Skip("Does not work on remote client")
+ }
+ result := podmanTest.Podman([]string{"images", "-q", "-f", "reference=docker.io*"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ Expect(len(result.OutputToStringArray())).To(Equal(2))
+
+ retapline := podmanTest.Podman([]string{"images", "-f", "reference=a*pine"})
+ retapline.WaitWithDefaultTimeout()
+ Expect(retapline.ExitCode()).To(Equal(0))
+ Expect(len(retapline.OutputToStringArray())).To(Equal(2))
+ Expect(retapline.LineInOutputContains("alpine"))
+
+ retapline = podmanTest.Podman([]string{"images", "-f", "reference=alpine"})
+ retapline.WaitWithDefaultTimeout()
+ Expect(retapline.ExitCode()).To(Equal(0))
+ Expect(len(retapline.OutputToStringArray())).To(Equal(2))
+ Expect(retapline.LineInOutputContains("alpine"))
+
+ retnone := podmanTest.Podman([]string{"images", "-q", "-f", "reference=bogus"})
+ retnone.WaitWithDefaultTimeout()
+ Expect(retnone.ExitCode()).To(Equal(0))
+ Expect(len(retnone.OutputToStringArray())).To(Equal(0))
+ })
+
It("podman images filter before image", func() {
if podmanTest.RemoteTest {
Skip("Does not work on remote client")
diff --git a/test/e2e/pod_infra_container_test.go b/test/e2e/pod_infra_container_test.go
index ed5002ca7..d9e5d380a 100644
--- a/test/e2e/pod_infra_container_test.go
+++ b/test/e2e/pod_infra_container_test.go
@@ -360,4 +360,21 @@ var _ = Describe("Podman pod create", func() {
Expect(result.OutputToString()).To(ContainSubstring(infraID))
})
+
+ It("podman run --add-host in pod", func() {
+ session := podmanTest.Podman([]string{"pod", "create"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ podID := session.OutputToString()
+
+ // verify we can add a host to the infra's /etc/hosts
+ session = podmanTest.Podman([]string{"run", "--pod", podID, "--add-host", "foobar:127.0.0.1", BB, "ping", "-c", "1", "foobar"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ // verify we can see the other hosts of infra's /etc/hosts
+ session = podmanTest.Podman([]string{"run", "--pod", podID, BB, "ping", "-c", "1", "foobar"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
})
diff --git a/test/e2e/run_device_test.go b/test/e2e/run_device_test.go
index 4f26ac8ee..8734bb71c 100644
--- a/test/e2e/run_device_test.go
+++ b/test/e2e/run_device_test.go
@@ -72,4 +72,12 @@ var _ = Describe("Podman run device", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Not(Equal(0)))
})
+
+ It("podman run device host device and container device parameter are directories", func() {
+ SystemExec("mkdir", []string{"/dev/foodevdir"})
+ SystemExec("mknod", []string{"/dev/foodevdir/null", "c", "1", "3"})
+ session := podmanTest.Podman([]string{"run", "-q", "--device", "/dev/foodevdir:/dev/bar", ALPINE, "ls", "/dev/bar/null"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
})