2018-06-22 20:44:59 +00:00
|
|
|
package integration
|
|
|
|
|
|
|
|
import (
|
2018-07-28 16:11:31 +00:00
|
|
|
"fmt"
|
2018-06-22 20:44:59 +00:00
|
|
|
"os"
|
|
|
|
|
2018-10-29 06:56:07 +00:00
|
|
|
. "github.com/containers/libpod/test/utils"
|
2018-06-22 20:44:59 +00:00
|
|
|
. "github.com/onsi/ginkgo"
|
|
|
|
. "github.com/onsi/gomega"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ = Describe("Podman run exit", func() {
|
|
|
|
var (
|
|
|
|
tempdir string
|
|
|
|
err error
|
2018-10-29 06:56:07 +00:00
|
|
|
podmanTest *PodmanTestIntegration
|
2018-06-22 20:44:59 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
BeforeEach(func() {
|
|
|
|
tempdir, err = CreateTempDirInTempDir()
|
|
|
|
if err != nil {
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2018-10-29 06:56:07 +00:00
|
|
|
podmanTest = PodmanTestCreate(tempdir)
|
2018-06-22 20:44:59 +00:00
|
|
|
podmanTest.RestoreAllArtifacts()
|
|
|
|
})
|
|
|
|
|
|
|
|
AfterEach(func() {
|
|
|
|
podmanTest.Cleanup()
|
2018-07-28 16:11:31 +00:00
|
|
|
f := CurrentGinkgoTestDescription()
|
|
|
|
timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
|
|
|
|
GinkgoWriter.Write([]byte(timedResult))
|
2018-06-22 20:44:59 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
It("podman run -d mount cleanup test", func() {
|
2018-10-29 06:56:07 +00:00
|
|
|
mount := SystemExec("mount", nil)
|
2018-06-22 20:44:59 +00:00
|
|
|
mount.WaitWithDefaultTimeout()
|
|
|
|
out1 := mount.OutputToString()
|
2018-07-31 14:05:48 +00:00
|
|
|
result := podmanTest.Podman([]string{"create", "-dt", ALPINE, "echo", "hello"})
|
2018-06-22 20:44:59 +00:00
|
|
|
result.WaitWithDefaultTimeout()
|
|
|
|
Expect(result.ExitCode()).To(Equal(0))
|
|
|
|
|
2018-10-29 06:56:07 +00:00
|
|
|
mount = SystemExec("mount", nil)
|
2018-06-22 20:44:59 +00:00
|
|
|
mount.WaitWithDefaultTimeout()
|
|
|
|
out2 := mount.OutputToString()
|
|
|
|
Expect(out1).To(Equal(out2))
|
|
|
|
})
|
|
|
|
})
|