diff options
author | chenkang <kongchen28@gmail.com> | 2021-04-17 20:32:19 +0800 |
---|---|---|
committer | chenkang <kongchen28@gmail.com> | 2021-04-17 20:33:37 +0800 |
commit | c9f347e9a8c013348d236bc205b3eca13d3f29ef (patch) | |
tree | a0aaf2cfafd2b6b97a0a0757831425f9db7ab130 | |
parent | 80c1dd0651ac7f70f09c1a5259a17f5cef59ab13 (diff) | |
download | podman-c9f347e9a8c013348d236bc205b3eca13d3f29ef.tar.gz podman-c9f347e9a8c013348d236bc205b3eca13d3f29ef.tar.bz2 podman-c9f347e9a8c013348d236bc205b3eca13d3f29ef.zip |
skip pidfile it on remote
Signed-off-by: chenkang <kongchen28@gmail.com>
-rw-r--r-- | test/e2e/run_test.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index ac459f6ab..93505d742 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -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()) }) }) |