diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go index b65419569f..2dbc24caec 100644 --- a/test/e2e/healthcheck_run_test.go +++ b/test/e2e/healthcheck_run_test.go @@ -67,10 +67,23 @@ var _ = Describe("Podman healthcheck run", func() { session := podmanTest.Podman([]string{"create", "-q", "--name", "hc", "quay.io/libpod/healthcheck:config-only", "ls"}) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) + + inspect := podmanTest.Podman([]string{"image", "inspect", "quay.io/libpod/healthcheck:config-only", "--format", "{{.ManifestType}}"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect).Should(ExitCleanly()) + manifestType := inspect.OutputToString() + hc := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.Config.Healthcheck}}", "hc"}) hc.WaitWithDefaultTimeout() Expect(hc).Should(ExitCleanly()) - Expect(hc.OutputToString()).To(Equal("{[CMD-SHELL curl -f http://localhost/ || exit 1] 0s 0s 5m0s 3s 0}")) + switch manifestType { + case "application/vnd.docker.distribution.manifest.v2+json": + Expect(hc.OutputToString()).To(Equal("{[CMD-SHELL curl -f http://localhost/ || exit 1] 0s 0s 5m0s 3s 0}")) + case "application/vnd.oci.image.manifest.v1+json": // The image was converted to OCI. This rather defeats the point of the test. + Expect(hc.OutputToString()).To(Equal("")) + default: + Fail(fmt.Sprintf("Unexpected manifest type %q", manifestType)) + } }) It("podman disable healthcheck with --health-cmd=none on valid container", func() { @@ -113,6 +126,19 @@ var _ = Describe("Podman healthcheck run", func() { session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) + inspect := podmanTest.Podman([]string{"image", "inspect", "quay.io/libpod/badhealthcheck:latest", "--format", "{{.ManifestType}}"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect).Should(ExitCleanly()) + manifestType := inspect.OutputToString() + switch manifestType { + case "application/vnd.docker.distribution.manifest.v2+json": + // Proceed + case "application/vnd.oci.image.manifest.v1+json": // The image was converted to OCI. This rather defeats the point of the test. + Skip("Test image was converted to OCI") + default: + Fail(fmt.Sprintf("Unexpected manifest type %q", manifestType)) + } + hc := podmanTest.Podman([]string{"healthcheck", "run", "hc"}) hc.WaitWithDefaultTimeout() Expect(hc).Should(ExitWithError(1, "")) diff --git a/test/e2e/inspect_test.go b/test/e2e/inspect_test.go index be7809bd32..dedda26240 100644 --- a/test/e2e/inspect_test.go +++ b/test/e2e/inspect_test.go @@ -166,6 +166,14 @@ var _ = Describe("Podman inspect", func() { session := podmanTest.Podman([]string{"inspect", "--format=json", HEALTHCHECK_IMAGE}) session.WaitWithDefaultTimeout() imageData := session.InspectImageJSON() + switch imageData[0].ManifestType { + case "application/vnd.docker.distribution.manifest.v2+json": + // Proceed + case "application/vnd.oci.image.manifest.v1+json": // The image was converted to OCI. This rather defeats the point of the test. + Skip("Test image was converted to OCI") + default: + Fail(fmt.Sprintf("Unexpected manifest type %q", imageData[0].ManifestType)) + } Expect(imageData[0].HealthCheck.Timeout).To(BeNumerically("==", 3000000000)) Expect(imageData[0].HealthCheck.Interval).To(BeNumerically("==", 60000000000)) Expect(imageData[0].HealthCheck).To(HaveField("Test", []string{"CMD-SHELL", "curl -f http://localhost/ || exit 1"}))