diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 4c13a45407..4cc1ba576a 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -540,7 +540,7 @@ func (p *PodmanTestIntegration) RunContainerWithNetworkTest(mode string) *Podman if mode != "" { podmanArgs = append(podmanArgs, "--network", mode) } - podmanArgs = append(podmanArgs, fedoraMinimal, "curl", "-k", "-o", "/dev/null", "http://www.redhat.com:80") + podmanArgs = append(podmanArgs, fedoraMinimal, "curl", "-s", "-S", "-k", "-o", "/dev/null", "http://www.redhat.com:80") session := p.Podman(podmanArgs) return session } diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index 86ab218777..d8712547ac 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -20,10 +20,6 @@ import ( var _ = Describe("Podman run networking", func() { - BeforeEach(func() { - Skip("TEMPORARY: to not break git-bisect") - }) - hostname, _ := os.Hostname() It("podman verify network scoped DNS server and also verify updating network dns server", func() { @@ -591,8 +587,8 @@ EXPOSE 2004-2005/tcp`, ALPINE) ncListener.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) - Expect(ncListener).Should(ExitCleanly()) - Expect(ncListener.ErrorToString()).To(ContainSubstring("127.0.0.1")) + Expect(ncListener).Should(Exit(0)) + Expect(ncListener.ErrorToString()).To(ContainSubstring("Connection from 127.0.0.1")) } else { session := podmanTest.Podman([]string{"run", "--network", networkConfiguration, "-dt", ALPINE, "nc", "-w", "2", "10.0.2.2", fmt.Sprintf("%d", port)}) session.WaitWithDefaultTimeout() @@ -621,8 +617,8 @@ EXPOSE 2004-2005/tcp`, ALPINE) ncListener.Wait(30) Expect(session).Should(ExitCleanly()) - Expect(ncListener).Should(ExitCleanly()) - Expect(ncListener.ErrorToString()).To(ContainSubstring(ip.String())) + Expect(ncListener).Should(Exit(0)) + Expect(ncListener.ErrorToString()).To(ContainSubstring("Connection from " + ip.String())) } else { session := podmanTest.Podman([]string{"run", "--network", networkConfiguration, ALPINE, "nc", "-w", "2", "10.0.2.2", fmt.Sprintf("%d", port)}) session.Wait(30) @@ -662,7 +658,7 @@ EXPOSE 2004-2005/tcp`, ALPINE) SkipIfRootless("sctp protocol only works as root") session := podmanTest.Podman([]string{"--log-level=info", "run", "--name=test", "-p", "80/sctp", "-p", "81/sctp", ALPINE}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) // we can only check logrus on local podman if !IsRemote() { // check that the info message for sctp protocol is only displayed once @@ -1101,6 +1097,7 @@ EXPOSE 2004-2005/tcp`, ALPINE) }) It("podman run check dns", func() { + SkipIfCNI(podmanTest) pod := "testpod" session := podmanTest.Podman([]string{"pod", "create", "--name", pod}) session.WaitWithDefaultTimeout() @@ -1118,24 +1115,24 @@ EXPOSE 2004-2005/tcp`, ALPINE) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) - session = podmanTest.Podman([]string{"run", "--name", "con1", "--network", net, ALPINE, "nslookup", "con1"}) + session = podmanTest.Podman([]string{"run", "--name", "con1", "--network", net, CITEST_IMAGE, "nslookup", "con1"}) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) - session = podmanTest.Podman([]string{"run", "--name", "con2", "--pod", pod, "--network", net, ALPINE, "nslookup", "con2"}) + session = podmanTest.Podman([]string{"run", "--name", "con2", "--pod", pod, "--network", net, CITEST_IMAGE, "nslookup", "con2"}) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) - session = podmanTest.Podman([]string{"run", "--name", "con3", "--pod", pod2, ALPINE, "nslookup", "con1"}) + session = podmanTest.Podman([]string{"run", "--name", "con3", "--pod", pod2, CITEST_IMAGE, "nslookup", "con1"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(1)) - Expect(session.ErrorToString()).To(ContainSubstring("can't resolve 'con1'")) + Expect(session.OutputToString()).To(ContainSubstring("server can't find con1.dns.podman: NXDOMAIN")) - session = podmanTest.Podman([]string{"run", "--name", "con4", "--network", net, ALPINE, "nslookup", pod2 + ".dns.podman"}) + session = podmanTest.Podman([]string{"run", "--name", "con4", "--network", net, CITEST_IMAGE, "nslookup", pod2 + ".dns.podman"}) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) - session = podmanTest.Podman([]string{"run", "--network", net, ALPINE, "nslookup", hostname}) + session = podmanTest.Podman([]string{"run", "--network", net, CITEST_IMAGE, "nslookup", hostname}) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) }) diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 02d6bec16f..0b65122c9c 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -22,10 +22,6 @@ import ( var _ = Describe("Podman run", func() { - BeforeEach(func() { - Skip("TEMPORARY: to not break git-bisect") - }) - It("podman run a container based on local image", func() { session := podmanTest.Podman([]string{"run", ALPINE, "ls"}) session.WaitWithDefaultTimeout() @@ -90,7 +86,7 @@ var _ = Describe("Podman run", func() { session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) - session = podmanTest.Podman([]string{"build", "-f", "build/Containerfile.with-platform", "--platform", "linux/amd64,linux/arm64", "--manifest", "localhost/test:latest"}) + session = podmanTest.Podman([]string{"build", "-q", "-f", "build/Containerfile.with-platform", "--platform", "linux/amd64,linux/arm64", "--manifest", "localhost/test:latest"}) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) @@ -127,7 +123,8 @@ var _ = Describe("Podman run", func() { Expect(session).To(ExitWithError()) Expect(session.ErrorToString()).To(ContainSubstring("unknown flag")) } else { - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) + Expect(session.ErrorToString()).To(ContainSubstring("Getting image source signatures")) } }) @@ -1509,14 +1506,16 @@ VOLUME %s`, ALPINE, volPath, volPath) container := podmanTest.PodmanSystemdScope([]string{"run", "--rm", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup"}) container.WaitWithDefaultTimeout() - Expect(container).Should(ExitCleanly()) + Expect(container).Should(Exit(0)) checkLines(container.OutputToStringArray()) + Expect(container.ErrorToString()).To(ContainSubstring("Running scope as unit: ")) // check that --cgroups=split is honored also when a container runs in a pod container = podmanTest.PodmanSystemdScope([]string{"run", "--rm", "--pod", "new:split-test-pod", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup"}) container.WaitWithDefaultTimeout() - Expect(container).Should(ExitCleanly()) + Expect(container).Should(Exit(0)) checkLines(container.OutputToStringArray()) + Expect(container.ErrorToString()).To(ContainSubstring("Running scope as unit: ")) }) It("podman run with cgroups=disabled runs without cgroups", func() { @@ -1749,13 +1748,15 @@ WORKDIR /madethis`, BB) It("podman run a container with log-level (lower case)", func() { session := podmanTest.Podman([]string{"--log-level=info", "run", ALPINE, "ls"}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) + Expect(session.ErrorToString()).To(ContainSubstring(" level=info ")) }) It("podman run a container with log-level (upper case)", func() { session := podmanTest.Podman([]string{"--log-level=INFO", "run", ALPINE, "ls"}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) + Expect(session.ErrorToString()).To(ContainSubstring(" level=info ")) }) It("podman run a container with --pull never should fail if no local store", func() { @@ -1767,24 +1768,23 @@ WORKDIR /madethis`, BB) It("podman run container with --pull missing and only pull once", func() { session := podmanTest.Podman([]string{"run", "--pull", "missing", CIRROS_IMAGE, "ls"}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) Expect(session.ErrorToString()).To(ContainSubstring("Trying to pull")) session = podmanTest.Podman([]string{"run", "--pull", "missing", CIRROS_IMAGE, "ls"}) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) - Expect(session.ErrorToString()).ToNot(ContainSubstring("Trying to pull")) }) It("podman run container with --pull missing should pull image multiple times", func() { session := podmanTest.Podman([]string{"run", "--pull", "always", CIRROS_IMAGE, "ls"}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) Expect(session.ErrorToString()).To(ContainSubstring("Trying to pull")) session = podmanTest.Podman([]string{"run", "--pull", "always", CIRROS_IMAGE, "ls"}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) Expect(session.ErrorToString()).To(ContainSubstring("Trying to pull")) }) @@ -2095,7 +2095,7 @@ WORKDIR /madethis`, BB) session = podmanTest.Podman([]string{"run", "--decryption-key", privateKeyFileName, imgPath}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) Expect(session.ErrorToString()).To(ContainSubstring("Trying to pull")) }) diff --git a/test/e2e/runlabel_test.go b/test/e2e/runlabel_test.go index 3937e84413..488b0b6ef8 100644 --- a/test/e2e/runlabel_test.go +++ b/test/e2e/runlabel_test.go @@ -23,7 +23,6 @@ LABEL RUN podman run --name NAME IMAGE`, ALPINE) var _ = Describe("podman container runlabel", func() { BeforeEach(func() { - Skip("TEMPORARY: to not break git-bisect") SkipIfRemote("runlabel is not supported for remote connections") })