blob: 34fc9ec97230ead158f07c35fef956be0bcbb364 [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 Ondrejickae7625d02023-02-28 16:55:01 +010021 s.setupVolumes()
22 s.setupContainers()
Maros Ondrejicka2908f8c2023-02-02 08:58:04 +010023
24 // Setup test conditions
25 var startupConfig Stanza
26 startupConfig.
Maros Ondrejickae7625d02023-02-28 16:55:01 +010027 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 Ondrejicka2908f8c2023-02-02 08:58:04 +010032
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 Ondrejickae7625d02023-02-28 16:55:01 +010045 container.exec("chmod 777 -R %s", container.getContainerWorkDir())
Maros Ondrejicka2908f8c2023-02-02 08:58:04 +010046}