summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/hst_suite.go
diff options
context:
space:
mode:
Diffstat (limited to 'extras/hs-test/hst_suite.go')
-rw-r--r--extras/hs-test/hst_suite.go26
1 files changed, 6 insertions, 20 deletions
diff --git a/extras/hs-test/hst_suite.go b/extras/hs-test/hst_suite.go
index 01be2efbf3d..ff7024582dc 100644
--- a/extras/hs-test/hst_suite.go
+++ b/extras/hs-test/hst_suite.go
@@ -25,7 +25,7 @@ type HstSuite struct {
containers map[string]*Container
volumes []string
netConfigs []NetConfig
- netInterfaces map[string]NetInterface
+ netInterfaces map[string]*NetInterface
addresser *Addresser
testIds map[string]string
}
@@ -188,7 +188,7 @@ func (s *HstSuite) loadNetworkTopology(topologyName string) {
}
s.addresser = NewAddresser(s)
- s.netInterfaces = make(map[string]NetInterface)
+ s.netInterfaces = make(map[string]*NetInterface)
for _, elem := range yamlTopo.Devices {
switch elem["type"].(string) {
case NetNs:
@@ -199,20 +199,11 @@ func (s *HstSuite) loadNetworkTopology(topologyName string) {
s.T().Fatalf("network config error: %v", err)
}
}
- case Veth:
+ case Veth, Tap:
{
- if veth, err := NewVeth(elem, s.addresser); err == nil {
- s.netConfigs = append(s.netConfigs, &veth)
- s.netInterfaces[veth.Name()] = &veth
- } else {
- s.T().Fatalf("network config error: %v", err)
- }
- }
- case Tap:
- {
- if tap, err := NewTap(elem, s.addresser); err == nil {
- s.netConfigs = append(s.netConfigs, &tap)
- s.netInterfaces[tap.Name()] = &tap
+ if netIf, err := NewNetworkInterface(elem, s.addresser); err == nil {
+ s.netConfigs = append(s.netConfigs, netIf)
+ s.netInterfaces[netIf.Name()] = netIf
} else {
s.T().Fatalf("network config error: %v", err)
}
@@ -262,11 +253,6 @@ func (s *HstSuite) getTestId() string {
return s.testIds[testName]
}
-type NetworkAddresses struct {
- network int
- numberOfAddresses int
-}
-
type AddressCounter = int
type Addresser struct {