mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
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:
@ -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"))
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user