hs-test: fix CPU alloc when running in parallel
[vpp.git] / extras / hs-test / container.go
index c82f1fc..0bdc3a2 100644 (file)
@@ -77,7 +77,7 @@ func newContainer(suite *HstSuite, yamlInput ContainerConfig) (*Container, error
        }
 
        if _, ok := yamlInput["volumes"]; ok {
-               workingVolumeDir := logDir + CurrentSpecReport().LeafNodeText + container.suite.pid + volumeDir
+               workingVolumeDir := logDir + CurrentSpecReport().LeafNodeText + volumeDir
                workDirReplacer := strings.NewReplacer("$HST_DIR", workDir)
                volDirReplacer := strings.NewReplacer("$HST_VOLUME_DIR", workingVolumeDir)
                for _, volu := range yamlInput["volumes"].([]interface{}) {
@@ -239,6 +239,7 @@ func (c *Container) newVppInstance(cpus []int, additionalConfigs ...Stanza) (*Vp
        vpp := new(VppInstance)
        vpp.container = c
        vpp.cpus = cpus
+       c.suite.vppContainerCount += 1
        vpp.additionalConfig = append(vpp.additionalConfig, additionalConfigs...)
        c.vppInstance = vpp
        return vpp, nil
@@ -340,7 +341,7 @@ func (c *Container) log(maxLines int) (string, error) {
 }
 
 func (c *Container) stop() error {
-       if c.vppInstance != nil && c.vppInstance.apiChannel != nil {
+       if c.vppInstance != nil && c.vppInstance.apiStream != nil {
                c.vppInstance.saveLogs()
                c.vppInstance.disconnect()
        }