tests: disable some tests currently failing when not using runc

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2019-08-12 16:09:34 +02:00
parent efa26eedee
commit 9f67cde9f8
6 changed files with 29 additions and 0 deletions

View File

@ -179,6 +179,8 @@ var _ = Describe("Podman exec", func() {
})
It("podman exec cannot be invoked", func() {
SkipIfNotRunc()
setup := podmanTest.RunTopContainer("test1")
setup.WaitWithDefaultTimeout()
Expect(setup.ExitCode()).To(Equal(0))
@ -189,6 +191,8 @@ var _ = Describe("Podman exec", func() {
})
It("podman exec command not found", func() {
SkipIfNotRunc()
setup := podmanTest.RunTopContainer("test1")
setup.WaitWithDefaultTimeout()
Expect(setup.ExitCode()).To(Equal(0))

View File

@ -28,6 +28,13 @@ func SkipIfRootless() {
}
}
func SkipIfNotRunc() {
runtime := os.Getenv("OCI_RUNTIME")
if runtime != "" && filepath.Base(runtime) != "runc" {
ginkgo.Skip("Not using runc as runtime")
}
}
// Podman is the exec call to podman on the filesystem
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
podmanSession := p.PodmanBase(args, false, false)

View File

@ -21,6 +21,13 @@ func SkipIfRootless() {
}
}
func SkipIfNotRunc() {
runtime := os.Getenv("OCI_RUNTIME")
if runtime != "" && filepath.Base(runtime) != "runc" {
ginkgo.Skip("Not using runc as runtime")
}
}
// Podman is the exec call to podman on the filesystem
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
podmanSession := p.PodmanBase(args, false, false)

View File

@ -41,12 +41,16 @@ var _ = Describe("Podman run exit", func() {
})
It("podman run exit 126", func() {
SkipIfNotRunc()
result := podmanTest.Podman([]string{"run", ALPINE, "/etc"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(126))
})
It("podman run exit 127", func() {
SkipIfNotRunc()
result := podmanTest.Podman([]string{"run", ALPINE, "foobar"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(127))

View File

@ -353,6 +353,8 @@ var _ = Describe("Podman run", func() {
It("podman run notify_socket", func() {
SkipIfRemote()
SkipIfNotRunc()
host := GetHostDistributionInfo()
if host.Distribution != "rhel" && host.Distribution != "centos" && host.Distribution != "fedora" {
Skip("this test requires a working runc")
@ -563,6 +565,7 @@ var _ = Describe("Podman run", func() {
})
It("podman run exit code on failure to exec", func() {
SkipIfNotRunc()
session := podmanTest.Podman([]string{"run", ALPINE, "/etc"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(126))

View File

@ -101,6 +101,8 @@ var _ = Describe("Podman start", func() {
})
It("podman failed to start with --rm should delete the container", func() {
SkipIfNotRunc()
session := podmanTest.Podman([]string{"create", "-it", "--rm", ALPINE, "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@ -114,6 +116,8 @@ var _ = Describe("Podman start", func() {
})
It("podman failed to start without --rm should NOT delete the container", func() {
SkipIfNotRunc()
session := podmanTest.Podman([]string{"create", "-it", ALPINE, "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))