diff options
Diffstat (limited to 'extras/hs-test/vcl_test.go')
-rw-r--r-- | extras/hs-test/vcl_test.go | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/extras/hs-test/vcl_test.go b/extras/hs-test/vcl_test.go index 68ca9d02097..11e2be1258e 100644 --- a/extras/hs-test/vcl_test.go +++ b/extras/hs-test/vcl_test.go @@ -40,15 +40,14 @@ func XEchoVclClientTcpTest(s *VethsSuite) { func testXEchoVclClient(s *VethsSuite, proto string) { port := "12345" - serverVpp := s.GetContainerByName("server-vpp").VppInstance + serverVpp := s.Containers.ServerVpp.VppInstance - serverVeth := s.GetInterfaceByName(ServerInterfaceName) - serverVpp.Vppctl("test echo server uri %s://%s/%s fifo-size 64k", proto, serverVeth.Ip4AddressString(), port) + serverVpp.Vppctl("test echo server uri %s://%s/%s fifo-size 64k", proto, s.Interfaces.Server.Ip4AddressString(), port) echoClnContainer := s.GetTransientContainerByName("client-app") echoClnContainer.CreateFile("/vcl.conf", getVclConfig(echoClnContainer)) - testClientCommand := "vcl_test_client -N 100 -p " + proto + " " + serverVeth.Ip4AddressString() + " " + port + testClientCommand := "vcl_test_client -N 100 -p " + proto + " " + s.Interfaces.Server.Ip4AddressString() + " " + port s.Log(testClientCommand) echoClnContainer.AddEnvVar("VCL_CONFIG", "/vcl.conf") o := echoClnContainer.Exec(true, testClientCommand) @@ -66,18 +65,17 @@ func XEchoVclServerTcpTest(s *VethsSuite) { func testXEchoVclServer(s *VethsSuite, proto string) { port := "12345" - srvVppCont := s.GetContainerByName("server-vpp") - srvAppCont := s.GetContainerByName("server-app") + srvVppCont := s.Containers.ServerVpp + srvAppCont := s.Containers.ServerApp srvAppCont.CreateFile("/vcl.conf", getVclConfig(srvVppCont)) srvAppCont.AddEnvVar("VCL_CONFIG", "/vcl.conf") vclSrvCmd := fmt.Sprintf("vcl_test_server -p %s %s", proto, port) srvAppCont.ExecServer(true, vclSrvCmd) - serverVeth := s.GetInterfaceByName(ServerInterfaceName) - serverVethAddress := serverVeth.Ip4AddressString() + serverVethAddress := s.Interfaces.Server.Ip4AddressString() - clientVpp := s.GetContainerByName("client-vpp").VppInstance + clientVpp := s.Containers.ClientVpp.VppInstance o := clientVpp.Vppctl("test echo client uri %s://%s/%s fifo-size 64k verbose mbytes 2", proto, serverVethAddress, port) s.Log(o) s.AssertContains(o, "Test finished at") @@ -85,15 +83,14 @@ func testXEchoVclServer(s *VethsSuite, proto string) { func testVclEcho(s *VethsSuite, proto string) { port := "12345" - srvVppCont := s.GetContainerByName("server-vpp") - srvAppCont := s.GetContainerByName("server-app") + srvVppCont := s.Containers.ServerVpp + srvAppCont := s.Containers.ServerApp srvAppCont.CreateFile("/vcl.conf", getVclConfig(srvVppCont)) srvAppCont.AddEnvVar("VCL_CONFIG", "/vcl.conf") srvAppCont.ExecServer(true, "vcl_test_server -p "+proto+" "+port) - serverVeth := s.GetInterfaceByName(ServerInterfaceName) - serverVethAddress := serverVeth.Ip4AddressString() + serverVethAddress := s.Interfaces.Server.Ip4AddressString() echoClnContainer := s.GetTransientContainerByName("client-app") echoClnContainer.CreateFile("/vcl.conf", getVclConfig(echoClnContainer)) @@ -123,7 +120,7 @@ func VclRetryAttachTest(s *VethsSuite) { func testRetryAttach(s *VethsSuite, proto string) { srvVppContainer := s.GetTransientContainerByName("server-vpp") - echoSrvContainer := s.GetContainerByName("server-app") + echoSrvContainer := s.Containers.ServerApp echoSrvContainer.CreateFile("/vcl.conf", getVclConfig(echoSrvContainer)) @@ -133,8 +130,7 @@ func testRetryAttach(s *VethsSuite, proto string) { s.Log("This whole test case can take around 3 minutes to run. Please be patient.") s.Log("... Running first echo client test, before disconnect.") - serverVeth := s.GetInterfaceByName(ServerInterfaceName) - serverVethAddress := serverVeth.Ip4AddressString() + serverVethAddress := s.Interfaces.Server.Ip4AddressString() echoClnContainer := s.GetTransientContainerByName("client-app") echoClnContainer.CreateFile("/vcl.conf", getVclConfig(echoClnContainer)) |