aboutsummaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorAdrian Villin <avillin@cisco.com>2024-07-18 08:33:59 +0200
committerDave Wallace <dwallacelf@gmail.com>2024-07-19 14:08:19 +0000
commit09b19fe8a31a61c04dedaa0ddec44576abad57c2 (patch)
treea7eee0da2ad79625edb364142fd06e861862644f /extras
parentb753554e25d59e684288c03af261bb690e4b0a66 (diff)
hs-test: fix docker log output when logs are empty
- removed "==> /dev/null <==" and "tail: cannot open..." lines when docker logs are empty Type: test Change-Id: Ia51f7aa41d2c6c04c0adcb82142abfd45fbe2728 Signed-off-by: Adrian Villin <avillin@cisco.com>
Diffstat (limited to 'extras')
-rw-r--r--extras/hs-test/infra/container.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/extras/hs-test/infra/container.go b/extras/hs-test/infra/container.go
index d71761b2920..5093398ae56 100644
--- a/extras/hs-test/infra/container.go
+++ b/extras/hs-test/infra/container.go
@@ -463,7 +463,14 @@ func (c *Container) log(maxLines int) (string, error) {
stdout := stdoutBuf.String()
stderr := stderrBuf.String()
- return stdout + " " + stderr, err
+ if strings.Contains(stdout, "==> /dev/null <==") {
+ stdout = ""
+ }
+ if strings.Contains(stderr, "tail: cannot open") {
+ stderr = ""
+ }
+
+ return stdout + stderr, err
}
func (c *Container) stop() error {