From: Adrian Villin Date: Thu, 18 Jul 2024 06:33:59 +0000 (+0200) Subject: hs-test: fix docker log output when logs are empty X-Git-Tag: v25.02-rc0~119 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=09b19fe8a31a61c04dedaa0ddec44576abad57c2;p=vpp.git 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 --- 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 {