Merge pull request #9385 from baude/fixci

Fixci
This commit is contained in:
OpenShift Merge Robot 2021-02-16 03:44:25 -05:00 committed by GitHub
commit df8ba7f4a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 7 deletions

View File

@ -194,7 +194,7 @@ WORKDIR /test
result := podmanTest.Podman([]string{"images", "-q", "-f", "since=quay.io/libpod/alpine:latest"}) result := podmanTest.Podman([]string{"images", "-q", "-f", "since=quay.io/libpod/alpine:latest"})
result.WaitWithDefaultTimeout() result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0)) Expect(result).Should(Exit(0))
Expect(len(result.OutputToStringArray())).To(Equal(7)) Expect(len(result.OutputToStringArray())).To(Equal(8))
}) })
It("podman image list filter after image", func() { It("podman image list filter after image", func() {
@ -204,7 +204,7 @@ WORKDIR /test
result := podmanTest.Podman([]string{"image", "list", "-q", "-f", "after=quay.io/libpod/alpine:latest"}) result := podmanTest.Podman([]string{"image", "list", "-q", "-f", "after=quay.io/libpod/alpine:latest"})
result.WaitWithDefaultTimeout() result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0)) Expect(result).Should(Exit(0))
Expect(result.OutputToStringArray()).Should(HaveLen(7), "list filter output: %q", result.OutputToString()) Expect(result.OutputToStringArray()).Should(HaveLen(8), "list filter output: %q", result.OutputToString())
}) })
It("podman images filter dangling", func() { It("podman images filter dangling", func() {

View File

@ -407,6 +407,7 @@ var _ = Describe("Podman network", func() {
Expect(lines[0]).To(Equal(netName1)) Expect(lines[0]).To(Equal(netName1))
Expect(lines[1]).To(Equal(netName2)) Expect(lines[1]).To(Equal(netName2))
}) })
It("podman network with multiple aliases", func() { It("podman network with multiple aliases", func() {
var worked bool var worked bool
netName := "aliasTest" + stringid.GenerateNonCryptoID() netName := "aliasTest" + stringid.GenerateNonCryptoID()
@ -415,16 +416,28 @@ var _ = Describe("Podman network", func() {
defer podmanTest.removeCNINetwork(netName) defer podmanTest.removeCNINetwork(netName)
Expect(session.ExitCode()).To(BeZero()) Expect(session.ExitCode()).To(BeZero())
interval := time.Duration(250 * time.Millisecond)
for i := 0; i < 6; i++ {
n := podmanTest.Podman([]string{"network", "exists", netName})
n.WaitWithDefaultTimeout()
worked = n.ExitCode() == 0
if worked {
break
}
time.Sleep(interval)
interval *= 2
}
top := podmanTest.Podman([]string{"run", "-dt", "--name=web", "--network=" + netName, "--network-alias=web1", "--network-alias=web2", nginx}) top := podmanTest.Podman([]string{"run", "-dt", "--name=web", "--network=" + netName, "--network-alias=web1", "--network-alias=web2", nginx})
top.WaitWithDefaultTimeout() top.WaitWithDefaultTimeout()
Expect(top.ExitCode()).To(BeZero()) Expect(top.ExitCode()).To(BeZero())
interval := time.Duration(250 * time.Millisecond) interval = time.Duration(250 * time.Millisecond)
// Wait for the nginx service to be running // Wait for the nginx service to be running
for i := 0; i < 6; i++ { for i := 0; i < 6; i++ {
// Test curl against the container's name // Test curl against the container's name
c1 := podmanTest.Podman([]string{"run", "--network=" + netName, nginx, "curl", "web"}) c1 := podmanTest.Podman([]string{"run", "--dns-search", "dns.podman", "--network=" + netName, nginx, "curl", "web"})
c1.WaitWithDefaultTimeout() c1.WaitWithDefaultTimeout()
worked = Expect(c1.ExitCode()).To(BeZero()) worked = c1.ExitCode() == 0
if worked { if worked {
break break
} }
@ -435,12 +448,12 @@ var _ = Describe("Podman network", func() {
// Nginx is now running so no need to do a loop // Nginx is now running so no need to do a loop
// Test against the first alias // Test against the first alias
c2 := podmanTest.Podman([]string{"run", "--network=" + netName, nginx, "curl", "web1"}) c2 := podmanTest.Podman([]string{"run", "--dns-search", "dns.podman", "--network=" + netName, nginx, "curl", "web1"})
c2.WaitWithDefaultTimeout() c2.WaitWithDefaultTimeout()
Expect(c2.ExitCode()).To(BeZero()) Expect(c2.ExitCode()).To(BeZero())
// Test against the second alias // Test against the second alias
c3 := podmanTest.Podman([]string{"run", "--network=" + netName, nginx, "curl", "web2"}) c3 := podmanTest.Podman([]string{"run", "--dns-search", "dns.podman", "--network=" + netName, nginx, "curl", "web2"})
c3.WaitWithDefaultTimeout() c3.WaitWithDefaultTimeout()
Expect(c3.ExitCode()).To(BeZero()) Expect(c3.ExitCode()).To(BeZero())
}) })