Filip Tehlar | c204c87 | 2022-12-21 08:59:16 +0100 | [diff] [blame] | 1 | package main |
| 2 | |
Maros Ondrejicka | 7550dd2 | 2023-02-07 20:40:27 +0100 | [diff] [blame] | 3 | const ( |
| 4 | singleTopoContainerVpp = "vpp" |
| 5 | singleTopoContainerNginx = "nginx" |
| 6 | |
Maros Ondrejicka | 40cba40 | 2023-02-23 13:19:15 +0100 | [diff] [blame] | 7 | tapInterfaceName = "hst_tap_host" |
Maros Ondrejicka | 7550dd2 | 2023-02-07 20:40:27 +0100 | [diff] [blame] | 8 | ) |
| 9 | |
Filip Tehlar | c204c87 | 2022-12-21 08:59:16 +0100 | [diff] [blame] | 10 | type NoTopoSuite struct { |
| 11 | HstSuite |
| 12 | } |
| 13 | |
| 14 | func (s *NoTopoSuite) SetupSuite() { |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 15 | s.HstSuite.SetupSuite() |
Maros Ondrejicka | 40cba40 | 2023-02-23 13:19:15 +0100 | [diff] [blame] | 16 | s.loadNetworkTopology("tap") |
Filip Tehlar | c204c87 | 2022-12-21 08:59:16 +0100 | [diff] [blame] | 17 | s.loadContainerTopology("single") |
Maros Ondrejicka | 7550dd2 | 2023-02-07 20:40:27 +0100 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | func (s *NoTopoSuite) SetupTest() { |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 21 | s.HstSuite.SetupTest() |
Maros Ondrejicka | 7550dd2 | 2023-02-07 20:40:27 +0100 | [diff] [blame] | 22 | |
| 23 | // Setup test conditions |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 24 | var sessionConfig Stanza |
| 25 | sessionConfig. |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 26 | newStanza("session"). |
| 27 | append("enable"). |
| 28 | append("use-app-socket-api").close() |
Maros Ondrejicka | 7550dd2 | 2023-02-07 20:40:27 +0100 | [diff] [blame] | 29 | |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 30 | cpus := s.AllocateCpus() |
Maros Ondrejicka | 7550dd2 | 2023-02-07 20:40:27 +0100 | [diff] [blame] | 31 | container := s.getContainerByName(singleTopoContainerVpp) |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 32 | vpp, _ := container.newVppInstance(cpus, sessionConfig) |
Maros Ondrejicka | 7550dd2 | 2023-02-07 20:40:27 +0100 | [diff] [blame] | 33 | vpp.start() |
| 34 | |
Maros Ondrejicka | 40cba40 | 2023-02-23 13:19:15 +0100 | [diff] [blame] | 35 | tapInterface := s.netInterfaces[tapInterfaceName] |
Maros Ondrejicka | 7550dd2 | 2023-02-07 20:40:27 +0100 | [diff] [blame] | 36 | |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 37 | vpp.createTap(tapInterface) |
Filip Tehlar | c204c87 | 2022-12-21 08:59:16 +0100 | [diff] [blame] | 38 | } |