aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2024-10-04 01:06:02 -0400
committerFlorin Coras <florin.coras@gmail.com>2024-10-04 05:40:15 +0000
commit89969288d3fe997c37c723784d6f28ed51d0a84b (patch)
treecee441312cd0329b855473f8babcf95560ad52ee /extras/hs-test
parent08894464dd694d732f593119d733f30e2163b256 (diff)
hs-test: fix core_pattern volume mounts
If system is configured to use something like apport, avoid mounting. Type: fix Change-Id: I6af900bd334acba974c9c4ae30c3b2ce26d1f49b Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'extras/hs-test')
-rw-r--r--extras/hs-test/infra/container.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/extras/hs-test/infra/container.go b/extras/hs-test/infra/container.go
index 8ec9b8cd02c..019eec40f78 100644
--- a/extras/hs-test/infra/container.go
+++ b/extras/hs-test/infra/container.go
@@ -329,9 +329,13 @@ func (c *Container) getVolumesAsSlice() []string {
core_pattern, err := sysctl.Read("kernel.core_pattern")
if err == nil {
- index := strings.LastIndex(core_pattern, "/")
- core_pattern = core_pattern[:index]
- volumeSlice = append(volumeSlice, c.Suite.getLogDirPath()+":"+core_pattern)
+ if len(core_pattern) > 0 && core_pattern[0] != '|' {
+ index := strings.LastIndex(core_pattern, "/")
+ core_pattern = core_pattern[:index]
+ volumeSlice = append(volumeSlice, c.Suite.getLogDirPath()+":"+core_pattern)
+ } else {
+ c.Suite.Log(fmt.Sprintf("core_pattern \"%s\" starts with pipe, ignoring", core_pattern))
+ }
} else {
c.Suite.Log(err)
}