skip pidfile it on remote

Signed-off-by: chenkang <kongchen28@gmail.com>
This commit is contained in:
chenkang 2021-04-17 20:32:19 +08:00
parent 80c1dd0651
commit c9f347e9a8
No known key found for this signature in database
GPG Key ID: A592F3AE7ECB096B
1 changed files with 10 additions and 2 deletions

View File

@ -1615,10 +1615,18 @@ WORKDIR /madethis`, BB)
})
It("podman run with pidfile", func() {
session := podmanTest.Podman([]string{"run", "--pidfile", tempdir + "pidfile", ALPINE, "ls"})
SkipIfRemote("pidfile not handled by remote")
pidfile := tempdir + "pidfile"
session := podmanTest.Podman([]string{"run", "--pidfile", pidfile, ALPINE, "ls"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
err := os.Remove(tempdir + "pidfile")
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())
})
})