summaryrefslogtreecommitdiff
path: root/test/e2e/start_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/start_test.go')
-rw-r--r--test/e2e/start_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/e2e/start_test.go b/test/e2e/start_test.go
index f527b67f6..cb2db0810 100644
--- a/test/e2e/start_test.go
+++ b/test/e2e/start_test.go
@@ -1,7 +1,10 @@
package integration
import (
+ "io/ioutil"
"os"
+ "strconv"
+ "strings"
. "github.com/containers/podman/v3/test/utils"
. "github.com/onsi/ginkgo"
@@ -206,4 +209,25 @@ var _ = Describe("Podman start", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(125))
})
+
+ It("podman start container with special pidfile", func() {
+ SkipIfRemote("pidfile not handled by remote")
+ pidfile := tempdir + "pidfile"
+ session := podmanTest.Podman([]string{"create", "--pidfile", pidfile, ALPINE, "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ cid := session.OutputToString()
+
+ session = podmanTest.Podman([]string{"start", cid})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ readFirstLine := func(path string) string {
+ content, err := ioutil.ReadFile(path)
+ Expect(err).To(BeNil())
+ return strings.Split(string(content), "\n")[0]
+ }
+ containerPID := readFirstLine(pidfile)
+ _, err = strconv.Atoi(containerPID) // Make sure it's a proper integer
+ Expect(err).To(BeNil())
+ })
})