e2e: ExitCleanly(): the final fron^Wcommit

Final push on RUN-1907. Commit 1 of 2.

This is the final set of test/e2e/*_test.go files to be
converted from Exit(0) to ExitCleanly().

This commit is a mix of automated string-replace with
manual revert-back: tests that did not pass with ExitCleanly()
are reverted back to Exit(0), so they will not show up as
diffs in this commit. When possible, I address those in
my next commit.

My goal was to make this commit a don't-bother-reviewing one
that will also pass tests (so as not to break git-bisect).
The next commit is the important one to review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2023-09-27 07:49:20 -06:00
parent b4d66a9396
commit 611db19b31
9 changed files with 159 additions and 158 deletions

View File

@ -39,7 +39,7 @@ var _ = Describe("podman system connection", func() {
}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out.Contents()).Should(BeEmpty())
cfg, err := config.ReadCustomConfig()
@ -57,7 +57,7 @@ var _ = Describe("podman system connection", func() {
}
session = podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(config.ReadCustomConfig()).Should(HaveActiveService("QE"))
})
@ -103,7 +103,7 @@ var _ = Describe("podman system connection", func() {
}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out.Contents()).Should(BeEmpty())
Expect(config.ReadCustomConfig()).Should(VerifyService(
@ -127,7 +127,7 @@ var _ = Describe("podman system connection", func() {
}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out.Contents()).Should(BeEmpty())
cfg, err = config.ReadCustomConfig()
@ -146,7 +146,7 @@ var _ = Describe("podman system connection", func() {
cmd := []string{"farm", "create", "empty-farm"}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out.Contents()).Should(ContainSubstring("Farm \"empty-farm\" created"))
cfg, err := config.ReadCustomConfig()
@ -162,7 +162,7 @@ var _ = Describe("podman system connection", func() {
}
session = podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out.Contents()).Should(BeEmpty())
cfg, err = config.ReadCustomConfig()
@ -190,7 +190,7 @@ var _ = Describe("podman system connection", func() {
}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out.Contents()).Should(BeEmpty())
cfg, err = config.ReadCustomConfig()
@ -206,7 +206,7 @@ var _ = Describe("podman system connection", func() {
// Remove the QA connection
session = podmanTest.Podman([]string{"system", "connection", "remove", "QA"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out.Contents()).Should(BeEmpty())
cfg, err = config.ReadCustomConfig()
@ -224,13 +224,13 @@ var _ = Describe("podman system connection", func() {
"ssh://root@podman.test:2222/run/podman/podman.sock",
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// two passes to test that removing non-existent connection is not an error
for i := 0; i < 2; i++ {
session = podmanTest.Podman([]string{"system", "connection", "remove", "QA"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out.Contents()).Should(BeEmpty())
cfg, err := config.ReadCustomConfig()
@ -248,17 +248,17 @@ var _ = Describe("podman system connection", func() {
"ssh://root@podman.test:2222/run/podman/podman.sock",
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"system", "connection", "remove", "--all"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out.Contents()).Should(BeEmpty())
Expect(session.Err.Contents()).Should(BeEmpty())
session = podmanTest.Podman([]string{"system", "connection", "list"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("default", func() {
@ -271,13 +271,13 @@ var _ = Describe("podman system connection", func() {
}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
}
cmd := []string{"system", "connection", "default", "devl"}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out.Contents()).Should(BeEmpty())
Expect(config.ReadCustomConfig()).Should(HaveActiveService("devl"))
@ -285,13 +285,13 @@ var _ = Describe("podman system connection", func() {
cmd = []string{"system", "connection", "list"}
session = podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.Out).Should(Say("Name *URI *Identity *Default"))
cmd = []string{"system", "connection", "list", "--format", "{{.Name}}"}
session = podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.OutputToString()).Should(Equal("devl qe"))
})
@ -299,7 +299,7 @@ var _ = Describe("podman system connection", func() {
cmd := []string{"system", "connection", "default", "devl"}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).ShouldNot(Exit(0))
Expect(session).ShouldNot(ExitCleanly())
Expect(session.Err).Should(Say("destination is not defined"))
})
@ -307,7 +307,7 @@ var _ = Describe("podman system connection", func() {
cmd := []string{"system", "connection", "rename", "devl", "QE"}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).ShouldNot(Exit(0))
Expect(session).ShouldNot(ExitCleanly())
Expect(session.Err).Should(Say("destination is not defined"))
})
@ -315,7 +315,7 @@ var _ = Describe("podman system connection", func() {
cmd := []string{"system", "connection", "list"}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.OutputToStringArray()).Should(HaveLen(1))
Expect(session.Err.Contents()).Should(BeEmpty())
})