mirror of
https://github.com/containers/podman.git
synced 2025-06-19 16:33:24 +08:00

when doing localized tests (not varlink), we can use secondary image stores as read-only image caches. this cuts down on test time significantly because each test does not need to restore the images from a tarball anymore. Signed-off-by: baude <bbaude@redhat.com>
67 lines
1.5 KiB
Go
67 lines
1.5 KiB
Go
// +build !remoteclient
|
|
|
|
package integration
|
|
|
|
import (
|
|
"os"
|
|
|
|
. "github.com/containers/libpod/test/utils"
|
|
. "github.com/onsi/ginkgo"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("Podman run exit", func() {
|
|
var (
|
|
tempdir string
|
|
err error
|
|
podmanTest *PodmanTestIntegration
|
|
)
|
|
|
|
BeforeEach(func() {
|
|
tempdir, err = CreateTempDirInTempDir()
|
|
if err != nil {
|
|
os.Exit(1)
|
|
}
|
|
podmanTest = PodmanTestCreate(tempdir)
|
|
podmanTest.Setup()
|
|
podmanTest.SeedImages()
|
|
})
|
|
|
|
AfterEach(func() {
|
|
podmanTest.Cleanup()
|
|
f := CurrentGinkgoTestDescription()
|
|
processTestResult(f)
|
|
|
|
})
|
|
|
|
It("podman run exit 125", func() {
|
|
result := podmanTest.Podman([]string{"run", "--foobar", ALPINE, "ls", "$tmp"})
|
|
result.WaitWithDefaultTimeout()
|
|
Expect(result.ExitCode()).To(Equal(125))
|
|
})
|
|
|
|
It("podman run exit 126", func() {
|
|
result := podmanTest.Podman([]string{"run", ALPINE, "/etc"})
|
|
result.WaitWithDefaultTimeout()
|
|
Expect(result.ExitCode()).To(Equal(126))
|
|
})
|
|
|
|
It("podman run exit 127", func() {
|
|
result := podmanTest.Podman([]string{"run", ALPINE, "foobar"})
|
|
result.WaitWithDefaultTimeout()
|
|
Expect(result.ExitCode()).To(Equal(127))
|
|
})
|
|
|
|
It("podman run exit 0", func() {
|
|
result := podmanTest.Podman([]string{"run", ALPINE, "ls"})
|
|
result.WaitWithDefaultTimeout()
|
|
Expect(result.ExitCode()).To(Equal(0))
|
|
})
|
|
|
|
It("podman run exit 50", func() {
|
|
result := podmanTest.Podman([]string{"run", ALPINE, "sh", "-c", "exit 50"})
|
|
result.WaitWithDefaultTimeout()
|
|
Expect(result.ExitCode()).To(Equal(50))
|
|
})
|
|
})
|