blob: bbf0cfda68502a36d5142f1637267b57bad98091 [file] [log] [blame]
Filip Tehlarc204c872022-12-21 08:59:16 +01001package main
2
Maros Ondrejicka7550dd22023-02-07 20:40:27 +01003const (
adrianvillin28bd8f02024-02-13 06:00:02 -05004 singleTopoContainerVpp = "vpp"
5 singleTopoContainerNginx = "nginx"
6 tapInterfaceName = "htaphost"
Maros Ondrejicka7550dd22023-02-07 20:40:27 +01007)
8
Filip Tehlarc204c872022-12-21 08:59:16 +01009type NoTopoSuite struct {
10 HstSuite
11}
12
13func (s *NoTopoSuite) SetupSuite() {
Filip Tehlar608d0062023-04-28 10:29:47 +020014 s.HstSuite.SetupSuite()
Maros Ondrejicka40cba402023-02-23 13:19:15 +010015 s.loadNetworkTopology("tap")
Filip Tehlarc204c872022-12-21 08:59:16 +010016 s.loadContainerTopology("single")
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010017}
18
19func (s *NoTopoSuite) SetupTest() {
Filip Tehlar608d0062023-04-28 10:29:47 +020020 s.HstSuite.SetupTest()
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010021
22 // Setup test conditions
Filip Tehlar608d0062023-04-28 10:29:47 +020023 var sessionConfig Stanza
24 sessionConfig.
Maros Ondrejickae7625d02023-02-28 16:55:01 +010025 newStanza("session").
26 append("enable").
27 append("use-app-socket-api").close()
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010028
Filip Tehlar608d0062023-04-28 10:29:47 +020029 cpus := s.AllocateCpus()
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010030 container := s.getContainerByName(singleTopoContainerVpp)
Filip Tehlar608d0062023-04-28 10:29:47 +020031 vpp, _ := container.newVppInstance(cpus, sessionConfig)
Filip Tehlar56e17cf2024-01-11 17:17:33 +010032 s.assertNil(vpp.start())
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010033
adrianvillin28bd8f02024-02-13 06:00:02 -050034 tapInterface := s.getInterfaceByName(tapInterfaceName)
Maros Ondrejicka7550dd22023-02-07 20:40:27 +010035
Filip Tehlar56e17cf2024-01-11 17:17:33 +010036 s.assertNil(vpp.createTap(tapInterface), "failed to create tap interface")
Filip Tehlarc204c872022-12-21 08:59:16 +010037}