hs-test: refactor netconfig
[vpp.git] / extras / hs-test / suite_no_topo_test.go
1 package main
2
3 const (
4         singleTopoContainerVpp   = "vpp"
5         singleTopoContainerNginx = "nginx"
6
7         tapInterfaceName = "hst_tap_host"
8 )
9
10 type NoTopoSuite struct {
11         HstSuite
12 }
13
14 func (s *NoTopoSuite) SetupSuite() {
15         s.loadNetworkTopology("tap")
16
17         s.loadContainerTopology("single")
18 }
19
20 func (s *NoTopoSuite) SetupTest() {
21         s.SetupVolumes()
22         s.SetupContainers()
23
24         // Setup test conditions
25         var startupConfig Stanza
26         startupConfig.
27                 NewStanza("session").
28                 Append("enable").
29                 Append("use-app-socket-api").Close()
30
31         container := s.getContainerByName(singleTopoContainerVpp)
32         vpp, _ := container.newVppInstance(startupConfig)
33         vpp.start()
34
35         tapInterface := s.netInterfaces[tapInterfaceName]
36
37         vpp.createTap(1, tapInterface)
38 }