e2e: ExitCleanly(): more low-hanging fruit

Commit 1 of 2.

More easy ones: test files that either work with ExitCleanly()
or require very, very simple tweaks.

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2023-09-19 16:01:41 -06:00
parent 696f4a6a4d
commit a50fb7e061
35 changed files with 585 additions and 591 deletions

View File

@ -5,6 +5,7 @@ import (
"os"
"path/filepath"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
@ -15,7 +16,7 @@ var _ = Describe("Podman run", func() {
It("podman run a container without workdir", func() {
session := podmanTest.Podman([]string{"run", ALPINE, "pwd"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.OutputToString()).To(Equal("/"))
})
@ -32,7 +33,7 @@ var _ = Describe("Podman run", func() {
session := podmanTest.Podman([]string{"run", "--volume", fmt.Sprintf("%s:/var_ovl/:O", volume), "--workdir", "/var_ovl/log", ALPINE, "true"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman run a container on an image with a workdir", func() {
@ -43,7 +44,7 @@ WORKDIR /etc/foobar`, ALPINE)
session := podmanTest.Podman([]string{"run", "test", "pwd"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.OutputToString()).To(Equal("/etc/foobar"))
session = podmanTest.Podman([]string{"run", "test", "ls", "-ld", "."})
@ -52,7 +53,7 @@ WORKDIR /etc/foobar`, ALPINE)
session = podmanTest.Podman([]string{"run", "--workdir", "/home/foobar", "test", "pwd"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.OutputToString()).To(Equal("/home/foobar"))
})
})