hs-test: shortened interface names to avoid character limit
Type: test
Change-Id: I09df597ccb8a3c4af47b8a36010afb81df533236
Signed-off-by: adrianvillin <avillin@cisco.com>
diff --git a/extras/hs-test/echo_test.go b/extras/hs-test/echo_test.go
index 1606137..8dd620a 100644
--- a/extras/hs-test/echo_test.go
+++ b/extras/hs-test/echo_test.go
@@ -2,7 +2,7 @@
func (s *VethsSuite) TestEchoBuiltin() {
serverVpp := s.getContainerByName("server-vpp").vppInstance
- serverVeth := s.netInterfaces["vppsrv"]
+ serverVeth := s.netInterfaces[serverInterfaceName]
serverVpp.vppctl("test echo server " +
" uri tcp://" + serverVeth.ip4AddressString() + "/1234")
@@ -33,7 +33,7 @@
clientVpp.vppctl("set nsim poll-main-thread delay 0.01 ms bandwidth 40 gbit" +
" packet-size 1400 packets-per-drop 1000")
- clientVpp.vppctl("nsim output-feature enable-disable host-vppcln")
+ clientVpp.vppctl("nsim output-feature enable-disable " + s.netInterfaces[clientInterfaceName].name)
// Do echo test from client-vpp container
output := clientVpp.vppctl("test echo client uri tcp://%s/20022 verbose echo-bytes mbytes 50",
diff --git a/extras/hs-test/http_test.go b/extras/hs-test/http_test.go
index e710f38..068d042 100644
--- a/extras/hs-test/http_test.go
+++ b/extras/hs-test/http_test.go
@@ -11,13 +11,14 @@
client_ip := iface.ip4AddressString()
port := "8080"
finished := make(chan error, 1)
+ clientNetns := "cln"
container := s.getContainerByName("vpp")
// configure vpp in the container
container.vppInstance.vppctl("http tps uri tcp://0.0.0.0/8080")
- go s.startWget(finished, client_ip, port, "test_file_10M", "client")
+ go s.startWget(finished, client_ip, port, "test_file_10M", clientNetns)
// wait for client
err := <-finished
s.assertNil(err, err)
@@ -107,7 +108,7 @@
vpp := s.getContainerByName("vpp").vppInstance
- nginxCont := s.getContainerByName("nginx")
+ nginxCont := s.getContainerByName(singleTopoContainerNginx)
s.assertNil(nginxCont.run())
vpp.waitForApp("nginx-", 5)
diff --git a/extras/hs-test/proxy_test.go b/extras/hs-test/proxy_test.go
index cdb516a..748e48b 100644
--- a/extras/hs-test/proxy_test.go
+++ b/extras/hs-test/proxy_test.go
@@ -9,18 +9,21 @@
func testProxyHttpTcp(s *NsSuite, proto string) error {
const outputFile = "test.data"
- const srcFile = "10M"
+ const srcFile = "httpTestFile"
+ const fileSize = "10M"
stopServer := make(chan struct{}, 1)
serverRunning := make(chan struct{}, 1)
+ serverNetns := "srv"
+ clientNetns := "cln"
// create test file
- err := exechelper.Run(fmt.Sprintf("ip netns exec server truncate -s %s %s", srcFile, srcFile))
+ err := exechelper.Run(fmt.Sprintf("ip netns exec %s truncate -s %s %s", serverNetns, fileSize, srcFile))
s.assertNil(err, "failed to run truncate command: " + fmt.Sprint(err))
defer func() { os.Remove(srcFile) }()
s.log("test file created...")
- go s.startHttpServer(serverRunning, stopServer, ":666", "server")
+ go s.startHttpServer(serverRunning, stopServer, ":666", serverNetns)
// TODO better error handling and recovery
<-serverRunning
@@ -31,19 +34,20 @@
s.log("http server started...")
clientVeth := s.netInterfaces[clientInterface]
- c := fmt.Sprintf("ip netns exec client wget --no-proxy --retry-connrefused"+
- " --retry-on-http-error=503 --tries=10 -O %s ", outputFile)
+ c := fmt.Sprintf("ip netns exec %s wget --no-proxy --retry-connrefused"+
+ " --retry-on-http-error=503 --tries=10 -O %s ", clientNetns, outputFile)
if proto == "tls" {
c += " --secure-protocol=TLSv1_3 --no-check-certificate https://"
}
c += fmt.Sprintf("%s:555/%s", clientVeth.ip4AddressString(), srcFile)
s.log(c)
_, err = exechelper.CombinedOutput(c)
- s.assertNil(err, "failed to run wget: '%s', cmd: %s", err, c)
- stopServer <- struct{}{}
defer func() { os.Remove(outputFile) }()
+ s.assertNil(err, "failed to run wget: '%s', cmd: %s", err, c)
+ stopServer <- struct{}{}
+
s.assertNil(assertFileSize(outputFile, srcFile))
return nil
}
diff --git a/extras/hs-test/raw_session_test.go b/extras/hs-test/raw_session_test.go
index 45c4278..386f9bc 100644
--- a/extras/hs-test/raw_session_test.go
+++ b/extras/hs-test/raw_session_test.go
@@ -14,7 +14,7 @@
}
func (s *VethsSuite) testVppEcho(proto string) {
- serverVethAddress := s.netInterfaces["vppsrv"].ip4AddressString()
+ serverVethAddress := s.netInterfaces[serverInterfaceName].ip4AddressString()
uri := proto + "://" + serverVethAddress + "/12344"
echoSrvContainer := s.getContainerByName("server-app")
diff --git a/extras/hs-test/suite_nginx_test.go b/extras/hs-test/suite_nginx_test.go
index 4fc0626..94fd010 100644
--- a/extras/hs-test/suite_nginx_test.go
+++ b/extras/hs-test/suite_nginx_test.go
@@ -2,11 +2,11 @@
const (
// These correspond to names used in yaml config
- mirroringClientInterfaceName = "hst_client"
- mirroringServerInterfaceName = "hst_server"
- vppProxyContainerName = "vpp-proxy"
- nginxProxyContainerName = "nginx-proxy"
- nginxServerContainerName = "nginx-server"
+ mirroringClientInterfaceName = "hstcln"
+ mirroringServerInterfaceName = "hstsrv"
+ vppProxyContainerName = "vpp-proxy"
+ nginxProxyContainerName = "nginx-proxy"
+ nginxServerContainerName = "nginx-server"
)
type NginxSuite struct {
diff --git a/extras/hs-test/suite_no_topo_test.go b/extras/hs-test/suite_no_topo_test.go
index c6b3170..97e5ca4 100644
--- a/extras/hs-test/suite_no_topo_test.go
+++ b/extras/hs-test/suite_no_topo_test.go
@@ -1,10 +1,9 @@
package main
const (
- singleTopoContainerVpp = "vpp"
+ singleTopoContainerVpp = "vpp"
singleTopoContainerNginx = "nginx"
-
- tapInterfaceName = "hst_tap_host"
+ tapInterfaceName = "htaphost"
)
type NoTopoSuite struct {
diff --git a/extras/hs-test/suite_ns_test.go b/extras/hs-test/suite_ns_test.go
index 4e8f497..b32fec7 100644
--- a/extras/hs-test/suite_ns_test.go
+++ b/extras/hs-test/suite_ns_test.go
@@ -2,8 +2,8 @@
const (
// These correspond to names used in yaml config
- clientInterface = "hst_client_vpp"
- serverInterface = "hst_server_vpp"
+ clientInterface = "hclnvpp"
+ serverInterface = "hsrvvpp"
)
type NsSuite struct {
diff --git a/extras/hs-test/suite_veth_test.go b/extras/hs-test/suite_veth_test.go
index 8593c88..4158c76 100644
--- a/extras/hs-test/suite_veth_test.go
+++ b/extras/hs-test/suite_veth_test.go
@@ -6,8 +6,8 @@
const (
// These correspond to names used in yaml config
- serverInterfaceName = "vppsrv"
- clientInterfaceName = "vppcln"
+ serverInterfaceName = "srv"
+ clientInterfaceName = "cln"
)
type VethsSuite struct {
diff --git a/extras/hs-test/tools/http_server/http_server.go b/extras/hs-test/tools/http_server/http_server.go
index 2b6512b..8edbb14 100644
--- a/extras/hs-test/tools/http_server/http_server.go
+++ b/extras/hs-test/tools/http_server/http_server.go
@@ -13,8 +13,8 @@
os.Exit(1)
}
- http.HandleFunc("/10M", func(w http.ResponseWriter, r *http.Request) {
- file, _ := os.Open("10M")
+ http.HandleFunc("/httpTestFile", func(w http.ResponseWriter, r *http.Request) {
+ file, _ := os.Open("httpTestFile")
defer file.Close()
io.Copy(w, file)
})
diff --git a/extras/hs-test/topo-network/2peerVeth.yaml b/extras/hs-test/topo-network/2peerVeth.yaml
index 9a966dc..f991d8b 100644
--- a/extras/hs-test/topo-network/2peerVeth.yaml
+++ b/extras/hs-test/topo-network/2peerVeth.yaml
@@ -3,23 +3,23 @@
- name: "hsns"
type: "netns"
- - name: "vppsrv"
+ - name: "srv"
type: "veth"
preset-hw-address: "00:00:5e:00:53:01"
peer:
- name: "vppsrv_veth"
+ name: "srv_veth"
netns: "hsns"
- - name: "vppcln"
+ - name: "cln"
type: "veth"
peer:
- name: "vppcln_veth"
+ name: "cln_veth"
netns: "hsns"
- name: "br"
type: "bridge"
netns: "hsns"
interfaces:
- - vppsrv_veth
- - vppcln_veth
+ - srv_veth
+ - cln_veth
diff --git a/extras/hs-test/topo-network/2taps.yaml b/extras/hs-test/topo-network/2taps.yaml
index 38f6fca..f5dd8e2 100644
--- a/extras/hs-test/topo-network/2taps.yaml
+++ b/extras/hs-test/topo-network/2taps.yaml
@@ -1,6 +1,6 @@
---
devices:
- - name: "hst_client"
+ - name: "hstcln"
type: "tap"
ip4:
network: 1
@@ -8,7 +8,7 @@
name: ""
ip4:
network: 1
- - name: "hst_server"
+ - name: "hstsrv"
type: "tap"
ip4:
network: 2
diff --git a/extras/hs-test/topo-network/ns.yaml b/extras/hs-test/topo-network/ns.yaml
index cf77f7e..018c329 100644
--- a/extras/hs-test/topo-network/ns.yaml
+++ b/extras/hs-test/topo-network/ns.yaml
@@ -1,23 +1,23 @@
---
devices:
- - name: "client"
+ - name: "cln"
type: "netns"
- - name: "server"
+ - name: "srv"
type: "netns"
- - name: "hst_client_vpp"
+ - name: "hclnvpp"
type: "veth"
peer:
- name: "client"
- netns: "client"
+ name: "cln"
+ netns: "cln"
ip4:
network: 1
- - name: "hst_server_vpp"
+ - name: "hsrvvpp"
type: "veth"
peer:
- name: "server"
- netns: "server"
+ name: "srv"
+ netns: "srv"
ip4:
network: 2
diff --git a/extras/hs-test/topo-network/tap.yaml b/extras/hs-test/topo-network/tap.yaml
index 26481de..acf1495 100644
--- a/extras/hs-test/topo-network/tap.yaml
+++ b/extras/hs-test/topo-network/tap.yaml
@@ -1,6 +1,6 @@
---
devices:
- - name: "hst_tap_host"
+ - name: "htaphost"
type: "tap"
ip4:
network: 1