blob: 5bc45c7f80c891344cb61bbbdbe920c128c50321 [file] [log] [blame]
Maros Ondrejickadb823ed2022-12-14 16:30:04 +01001package main
2
Maros Ondrejicka2908f8c2023-02-02 08:58:04 +01003const (
4 // These correspond to names used in yaml config
5 clientInterface = "hst_client_vpp"
6 serverInterface = "hst_server_vpp"
7)
8
Maros Ondrejickadb823ed2022-12-14 16:30:04 +01009type NsSuite struct {
10 HstSuite
11}
12
13func (s *NsSuite) SetupSuite() {
Maros Ondrejicka2908f8c2023-02-02 08:58:04 +010014 s.configureNetworkTopology("ns")
15
Maros Ondrejickadb823ed2022-12-14 16:30:04 +010016 s.loadContainerTopology("ns")
17}
Maros Ondrejicka2908f8c2023-02-02 08:58:04 +010018
19func (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}