diff options
author | cdoern <cdoern@redhat.com> | 2021-08-09 10:07:46 -0400 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-08-30 13:34:56 -0400 |
commit | aa754c7e2193e6f82a8c14f482bc58a7a5b07550 (patch) | |
tree | f0c3c05fda3f98eb8e7e22c93dd685d077997b9c /test | |
parent | f363b805c59ed4d25d89f08e3a099e5c7028eb2f (diff) | |
download | podman-aa754c7e2193e6f82a8c14f482bc58a7a5b07550.tar.gz podman-aa754c7e2193e6f82a8c14f482bc58a7a5b07550.tar.bz2 podman-aa754c7e2193e6f82a8c14f482bc58a7a5b07550.zip |
logFile until flag issue
we were adding a negative duration in podman events, causing inputs like
-5s to be correct and 5s to be incorrect.
fixes #11158
Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/events_test.go | 13 | ||||
-rw-r--r-- | test/e2e/logs_test.go | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/test/e2e/events_test.go b/test/e2e/events_test.go index e2a169383..46ea10c56 100644 --- a/test/e2e/events_test.go +++ b/test/e2e/events_test.go @@ -184,6 +184,19 @@ var _ = Describe("Podman events", func() { Expect(result.OutputToString()).To(ContainSubstring(name2)) Expect(result.OutputToString()).To(ContainSubstring(name3)) + // string duration in 10 seconds + untilT := time.Now().Add(time.Second * 9) + result = podmanTest.Podman([]string{"events", "--since", "30s", "--until", "10s"}) + result.Wait(11) + Expect(result).Should(Exit(0)) + tEnd := time.Now() + outDur := tEnd.Sub(untilT) + diff := outDur.Seconds() > 0 + Expect(diff).To(Equal(true)) + Expect(result.OutputToString()).To(ContainSubstring(name1)) + Expect(result.OutputToString()).To(ContainSubstring(name2)) + Expect(result.OutputToString()).To(ContainSubstring(name3)) + wg.Wait() }) }) diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go index 0a973b802..71d30f063 100644 --- a/test/e2e/logs_test.go +++ b/test/e2e/logs_test.go @@ -145,7 +145,7 @@ var _ = Describe("Podman logs", func() { results := podmanTest.Podman([]string{"logs", "--until", "10m", cid}) results.WaitWithDefaultTimeout() Expect(results).To(Exit(0)) - Expect(len(results.OutputToStringArray())).To(Equal(0)) + Expect(len(results.OutputToStringArray())).To(Equal(3)) }) It("until time NOW: "+log, func() { |