hs-test: replaced container/interface getter func

- replaced s.GetContainerByName("xyz") with s.Containers.Xyz in tests
  and suites
- same thing for interfaces
- each suite has its own structs with containers/interfaces
- structs are initialized in SetupSuite

Type: test

Change-Id: I5bd99605b40921b7b8c844e8650f6fb0915e9e99
Signed-off-by: Adrian Villin <avillin@cisco.com>
This commit is contained in:
Adrian Villin
2024-12-09 14:18:31 +01:00
committed by Florin Coras
parent fb8f51697c
commit af5fcbfa71
22 changed files with 378 additions and 374 deletions

View File

@ -20,23 +20,20 @@ func VppEchoTcpTest(s *VethsSuite) {
}
func testVppEcho(s *VethsSuite, proto string) {
serverVethAddress := s.GetInterfaceByName(ServerInterfaceName).Ip4AddressString()
serverVethAddress := s.Interfaces.Server.Ip4AddressString()
uri := proto + "://" + serverVethAddress + "/12344"
echoSrvContainer := s.GetContainerByName("server-app")
serverCommand := "vpp_echo server TX=RX" +
" socket-name " + echoSrvContainer.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
" socket-name " + s.Containers.ServerApp.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
" use-app-socket-api" +
" uri " + uri
s.Log(serverCommand)
echoSrvContainer.ExecServer(true, serverCommand)
echoClnContainer := s.GetContainerByName("client-app")
s.Containers.ServerApp.ExecServer(true, serverCommand)
clientCommand := "vpp_echo client" +
" socket-name " + echoClnContainer.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
" socket-name " + s.Containers.ClientApp.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
" use-app-socket-api uri " + uri
s.Log(clientCommand)
o := echoClnContainer.Exec(true, clientCommand)
o := s.Containers.ClientApp.Exec(true, clientCommand)
s.Log(o)
}