blob: 8f7c87620ce9afb644795a4c2ae6dad66cdef553 [file] [log] [blame]
Filip Tehlarc204c872022-12-21 08:59:16 +01001package main
2
Maros Ondrejicka7550dd22023-02-07 20:40:27 +01003const (
4 singleTopoContainerVpp = "vpp"
5 singleTopoContainerNginx = "nginx"
6
Maros Ondrejicka40cba402023-02-23 13:19:15 +01007 tapInterfaceName = "hst_tap_host"
Maros Ondrejicka7550dd22023-02-07 20:40:27 +01008)
9
Filip Tehlarc204c872022-12-21 08:59:16 +010010type NoTopoSuite struct {
11 HstSuite
12}
13
14func (s *NoTopoSuite) SetupSuite() {
Filip Tehlar608d0062023-04-28 10:29:47 +020015 s.HstSuite.SetupSuite()
Maros Ondrejicka40cba402023-02-23 13:19:15 +010016 s.loadNetworkTopology("tap")
Filip Tehlarc204c872022-12-21 08:59:16 +010017 s.loadContainerTopology("single")
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010018}
19
20func (s *NoTopoSuite) SetupTest() {
Filip Tehlar608d0062023-04-28 10:29:47 +020021 s.HstSuite.SetupTest()
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010022
23 // Setup test conditions
Filip Tehlar608d0062023-04-28 10:29:47 +020024 var sessionConfig Stanza
25 sessionConfig.
Maros Ondrejickae7625d02023-02-28 16:55:01 +010026 newStanza("session").
27 append("enable").
28 append("use-app-socket-api").close()
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010029
Filip Tehlar608d0062023-04-28 10:29:47 +020030 cpus := s.AllocateCpus()
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010031 container := s.getContainerByName(singleTopoContainerVpp)
Filip Tehlar608d0062023-04-28 10:29:47 +020032 vpp, _ := container.newVppInstance(cpus, sessionConfig)
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010033 vpp.start()
34
Maros Ondrejicka40cba402023-02-23 13:19:15 +010035 tapInterface := s.netInterfaces[tapInterfaceName]
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010036
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010037 vpp.createTap(tapInterface)
Filip Tehlarc204c872022-12-21 08:59:16 +010038}