hs-test: remove unnecessary app ns configs
Type: test Change-Id: I0226227dc756a5a3af5e9d3b0d65a38c0aa55b3d Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
This commit is contained in:
@@ -25,7 +25,7 @@ func (s *VethsSuite) TestLDPreloadIperfVpp() {
|
||||
|
||||
s.log("starting VPPs")
|
||||
|
||||
clientAppSocketApi := fmt.Sprintf("app-socket-api %s/var/run/app_ns_sockets/2",
|
||||
clientAppSocketApi := fmt.Sprintf("app-socket-api %s/var/run/app_ns_sockets/default",
|
||||
clientContainer.getContainerWorkDir())
|
||||
err := clnVclConf.
|
||||
newStanza("vcl").
|
||||
@@ -38,7 +38,7 @@ func (s *VethsSuite) TestLDPreloadIperfVpp() {
|
||||
saveToFile(clientVclFileName)
|
||||
s.assertNil(err)
|
||||
|
||||
serverAppSocketApi := fmt.Sprintf("app-socket-api %s/var/run/app_ns_sockets/1",
|
||||
serverAppSocketApi := fmt.Sprintf("app-socket-api %s/var/run/app_ns_sockets/default",
|
||||
serverContainer.getContainerWorkDir())
|
||||
err = srvVclConf.
|
||||
newStanza("vcl").
|
||||
|
||||
@@ -20,7 +20,7 @@ func (s *VethsSuite) testVppEcho(proto string) {
|
||||
|
||||
echoSrvContainer := s.getContainerByName("server-app")
|
||||
serverCommand := "vpp_echo server TX=RX" +
|
||||
" socket-name " + echoSrvContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/1" +
|
||||
" socket-name " + echoSrvContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
|
||||
" use-app-socket-api" +
|
||||
" uri " + uri
|
||||
s.log(serverCommand)
|
||||
@@ -29,7 +29,7 @@ func (s *VethsSuite) testVppEcho(proto string) {
|
||||
echoClnContainer := s.getContainerByName("client-app")
|
||||
|
||||
clientCommand := "vpp_echo client" +
|
||||
" socket-name " + echoClnContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/2" +
|
||||
" socket-name " + echoClnContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
|
||||
" use-app-socket-api uri " + uri
|
||||
s.log(clientCommand)
|
||||
o := echoClnContainer.exec(clientCommand)
|
||||
|
||||
@@ -61,10 +61,6 @@ func (s *VethsSuite) setupServerVpp() {
|
||||
idx, err := serverVpp.createAfPacket(serverVeth)
|
||||
s.assertNil(err)
|
||||
s.assertNotEqual(0, idx)
|
||||
|
||||
namespaceSecret := "1"
|
||||
err = serverVpp.addAppNamespace(1, idx, namespaceSecret)
|
||||
s.assertNil(err)
|
||||
}
|
||||
|
||||
func (s *VethsSuite) setupClientVpp() {
|
||||
@@ -77,8 +73,4 @@ func (s *VethsSuite) setupClientVpp() {
|
||||
idx, err := clientVpp.createAfPacket(clientVeth)
|
||||
s.assertNil(err)
|
||||
s.assertNotEqual(0, idx)
|
||||
|
||||
clientNamespaceSecret := "2"
|
||||
err = clientVpp.addAppNamespace(2, idx, clientNamespaceSecret)
|
||||
s.assertNil(err)
|
||||
}
|
||||
|
||||
+22
-20
@@ -5,15 +5,23 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const vclTemplate = `vcl {
|
||||
app-socket-api %[1]s/var/run/app_ns_sockets/%[2]s
|
||||
app-scope-global
|
||||
app-scope-local
|
||||
namespace-id %[2]s
|
||||
namespace-secret %[2]s
|
||||
use-mq-eventfd
|
||||
func getVclConfig(c *Container, ns_id_optional ...string) string {
|
||||
var s Stanza
|
||||
ns_id := "default"
|
||||
if len(ns_id_optional) > 0 {
|
||||
ns_id = ns_id_optional[0]
|
||||
}
|
||||
s.newStanza("vcl").
|
||||
append(fmt.Sprintf("app-socket-api %[1]s/var/run/app_ns_sockets/%[2]s", c.getContainerWorkDir(), ns_id)).
|
||||
append("app-scope-global").
|
||||
append("app-scope-local").
|
||||
append("use-mq-eventfd")
|
||||
if len(ns_id_optional) > 0 {
|
||||
s.append(fmt.Sprintf("namespace-id %[1]s", ns_id)).
|
||||
append(fmt.Sprintf("namespace-secret %[1]s", ns_id))
|
||||
}
|
||||
return s.close().toString()
|
||||
}
|
||||
`
|
||||
|
||||
func (s *VethsSuite) TestXEchoVclClientUdp() {
|
||||
s.testXEchoVclClient("udp")
|
||||
@@ -31,8 +39,7 @@ func (s *VethsSuite) testXEchoVclClient(proto string) {
|
||||
serverVpp.vppctl("test echo server uri %s://%s/%s fifo-size 64k", proto, serverVeth.ip4AddressString(), port)
|
||||
|
||||
echoClnContainer := s.getTransientContainerByName("client-app")
|
||||
clientVclConfContent := fmt.Sprintf(vclTemplate, echoClnContainer.getContainerWorkDir(), "2")
|
||||
echoClnContainer.createFile("/vcl.conf", clientVclConfContent)
|
||||
echoClnContainer.createFile("/vcl.conf", getVclConfig(echoClnContainer))
|
||||
|
||||
testClientCommand := "vcl_test_client -N 100 -p " + proto + " " + serverVeth.ip4AddressString() + " " + port
|
||||
s.log(testClientCommand)
|
||||
@@ -55,8 +62,7 @@ func (s *VethsSuite) testXEchoVclServer(proto string) {
|
||||
srvVppCont := s.getContainerByName("server-vpp")
|
||||
srvAppCont := s.getContainerByName("server-app")
|
||||
|
||||
serverVclConfContent := fmt.Sprintf(vclTemplate, srvVppCont.getContainerWorkDir(), "1")
|
||||
srvAppCont.createFile("/vcl.conf", serverVclConfContent)
|
||||
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(vclSrvCmd)
|
||||
@@ -75,8 +81,7 @@ func (s *VethsSuite) testVclEcho(proto string) {
|
||||
srvVppCont := s.getContainerByName("server-vpp")
|
||||
srvAppCont := s.getContainerByName("server-app")
|
||||
|
||||
serverVclConfContent := fmt.Sprintf(vclTemplate, srvVppCont.getContainerWorkDir(), "1")
|
||||
srvAppCont.createFile("/vcl.conf", serverVclConfContent)
|
||||
srvAppCont.createFile("/vcl.conf", getVclConfig(srvVppCont))
|
||||
srvAppCont.addEnvVar("VCL_CONFIG", "/vcl.conf")
|
||||
srvAppCont.execServer("vcl_test_server " + port)
|
||||
|
||||
@@ -84,8 +89,7 @@ func (s *VethsSuite) testVclEcho(proto string) {
|
||||
serverVethAddress := serverVeth.ip4AddressString()
|
||||
|
||||
echoClnContainer := s.getTransientContainerByName("client-app")
|
||||
clientVclConfContent := fmt.Sprintf(vclTemplate, echoClnContainer.getContainerWorkDir(), "2")
|
||||
echoClnContainer.createFile("/vcl.conf", clientVclConfContent)
|
||||
echoClnContainer.createFile("/vcl.conf", getVclConfig(echoClnContainer))
|
||||
|
||||
testClientCommand := "vcl_test_client -p " + proto + " " + serverVethAddress + " " + port
|
||||
echoClnContainer.addEnvVar("VCL_CONFIG", "/vcl.conf")
|
||||
@@ -111,8 +115,7 @@ func (s *VethsSuite) testRetryAttach(proto string) {
|
||||
|
||||
echoSrvContainer := s.getContainerByName("server-app")
|
||||
|
||||
serverVclConfContent := fmt.Sprintf(vclTemplate, echoSrvContainer.getContainerWorkDir(), "1")
|
||||
echoSrvContainer.createFile("/vcl.conf", serverVclConfContent)
|
||||
echoSrvContainer.createFile("/vcl.conf", getVclConfig(echoSrvContainer))
|
||||
|
||||
echoSrvContainer.addEnvVar("VCL_CONFIG", "/vcl.conf")
|
||||
echoSrvContainer.execServer("vcl_test_server -p " + proto + " 12346")
|
||||
@@ -124,8 +127,7 @@ func (s *VethsSuite) testRetryAttach(proto string) {
|
||||
serverVethAddress := serverVeth.ip4AddressString()
|
||||
|
||||
echoClnContainer := s.getTransientContainerByName("client-app")
|
||||
clientVclConfContent := fmt.Sprintf(vclTemplate, echoClnContainer.getContainerWorkDir(), "2")
|
||||
echoClnContainer.createFile("/vcl.conf", clientVclConfContent)
|
||||
echoClnContainer.createFile("/vcl.conf", getVclConfig(echoClnContainer))
|
||||
|
||||
testClientCommand := "vcl_test_client -U -p " + proto + " " + serverVethAddress + " 12346"
|
||||
echoClnContainer.addEnvVar("VCL_CONFIG", "/vcl.conf")
|
||||
|
||||
Reference in New Issue
Block a user