mirror of
https://github.com/containers/podman.git
synced 2026-07-20 12:12:09 -04:00
e2e: more ExitCleanly(): manual test fixes
Commit 2 of 2: manual fixes to get tests to pass. Mostly adding "-q", but in some cases reverting back to Exit(0) with progress-message checks. Plus, fix a typo in an error message Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@@ -67,7 +67,7 @@ func rm(cmd *cobra.Command, args []string) error {
|
||||
deletedFarms := []string{}
|
||||
for _, k := range args {
|
||||
if _, ok := cfg.Farms.List[k]; !ok {
|
||||
logrus.Warnf("farm %q doesn't exists; nothing to remove", k)
|
||||
logrus.Warnf("farm %q doesn't exist; nothing to remove", k)
|
||||
continue
|
||||
}
|
||||
delete(cfg.Farms.List, k)
|
||||
|
||||
@@ -312,7 +312,8 @@ var _ = Describe("Podman exec", func() {
|
||||
It("podman exec terminal doesn't hang", FlakeAttempts(3), func() {
|
||||
setup := podmanTest.Podman([]string{"run", "-dti", "--name", "test1", fedoraMinimal, "sleep", "+Inf"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup.ErrorToString()).To(ContainSubstring("The input device is not a TTY. The --tty and --interactive flags might not work properly"))
|
||||
|
||||
for i := 0; i < 5; i++ {
|
||||
session := podmanTest.Podman([]string{"exec", "-ti", "test1", "true"})
|
||||
@@ -453,7 +454,7 @@ var _ = Describe("Podman exec", func() {
|
||||
Expect(ctr1).Should(ExitCleanly())
|
||||
|
||||
imgName := "img1"
|
||||
commit := podmanTest.Podman([]string{"commit", ctrName1, imgName})
|
||||
commit := podmanTest.Podman([]string{"commit", "-q", ctrName1, imgName})
|
||||
commit.WaitWithDefaultTimeout()
|
||||
Expect(commit).Should(ExitCleanly())
|
||||
|
||||
@@ -541,7 +542,7 @@ RUN useradd -u 1000 auser`, fedoraMinimal)
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring(secretsString))
|
||||
|
||||
session = podmanTest.Podman([]string{"commit", "secr", "foobar.com/test1-image:latest"})
|
||||
session = podmanTest.Podman([]string{"commit", "-q", "secr", "foobar.com/test1-image:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
. "github.com/containers/podman/v4/test/utils"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
. "github.com/onsi/gomega/gexec"
|
||||
)
|
||||
|
||||
func setupContainersConfWithSystemConnections() {
|
||||
@@ -181,8 +182,9 @@ var _ = Describe("podman farm", func() {
|
||||
cmd = []string{"farm", "rm", "farm1", "nonexistent-farm"}
|
||||
session = podmanTest.Podman(cmd)
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.Out.Contents()).Should(ContainSubstring("Farm \"farm1\" deleted"))
|
||||
Expect(session.ErrorToString()).Should(ContainSubstring("doesn't exist; nothing to remove"))
|
||||
|
||||
cfg, err = config.ReadCustomConfig()
|
||||
Expect(err).ShouldNot(HaveOccurred())
|
||||
|
||||
@@ -65,7 +65,7 @@ var _ = Describe("Podman healthcheck run", func() {
|
||||
It("podman healthcheck from image's config (not container config)", func() {
|
||||
// Regression test for #12226: a health check may be defined in
|
||||
// the container or the container-config of an image.
|
||||
session := podmanTest.Podman([]string{"create", "--name", "hc", "quay.io/libpod/healthcheck:config-only", "ls"})
|
||||
session := podmanTest.Podman([]string{"create", "-q", "--name", "hc", "quay.io/libpod/healthcheck:config-only", "ls"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
hc := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.Config.Healthcheck}}", "hc"})
|
||||
@@ -110,7 +110,7 @@ var _ = Describe("Podman healthcheck run", func() {
|
||||
})
|
||||
|
||||
It("podman healthcheck that should fail", func() {
|
||||
session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "quay.io/libpod/badhealthcheck:latest"})
|
||||
session := podmanTest.Podman([]string{"run", "-q", "-dt", "--name", "hc", "quay.io/libpod/badhealthcheck:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ WORKDIR /test
|
||||
// Prevent regressing on issue #7651: error parsing name that includes a digest
|
||||
// component as if were a name that includes tag component.
|
||||
digestPullAndList := func(noneTag bool) {
|
||||
session := podmanTest.Podman([]string{"pull", ALPINEAMD64DIGEST})
|
||||
session := podmanTest.Podman([]string{"pull", "-q", ALPINEAMD64DIGEST})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
@@ -217,7 +217,7 @@ WORKDIR /test
|
||||
// the additional image store we're using. Pull the same image by another name to
|
||||
// copy an entry for the image into read-write storage so that the name can be
|
||||
// attached to it.
|
||||
session := podmanTest.Podman([]string{"pull", ALPINELISTTAG})
|
||||
session := podmanTest.Podman([]string{"pull", "-q", ALPINELISTTAG})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
digestPullAndList(false)
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
. "github.com/containers/podman/v4/test/utils"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
. "github.com/onsi/gomega/gexec"
|
||||
)
|
||||
|
||||
var _ = Describe("Podman import", func() {
|
||||
@@ -21,7 +22,14 @@ var _ = Describe("Podman import", func() {
|
||||
|
||||
importImage := podmanTest.Podman([]string{"import", outfile, "foobar.com/imported-image:latest"})
|
||||
importImage.WaitWithDefaultTimeout()
|
||||
Expect(importImage).Should(ExitCleanly())
|
||||
Expect(importImage).Should(Exit(0))
|
||||
if !IsRemote() {
|
||||
messages := importImage.ErrorToString()
|
||||
Expect(messages).Should(ContainSubstring("Getting image source signatures"))
|
||||
Expect(messages).Should(ContainSubstring("Copying blob"))
|
||||
Expect(messages).Should(ContainSubstring("Writing manifest to image destination"))
|
||||
Expect(messages).Should(Not(ContainSubstring("level=")), "Unexpected logrus messages in stderr")
|
||||
}
|
||||
|
||||
results := podmanTest.Podman([]string{"inspect", "--type", "image", "foobar.com/imported-image:latest"})
|
||||
results.WaitWithDefaultTimeout()
|
||||
@@ -37,7 +45,7 @@ var _ = Describe("Podman import", func() {
|
||||
export.WaitWithDefaultTimeout()
|
||||
Expect(export).Should(ExitCleanly())
|
||||
|
||||
importImage := podmanTest.Podman([]string{"import", "--os", "testos", "--arch", "testarch", outfile, "foobar.com/imported-image:latest"})
|
||||
importImage := podmanTest.Podman([]string{"import", "-q", "--os", "testos", "--arch", "testarch", outfile, "foobar.com/imported-image:latest"})
|
||||
importImage.WaitWithDefaultTimeout()
|
||||
Expect(importImage).Should(ExitCleanly())
|
||||
|
||||
@@ -57,7 +65,7 @@ var _ = Describe("Podman import", func() {
|
||||
export.WaitWithDefaultTimeout()
|
||||
Expect(export).Should(ExitCleanly())
|
||||
|
||||
importImage := podmanTest.Podman([]string{"import", outfile})
|
||||
importImage := podmanTest.Podman([]string{"import", "-q", outfile})
|
||||
importImage.WaitWithDefaultTimeout()
|
||||
Expect(importImage).Should(ExitCleanly())
|
||||
|
||||
@@ -76,7 +84,7 @@ var _ = Describe("Podman import", func() {
|
||||
export.WaitWithDefaultTimeout()
|
||||
Expect(export).Should(ExitCleanly())
|
||||
|
||||
importImage := podmanTest.Podman([]string{"import", "--message", "importing container test message", outfile, "imported-image"})
|
||||
importImage := podmanTest.Podman([]string{"import", "-q", "--message", "importing container test message", outfile, "imported-image"})
|
||||
importImage.WaitWithDefaultTimeout()
|
||||
Expect(importImage).Should(ExitCleanly())
|
||||
|
||||
@@ -95,7 +103,7 @@ var _ = Describe("Podman import", func() {
|
||||
export.WaitWithDefaultTimeout()
|
||||
Expect(export).Should(ExitCleanly())
|
||||
|
||||
importImage := podmanTest.Podman([]string{"import", "--change", "CMD=/bin/bash", outfile, "imported-image"})
|
||||
importImage := podmanTest.Podman([]string{"import", "-q", "--change", "CMD=/bin/bash", outfile, "imported-image"})
|
||||
importImage.WaitWithDefaultTimeout()
|
||||
Expect(importImage).Should(ExitCleanly())
|
||||
|
||||
@@ -117,7 +125,7 @@ var _ = Describe("Podman import", func() {
|
||||
export.WaitWithDefaultTimeout()
|
||||
Expect(export).Should(ExitCleanly())
|
||||
|
||||
importImage := podmanTest.Podman([]string{"import", "--change", "CMD /bin/sh", outfile, "imported-image"})
|
||||
importImage := podmanTest.Podman([]string{"import", "-q", "--change", "CMD /bin/sh", outfile, "imported-image"})
|
||||
importImage.WaitWithDefaultTimeout()
|
||||
Expect(importImage).Should(ExitCleanly())
|
||||
|
||||
@@ -139,7 +147,7 @@ var _ = Describe("Podman import", func() {
|
||||
export.WaitWithDefaultTimeout()
|
||||
Expect(export).Should(ExitCleanly())
|
||||
|
||||
importImage := podmanTest.Podman([]string{"import", "--change", "CMD [\"/bin/bash\"]", outfile, "imported-image"})
|
||||
importImage := podmanTest.Podman([]string{"import", "-q", "--change", "CMD [\"/bin/bash\"]", outfile, "imported-image"})
|
||||
importImage.WaitWithDefaultTimeout()
|
||||
Expect(importImage).Should(ExitCleanly())
|
||||
|
||||
@@ -161,16 +169,16 @@ var _ = Describe("Podman import", func() {
|
||||
export.WaitWithDefaultTimeout()
|
||||
Expect(export).Should(ExitCleanly())
|
||||
|
||||
importImage := podmanTest.Podman([]string{"import", "--signature-policy", "/no/such/file", outfile})
|
||||
importImage := podmanTest.Podman([]string{"import", "-q", "--signature-policy", "/no/such/file", outfile})
|
||||
importImage.WaitWithDefaultTimeout()
|
||||
Expect(importImage).To(ExitWithError())
|
||||
|
||||
result := podmanTest.Podman([]string{"import", "--signature-policy", "/etc/containers/policy.json", outfile})
|
||||
result := podmanTest.Podman([]string{"import", "-q", "--signature-policy", "/etc/containers/policy.json", outfile})
|
||||
result.WaitWithDefaultTimeout()
|
||||
if IsRemote() {
|
||||
Expect(result).To(ExitWithError())
|
||||
Expect(result.ErrorToString()).To(ContainSubstring("unknown flag"))
|
||||
result := podmanTest.Podman([]string{"import", outfile})
|
||||
result := podmanTest.Podman([]string{"import", "-q", outfile})
|
||||
result.WaitWithDefaultTimeout()
|
||||
}
|
||||
Expect(result).Should(ExitCleanly())
|
||||
|
||||
Reference in New Issue
Block a user