hs-test: fix a runtime error
- framework panicked if core_pattern was set to "core" Type: test Change-Id: I14211cc59779090a61e6e08a18d16fd7399b2bed Signed-off-by: Adrian Villin <avillin@cisco.com>
This commit is contained in:
Adrian Villin
committed by
Florin Coras
parent
20956385c7
commit
fb0cbc64e6
@ -331,8 +331,12 @@ func (c *Container) getVolumesAsSlice() []string {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
if len(core_pattern) > 0 && core_pattern[0] != '|' {
|
if len(core_pattern) > 0 && core_pattern[0] != '|' {
|
||||||
index := strings.LastIndex(core_pattern, "/")
|
index := strings.LastIndex(core_pattern, "/")
|
||||||
core_pattern = core_pattern[:index]
|
if index == -1 {
|
||||||
volumeSlice = append(volumeSlice, c.Suite.getLogDirPath()+":"+core_pattern)
|
c.Suite.Log("'core_pattern' isn't set to an absolute path. Core dump check will not work.")
|
||||||
|
} else {
|
||||||
|
core_pattern = core_pattern[:index]
|
||||||
|
volumeSlice = append(volumeSlice, c.Suite.getLogDirPath()+":"+core_pattern)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
c.Suite.Log(fmt.Sprintf("core_pattern \"%s\" starts with pipe, ignoring", core_pattern))
|
c.Suite.Log(fmt.Sprintf("core_pattern \"%s\" starts with pipe, ignoring", core_pattern))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user