hs-test: use anchors in yaml config files

Volumes can be referenced with anchors to reduce text duplication
and to explicitly show which containers share a volume.

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: Id408a78262573b3faf2257c32bfa569eca2e2049
This commit is contained in:
Maros Ondrejicka
2022-12-20 15:10:50 +01:00
committed by Florin Coras
parent c04d8c41d1
commit f719adfa89
7 changed files with 25 additions and 16 deletions

View File

@@ -131,7 +131,9 @@ func (s *HstSuite) loadContainerTopology(topologyName string) {
}
for _, elem := range yamlTopo.Volumes {
s.volumes = append(s.volumes, elem)
volumeMap := elem["volume"].(VolumeConfig)
hostDir := volumeMap["host-dir"].(string)
s.volumes = append(s.volumes, hostDir)
}
s.containers = make(map[string]*Container)