summaryrefslogtreecommitdiff
path: root/test/e2e/pod_start_test.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-06-11 10:59:43 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-06-11 11:01:13 +0200
commitc7c81a8c081f6f7458345027f315a796d6ca5eda (patch)
treed2f3db69b5c5a5ce61641b14ee21f884a69b08e1 /test/e2e/pod_start_test.go
parent05713fbbf30a8c10f9aa290723efec5f3846a113 (diff)
downloadpodman-c7c81a8c081f6f7458345027f315a796d6ca5eda.tar.gz
podman-c7c81a8c081f6f7458345027f315a796d6ca5eda.tar.bz2
podman-c7c81a8c081f6f7458345027f315a796d6ca5eda.zip
e2e: sanity check --infra-conmon-pidfile
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'test/e2e/pod_start_test.go')
-rw-r--r--test/e2e/pod_start_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/e2e/pod_start_test.go b/test/e2e/pod_start_test.go
index 99285d1e1..d7d623d6e 100644
--- a/test/e2e/pod_start_test.go
+++ b/test/e2e/pod_start_test.go
@@ -1,8 +1,11 @@
package integration
import (
+ "fmt"
"io/ioutil"
"os"
+ "strconv"
+ "strings"
. "github.com/containers/libpod/test/utils"
. "github.com/onsi/ginkgo"
@@ -210,6 +213,21 @@ var _ = Describe("Podman pod start", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1)) // infra
+
+ readFirstLine := func(path string) string {
+ content, err := ioutil.ReadFile(path)
+ Expect(err).To(BeNil())
+ return strings.Split(string(content), "\n")[0]
+ }
+
+ // Read the infra-conmon-pidfile and perform some sanity checks
+ // on the pid.
+ infraConmonPID := readFirstLine(tmpFile)
+ _, err = strconv.Atoi(infraConmonPID) // Make sure it's a proper integer
+ Expect(err).To(BeNil())
+
+ cmdline := readFirstLine(fmt.Sprintf("/proc/%s/cmdline", infraConmonPID))
+ Expect(cmdline).To(ContainSubstring("/conmon"))
})
})