summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/run_memory_test.go6
-rw-r--r--test/e2e/run_networking_test.go11
-rw-r--r--test/e2e/run_staticip_test.go16
-rw-r--r--test/e2e/run_test.go16
-rw-r--r--test/e2e/search_test.go31
5 files changed, 54 insertions, 26 deletions
diff --git a/test/e2e/run_memory_test.go b/test/e2e/run_memory_test.go
index a45735a8a..d60f2a8cd 100644
--- a/test/e2e/run_memory_test.go
+++ b/test/e2e/run_memory_test.go
@@ -70,7 +70,11 @@ var _ = Describe("Podman run memory", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- Expect(session.OutputToString()).To(Equal("41943040"))
+ if cgroupsv2 {
+ Expect(session.OutputToString()).To(Equal("max"))
+ } else {
+ Expect(session.OutputToString()).To(Equal("41943040"))
+ }
})
It("podman run memory-swappiness test", func() {
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index 5e587b198..5be9db810 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -146,6 +146,17 @@ var _ = Describe("Podman run networking", func() {
Expect(match).Should(BeTrue())
})
+ It("podman run --net container: and --uts container:", func() {
+ ctrName := "ctrToJoin"
+ ctr1 := podmanTest.RunTopContainer(ctrName)
+ ctr1.WaitWithDefaultTimeout()
+ Expect(ctr1.ExitCode()).To(Equal(0))
+
+ ctr2 := podmanTest.Podman([]string{"run", "-d", "--net=container:" + ctrName, "--uts=container:" + ctrName, ALPINE, "true"})
+ ctr2.WaitWithDefaultTimeout()
+ Expect(ctr2.ExitCode()).To(Equal(0))
+ })
+
It("podman run --net container: copies hosts and resolv", func() {
SkipIfRootless()
ctrName := "ctr1"
diff --git a/test/e2e/run_staticip_test.go b/test/e2e/run_staticip_test.go
index 5b4842fea..5ad8f9fb0 100644
--- a/test/e2e/run_staticip_test.go
+++ b/test/e2e/run_staticip_test.go
@@ -3,7 +3,10 @@
package integration
import (
+ "fmt"
+ "net/http"
"os"
+ "time"
. "github.com/containers/libpod/test/utils"
. "github.com/onsi/ginkgo"
@@ -65,9 +68,20 @@ var _ = Describe("Podman run with --ip flag", func() {
It("Podman run two containers with the same IP", func() {
ip := GetRandomIPAddress()
- result := podmanTest.Podman([]string{"run", "-d", "--ip", ip, ALPINE, "sleep", "999"})
+ result := podmanTest.Podman([]string{"run", "-dt", "--ip", ip, nginx})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
+ for i := 0; i < 10; i++ {
+ fmt.Println("Waiting for nginx", err)
+ time.Sleep(1 * time.Second)
+ response, err := http.Get(fmt.Sprintf("http://%s", ip))
+ if err != nil {
+ continue
+ }
+ if response.StatusCode == http.StatusOK {
+ break
+ }
+ }
result = podmanTest.Podman([]string{"run", "-ti", "--ip", ip, ALPINE, "ip", "addr"})
result.WaitWithDefaultTimeout()
Expect(result).To(ExitWithError())
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 3eb93b84a..9b6de6f65 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -374,7 +374,9 @@ var _ = Describe("Podman run", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- Expect(session.OutputToString()).To(ContainSubstring("1048576"))
+ if !cgroupsv2 { // TODO: Test Simplification. For now, we only care about exit(0) w/ cgroupsv2
+ Expect(session.OutputToString()).To(ContainSubstring("1048576"))
+ }
})
It("podman run device-write-bps test", func() {
@@ -392,7 +394,9 @@ var _ = Describe("Podman run", func() {
}
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- Expect(session.OutputToString()).To(ContainSubstring("1048576"))
+ if !cgroupsv2 { // TODO: Test Simplification. For now, we only care about exit(0) w/ cgroupsv2
+ Expect(session.OutputToString()).To(ContainSubstring("1048576"))
+ }
})
It("podman run device-read-iops test", func() {
@@ -411,7 +415,9 @@ var _ = Describe("Podman run", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- Expect(session.OutputToString()).To(ContainSubstring("100"))
+ if !cgroupsv2 { // TODO: Test Simplification. For now, we only care about exit(0) w/ cgroupsv2
+ Expect(session.OutputToString()).To(ContainSubstring("100"))
+ }
})
It("podman run device-write-iops test", func() {
@@ -430,7 +436,9 @@ var _ = Describe("Podman run", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- Expect(session.OutputToString()).To(ContainSubstring("100"))
+ if !cgroupsv2 { // TODO: Test Simplification. For now, we only care about exit(0) w/ cgroupsv2
+ Expect(session.OutputToString()).To(ContainSubstring("100"))
+ }
})
It("podman run notify_socket", func() {
diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go
index a697831ab..6d762d338 100644
--- a/test/e2e/search_test.go
+++ b/test/e2e/search_test.go
@@ -5,15 +5,13 @@ package integration
import (
"bytes"
"fmt"
+ . "github.com/containers/libpod/test/utils"
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
"io/ioutil"
"os"
"strconv"
"text/template"
- "time"
-
- . "github.com/containers/libpod/test/utils"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
)
type endpoint struct {
@@ -165,21 +163,6 @@ registries = ['{{.Host}}:{{.Port}}']`
}
})
- It("podman search v2 registry with empty query", func() {
- var search *PodmanSessionIntegration
- for i := 0; i < 5; i++ {
- search = podmanTest.Podman([]string{"search", "registry.fedoraproject.org/"})
- search.WaitWithDefaultTimeout()
- if search.ExitCode() == 0 {
- break
- }
- fmt.Println("Search failed; sleeping & retrying...")
- time.Sleep(2 * time.Second)
- }
- Expect(search.ExitCode()).To(Equal(0))
- Expect(len(search.OutputToStringArray())).To(BeNumerically(">=", 1))
- })
-
It("podman search attempts HTTP if tls-verify flag is set false", func() {
if podmanTest.Host.Arch == "ppc64le" {
Skip("No registry image for ppc64le")
@@ -234,6 +217,14 @@ registries = ['{{.Host}}:{{.Port}}']`
Expect(search.ExitCode()).To(Equal(0))
Expect(search.OutputToString()).ShouldNot(BeEmpty())
+
+ // podman search v2 registry with empty query
+ searchEmpty := podmanTest.PodmanNoCache([]string{"search", fmt.Sprintf("%s/", registryEndpoints[3].Address()), "--tls-verify=false"})
+ searchEmpty.WaitWithDefaultTimeout()
+ Expect(searchEmpty.ExitCode()).To(BeZero())
+ Expect(len(searchEmpty.OutputToStringArray())).To(BeNumerically(">=", 1))
+ match, _ := search.GrepString("my-alpine")
+ Expect(match).Should(BeTrue())
})
It("podman search attempts HTTP if registry is in registries.insecure and force secure is false", func() {