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() { |
Maros Ondrejicka | af004dd | 2023-02-27 16:52:57 +0100 | [diff] [blame] | 20 | s.skipIfUnconfiguring() |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 21 | s.setupVolumes() |
| 22 | s.setupContainers() |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 23 | |
| 24 | // Setup test conditions |
| 25 | var startupConfig Stanza |
| 26 | startupConfig. |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 27 | newStanza("session"). |
| 28 | append("enable"). |
| 29 | append("use-app-socket-api"). |
| 30 | append("evt_qs_memfd_seg"). |
| 31 | append("event-queue-length 100000").close() |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 32 | |
| 33 | container := s.getContainerByName("vpp") |
| 34 | vpp, _ := container.newVppInstance(startupConfig) |
| 35 | vpp.start() |
| 36 | |
| 37 | idx, err := vpp.createAfPacket(s.netInterfaces[serverInterface]) |
| 38 | s.assertNil(err) |
| 39 | s.assertNotEqual(0, idx) |
| 40 | |
| 41 | idx, err = vpp.createAfPacket(s.netInterfaces[clientInterface]) |
| 42 | s.assertNil(err) |
| 43 | s.assertNotEqual(0, idx) |
| 44 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 45 | container.exec("chmod 777 -R %s", container.getContainerWorkDir()) |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 46 | } |