diff options
author | Maros Ondrejicka <maros.ondrejicka@pantheon.tech> | 2023-02-02 08:58:04 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2023-02-10 05:23:19 +0000 |
commit | 2908f8cf07c21f385f80d83fdad826a0eea98977 (patch) | |
tree | 6391c5b989f2a7800958489feb1d7f460a87e850 /extras/hs-test/utils.go | |
parent | 0a192ea93df9d1cd4d7777bcc5418a2f9e861a6c (diff) |
hs-test: refactor test cases from ns suite
This converts more tests to configure VPP from test context.
Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: Idf26b0c16f87e87c97b198412af39b99d947ced6
Diffstat (limited to 'extras/hs-test/utils.go')
-rw-r--r-- | extras/hs-test/utils.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/extras/hs-test/utils.go b/extras/hs-test/utils.go index cf30ecec4e0..c5889035c40 100644 --- a/extras/hs-test/utils.go +++ b/extras/hs-test/utils.go @@ -98,7 +98,7 @@ func StartServerApp(running chan error, done chan struct{}, env []string) { cmd.Process.Kill() } -func StartClientApp(env []string, clnCh chan error, clnRes chan string) { +func StartClientApp(ipAddress string, env []string, clnCh chan error, clnRes chan string) { defer func() { clnCh <- nil }() @@ -106,7 +106,7 @@ func StartClientApp(env []string, clnCh chan error, clnRes chan string) { nTries := 0 for { - cmd := exec.Command("iperf3", "-c", "10.10.10.1", "-u", "-l", "1460", "-b", "10g") + cmd := exec.Command("iperf3", "-c", ipAddress, "-u", "-l", "1460", "-b", "10g") if env != nil { cmd.Env = env } @@ -183,12 +183,15 @@ func startWget(finished chan error, server_ip, port, query, netNs string) { finished <- errors.New("wget error") }() - cmd := NewCommand([]string{"wget", "--no-proxy", "--tries=5", "-q", "-O", "/dev/null", server_ip + ":" + port + "/" + query}, + cmd := NewCommand([]string{"wget", "--timeout=10", "--no-proxy", "--tries=5", "-O", "/dev/null", server_ip + ":" + port + "/" + query}, netNs) o, err := cmd.CombinedOutput() if err != nil { finished <- fmt.Errorf("wget error: '%v\n\n%s'", err, o) return + } else if strings.Contains(string(o), "200 OK") == false { + finished <- fmt.Errorf("wget error: response not 200 OK") + return } finished <- nil } |