From: Matus Fabian Date: Fri, 22 Aug 2025 13:13:59 +0000 (-0400) Subject: hs-test: fix core file detection X-Git-Tag: v26.02-rc0~74 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F43624%2F2;p=vpp.git hs-test: fix core file detection Type: test Change-Id: I7d6c494d66a053124d176a261b65dabe1a125215 Signed-off-by: Matus Fabian --- diff --git a/extras/hs-test/docker/Dockerfile.base b/extras/hs-test/docker/Dockerfile.base index 8186d7b3079..e6e3b442764 100644 --- a/extras/hs-test/docker/Dockerfile.base +++ b/extras/hs-test/docker/Dockerfile.base @@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Basic utilities ca-certificates \ wget \ + file \ gnupg \ gnupg2 \ git \ diff --git a/extras/hs-test/infra/utils.go b/extras/hs-test/infra/utils.go index 14d084014bc..1d84a3f61ea 100644 --- a/extras/hs-test/infra/utils.go +++ b/extras/hs-test/infra/utils.go @@ -313,8 +313,12 @@ func (s *HstSuite) StartClientApp(c *Container, cmd string, } func (s *HstSuite) GetCoreProcessName(file string) (string, bool) { - cmd := fmt.Sprintf("sudo file -b %s", file) - output, _ := exechelper.Output(cmd) + cmd := fmt.Sprintf("file -b %s", file) + output, err := exechelper.Output(cmd) + if err != nil { + s.Log(fmt.Sprint(err)) + return "", false + } outputStr := string(output) // ELF 64-bit LSB core file, x86-64, version 1 (SYSV), SVR4-style, from 'vpp -c /tmp/server/etc/vpp/startup.conf', real uid: 0, effective uid: 0, real gid: 0, effective gid: 0, execfn: '/usr/bin/vpp', platform: 'x86_64' if !strings.Contains(outputStr, "core file") {