Skip to content

Commit

Permalink
Merge pull request #23533 from edsantiago/fix-containerport-flake
Browse files Browse the repository at this point in the history
CI: e2e: serialize root containerPort tests
  • Loading branch information
openshift-merge-bot[bot] authored Aug 8, 2024
2 parents 9939f65 + 1a2e1eb commit c053194
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions test/e2e/play_kube_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5761,15 +5761,30 @@ spec:
Expect(kube).Should(ExitWithError(125, "rootlessport cannot expose privileged port 80"))
})

It("podman play kube should not publish containerPort by default", func() {
err := writeYaml(publishPortsPodWithContainerPort, kubeYaml)
Expect(err).ToNot(HaveOccurred())
// Prevent these two tests from running in parallel
Describe("with containerPort", Serial, func() {
It("should not publish containerPort by default", func() {
err := writeYaml(publishPortsPodWithContainerPort, kubeYaml)
Expect(err).ToNot(HaveOccurred())

kube := podmanTest.Podman([]string{"kube", "play", kubeYaml})
kube.WaitWithDefaultTimeout()
Expect(kube).Should(Exit(0))
kube := podmanTest.Podman([]string{"kube", "play", kubeYaml})
kube.WaitWithDefaultTimeout()
Expect(kube).Should(Exit(0))

testHTTPServer("80", true, "connection refused")
})

It("should publish containerPort with --publish-all", func() {
SkipIfRootless("rootlessport can't expose privileged port 80")
err := writeYaml(publishPortsPodWithContainerPort, kubeYaml)
Expect(err).ToNot(HaveOccurred())

testHTTPServer("80", true, "connection refused")
kube := podmanTest.Podman([]string{"kube", "play", "--publish-all=true", kubeYaml})
kube.WaitWithDefaultTimeout()
Expect(kube).Should(Exit(0))

testHTTPServer("80", false, "podman rulez")
})
})

It("with privileged containers ports and publish in command line - curl should succeed", func() {
Expand All @@ -5783,18 +5798,6 @@ spec:
testHTTPServer("19003", false, "podman rulez")
})

It("podman play kube should publish containerPort with --publish-all", func() {
SkipIfRootless("rootlessport can't expose privileged port 80")
err := writeYaml(publishPortsPodWithContainerPort, kubeYaml)
Expect(err).ToNot(HaveOccurred())

kube := podmanTest.Podman([]string{"kube", "play", "--publish-all=true", kubeYaml})
kube.WaitWithDefaultTimeout()
Expect(kube).Should(Exit(0))

testHTTPServer("80", false, "podman rulez")
})

It("with Host Ports - curl should succeed", func() {
err := writeYaml(publishPortsPodWithContainerHostPort, kubeYaml)
Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit c053194

Please sign in to comment.