aboutsummaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-10-03 12:44:39 +0200
committerGitHub <noreply@github.com>2022-10-03 12:44:39 +0200
commit5da3e1187e7c250584dc3002938be61e655e1a7b (patch)
tree3f1a3678505ffa4a75e083790368dc7d39d96f48 /test/e2e
parent84aff621f562fd90b8d5302ab7052d28f51ded0a (diff)
parent6f821f03d9e3f7a2e361177d2b301b16b2ea4866 (diff)
downloadpodman-5da3e1187e7c250584dc3002938be61e655e1a7b.tar.gz
podman-5da3e1187e7c250584dc3002938be61e655e1a7b.tar.bz2
podman-5da3e1187e7c250584dc3002938be61e655e1a7b.zip
Merge pull request #15846 from jakecorrenti/pod-logs-latest
`podman pod logs -l` no longer panics
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/logs_test.go73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go
index c680cae2a..93ef54c3a 100644
--- a/test/e2e/logs_test.go
+++ b/test/e2e/logs_test.go
@@ -391,6 +391,78 @@ var _ = Describe("Podman logs", func() {
// see comment above
Expect(string(logs.Out.Contents())).To(Equal(content))
})
+
+ It("podman pod logs -l with newer container created: "+log, func() {
+ skipIfJournaldInContainer()
+
+ podName := "testPod"
+ containerName1 := "container1"
+ containerName2 := "container2"
+ containerName3 := "container3"
+
+ testPod := podmanTest.Podman([]string{"pod", "create", fmt.Sprintf("--name=%s", podName)})
+ testPod.WaitWithDefaultTimeout()
+ Expect(testPod).To(Exit(0))
+
+ log1 := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName1, "-d", "--pod", podName, BB, "/bin/sh", "-c", "echo log1"})
+ log1.WaitWithDefaultTimeout()
+ Expect(log1).To(Exit(0))
+
+ log2 := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName2, "-d", "--pod", podName, BB, "/bin/sh", "-c", "echo log2"})
+ log2.WaitWithDefaultTimeout()
+ Expect(log2).To(Exit(0))
+
+ ctr := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName3, "-d", BB, "date"})
+ ctr.WaitWithDefaultTimeout()
+ Expect(ctr).To(Exit(0))
+
+ results := podmanTest.Podman([]string{"pod", "logs", "-l"})
+ results.WaitWithDefaultTimeout()
+ if IsRemote() {
+ Expect(results).To(Exit(125))
+ } else {
+ Expect(results).To(Exit(0))
+ podOutput := results.OutputToString()
+
+ results = podmanTest.Podman([]string{"logs", "-l"})
+ results.WaitWithDefaultTimeout()
+ Expect(results).To(Exit(0))
+ ctrOutput := results.OutputToString()
+
+ Expect(podOutput).ToNot(Equal(ctrOutput))
+ }
+ })
+
+ It("podman pod logs -l: "+log, func() {
+ skipIfJournaldInContainer()
+
+ podName := "testPod"
+ containerName1 := "container1"
+ containerName2 := "container2"
+
+ testPod := podmanTest.Podman([]string{"pod", "create", fmt.Sprintf("--name=%s", podName)})
+ testPod.WaitWithDefaultTimeout()
+ Expect(testPod).To(Exit(0))
+
+ log1 := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName1, "-d", "--pod", podName, BB, "/bin/sh", "-c", "echo log1"})
+ log1.WaitWithDefaultTimeout()
+ Expect(log1).To(Exit(0))
+
+ log2 := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName2, "-d", "--pod", podName, BB, "/bin/sh", "-c", "echo log2"})
+ log2.WaitWithDefaultTimeout()
+ Expect(log2).To(Exit(0))
+
+ results := podmanTest.Podman([]string{"pod", "logs", "-l"})
+ results.WaitWithDefaultTimeout()
+ if IsRemote() {
+ Expect(results).To(Exit(125))
+ } else {
+ Expect(results).To(Exit(0))
+ output := results.OutputToString()
+ Expect(output).To(ContainSubstring("log1"))
+ Expect(output).To(ContainSubstring("log2"))
+ }
+ })
}
It("using journald for container with container tag", func() {
@@ -490,4 +562,5 @@ var _ = Describe("Podman logs", func() {
Expect(output[0]).To(MatchRegexp(`\x1b\[3[0-9a-z ]+\x1b\[0m`))
Expect(output[1]).To(MatchRegexp(`\x1b\[3[0-9a-z ]+\x1b\[0m`))
})
+
})