aboutsummaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
Diffstat (limited to 'extras')
-rw-r--r--extras/hs-test/echo_test.go4
-rw-r--r--extras/hs-test/http_test.go5
-rw-r--r--extras/hs-test/proxy_test.go18
-rw-r--r--extras/hs-test/raw_session_test.go2
-rw-r--r--extras/hs-test/suite_nginx_test.go10
-rw-r--r--extras/hs-test/suite_no_topo_test.go5
-rw-r--r--extras/hs-test/suite_ns_test.go4
-rw-r--r--extras/hs-test/suite_veth_test.go4
-rw-r--r--extras/hs-test/tools/http_server/http_server.go4
-rw-r--r--extras/hs-test/topo-network/2peerVeth.yaml12
-rw-r--r--extras/hs-test/topo-network/2taps.yaml4
-rw-r--r--extras/hs-test/topo-network/ns.yaml16
-rw-r--r--extras/hs-test/topo-network/tap.yaml2
13 files changed, 47 insertions, 43 deletions
diff --git a/extras/hs-test/echo_test.go b/extras/hs-test/echo_test.go
index 160613742f2..8dd620a336a 100644
--- a/extras/hs-test/echo_test.go
+++ b/extras/hs-test/echo_test.go
@@ -2,7 +2,7 @@ package main
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 @@ func (s *VethsSuite) TestTcpWithLoss() {
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 e710f38835b..068d0424555 100644
--- a/extras/hs-test/http_test.go
+++ b/extras/hs-test/http_test.go
@@ -11,13 +11,14 @@ func (s *NsSuite) TestHttpTps() {
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 @@ func runNginxPerf(s *NoTopoSuite, mode, ab_or_wrk string) error {
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 cdb516a108b..748e48b0344 100644
--- a/extras/hs-test/proxy_test.go
+++ b/extras/hs-test/proxy_test.go
@@ -9,18 +9,21 @@ import (
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 @@ func testProxyHttpTcp(s *NsSuite, proto string) error {
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 45c4278c470..386f9bc685f 100644
--- a/extras/hs-test/raw_session_test.go
+++ b/extras/hs-test/raw_session_test.go
@@ -14,7 +14,7 @@ func (s *VethsSuite) TestVppEchoTcp() {
}
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 4fc06265a29..94fd010814a 100644
--- a/extras/hs-test/suite_nginx_test.go
+++ b/extras/hs-test/suite_nginx_test.go
@@ -2,11 +2,11 @@ package main
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 c6b3170dd5e..97e5ca4f416 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 4e8f497076a..b32fec7e729 100644
--- a/extras/hs-test/suite_ns_test.go
+++ b/extras/hs-test/suite_ns_test.go
@@ -2,8 +2,8 @@ package main
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 8593c88740a..4158c769474 100644
--- a/extras/hs-test/suite_veth_test.go
+++ b/extras/hs-test/suite_veth_test.go
@@ -6,8 +6,8 @@ import (
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 2b6512be5fd..8edbb149967 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 @@ func main() {
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 9a966dc441f..f991d8b3701 100644
--- a/extras/hs-test/topo-network/2peerVeth.yaml
+++ b/extras/hs-test/topo-network/2peerVeth.yaml
@@ -3,23 +3,23 @@ devices:
- 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 38f6fca4f31..f5dd8e2adda 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 @@ devices:
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 cf77f7e756b..018c329f77e 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 26481de703b..acf14958ba3 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