hs-test: check exit value of ab/wrk
[vpp.git] / extras / hs-test / http_test.go
index 93705b2..310dc83 100644 (file)
@@ -8,7 +8,7 @@ import (
 
 func (s *NsSuite) TestHttpTps() {
        iface := s.netInterfaces[clientInterface]
-       client_ip := iface.IP4AddressString()
+       client_ip := iface.ip4AddressString()
        port := "8080"
        finished := make(chan error, 1)
 
@@ -31,7 +31,7 @@ func (s *VethsSuite) TestHttpCli() {
 
        serverContainer.vppInstance.vppctl("http cli server")
 
-       uri := "http://" + serverVeth.IP4AddressString() + "/80"
+       uri := "http://" + serverVeth.ip4AddressString() + "/80"
 
        o := clientContainer.vppInstance.vppctl("http cli client" +
                " uri " + uri + " query /show/version")
@@ -48,10 +48,9 @@ func (s *NoTopoSuite) TestNginxAsServer() {
        s.assertNil(nginxCont.run())
 
        vpp := s.getContainerByName("vpp").vppInstance
-       err := vpp.waitForApp("-app", 5)
-       s.assertNil(err)
+       vpp.waitForApp("nginx-", 5)
 
-       serverAddress := s.netInterfaces[tapNameVpp].IP4AddressString()
+       serverAddress := s.netInterfaces[tapInterfaceName].peer.ip4AddressString()
 
        defer func() { os.Remove(query) }()
        go startWget(finished, serverAddress, "80", query, "")
@@ -64,7 +63,7 @@ func runNginxPerf(s *NoTopoSuite, mode, ab_or_wrk string) error {
        var args []string
        var exeName string
 
-       serverAddress := s.netInterfaces[tapNameVpp].IP4AddressString()
+       serverAddress := s.netInterfaces[tapInterfaceName].peer.ip4AddressString()
 
        if ab_or_wrk == "ab" {
                args = []string{"-n", fmt.Sprintf("%d", nRequests), "-c",
@@ -86,13 +85,13 @@ func runNginxPerf(s *NoTopoSuite, mode, ab_or_wrk string) error {
 
        nginxCont := s.getContainerByName("nginx")
        s.assertNil(nginxCont.run())
-       err := vpp.waitForApp("-app", 5)
-       s.assertNil(err)
+       vpp.waitForApp("nginx-", 5)
 
        cmd := exec.Command(exeName, args...)
        s.log(cmd)
-       o, _ := cmd.CombinedOutput()
+       o, err := cmd.CombinedOutput()
        s.log(string(o))
+       s.assertNil(err)
        s.assertNotEmpty(o)
        return nil
 }