blob: c4a3f426648a03089f9716b75293638b817decde [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() {
Maros Ondrejickaaf004dd2023-02-27 16:52:57 +010020 s.skipIfUnconfiguring()
Maros Ondrejicka2908f8c2023-02-02 08:58:04 +010021 s.SetupVolumes()
22 s.SetupContainers()
23
24 // Setup test conditions
25 var startupConfig Stanza
26 startupConfig.
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()
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
45 container.exec("chmod 777 -R %s", container.GetContainerWorkDir())
46}