blob: 97e5ca4f416a68bac38378f9d350ddb00f584d8f [file] [log] [blame]
Filip Tehlarc204c872022-12-21 08:59:16 +01001package main
2
Maros Ondrejicka7550dd22023-02-07 20:40:27 +01003const (
adrianvillinfbf5f2b2024-02-13 03:26:25 -05004 singleTopoContainerVpp = "vpp"
Maros Ondrejicka7550dd22023-02-07 20:40:27 +01005 singleTopoContainerNginx = "nginx"
adrianvillinfbf5f2b2024-02-13 03:26:25 -05006 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
Maros Ondrejicka40cba402023-02-23 13:19:15 +010034 tapInterface := s.netInterfaces[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}