Maros Ondrejicka | db823ed | 2022-12-14 16:30:04 +0100 | [diff] [blame] | 1 | package main |
| 2 | |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 3 | const ( |
| 4 | // These correspond to names used in yaml config |
| 5 | clientInterface = "hst_client_vpp" |
| 6 | serverInterface = "hst_server_vpp" |
| 7 | ) |
| 8 | |
Maros Ondrejicka | db823ed | 2022-12-14 16:30:04 +0100 | [diff] [blame] | 9 | type NsSuite struct { |
| 10 | HstSuite |
| 11 | } |
| 12 | |
| 13 | func (s *NsSuite) SetupSuite() { |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 14 | s.configureNetworkTopology("ns") |
| 15 | |
Maros Ondrejicka | db823ed | 2022-12-14 16:30:04 +0100 | [diff] [blame] | 16 | s.loadContainerTopology("ns") |
| 17 | } |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 18 | |
| 19 | func (s *NsSuite) SetupTest() { |
| 20 | s.SetupVolumes() |
| 21 | s.SetupContainers() |
| 22 | |
| 23 | // Setup test conditions |
| 24 | var startupConfig Stanza |
| 25 | startupConfig. |
| 26 | NewStanza("session"). |
| 27 | Append("enable"). |
| 28 | Append("use-app-socket-api"). |
| 29 | Append("evt_qs_memfd_seg"). |
| 30 | Append("event-queue-length 100000").Close() |
| 31 | |
| 32 | container := s.getContainerByName("vpp") |
| 33 | vpp, _ := container.newVppInstance(startupConfig) |
| 34 | vpp.start() |
| 35 | |
| 36 | idx, err := vpp.createAfPacket(s.netInterfaces[serverInterface]) |
| 37 | s.assertNil(err) |
| 38 | s.assertNotEqual(0, idx) |
| 39 | |
| 40 | idx, err = vpp.createAfPacket(s.netInterfaces[clientInterface]) |
| 41 | s.assertNil(err) |
| 42 | s.assertNotEqual(0, idx) |
| 43 | |
| 44 | container.exec("chmod 777 -R %s", container.GetContainerWorkDir()) |
| 45 | } |