hs-test: fix core file detection 24/43624/2
authorMatus Fabian <[email protected]>
Fri, 22 Aug 2025 13:13:59 +0000 (09:13 -0400)
committerFlorin Coras <[email protected]>
Mon, 25 Aug 2025 06:48:02 +0000 (06:48 +0000)
Type: test

Change-Id: I7d6c494d66a053124d176a261b65dabe1a125215
Signed-off-by: Matus Fabian <[email protected]>
extras/hs-test/docker/Dockerfile.base
extras/hs-test/infra/utils.go

index 8186d7b..e6e3b44 100644 (file)
@@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
     # Basic utilities
     ca-certificates \
     wget \
+    file \
     gnupg \
     gnupg2 \
     git \
index 14d0840..1d84a3f 100644 (file)
@@ -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") {