aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/proxy_test.go
diff options
context:
space:
mode:
authoradrianvillin <avillin@cisco.com>2024-02-12 02:44:53 -0500
committerFlorin Coras <florin.coras@gmail.com>2024-02-15 02:38:10 +0000
commit7c675471e87c72be272c078fd481844e4efa64d0 (patch)
tree0fe20b6de72178124750a7a8f92155bef4a7c815 /extras/hs-test/proxy_test.go
parent0215ef1010fbe41a72d57e7cddc4fb18dc3d53d2 (diff)
hs-test: improved logging
- improved readability of some error messages - printing container logs to stdout on test failure (last 20 lines) Type: test Change-Id: Idbb358bdd89aa7b1a6bdc9d96bf029d4c299ce64 Signed-off-by: adrianvillin <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test/proxy_test.go')
-rw-r--r--extras/hs-test/proxy_test.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/extras/hs-test/proxy_test.go b/extras/hs-test/proxy_test.go
index 7b7321eba6d..cdb516a108b 100644
--- a/extras/hs-test/proxy_test.go
+++ b/extras/hs-test/proxy_test.go
@@ -15,7 +15,7 @@ func testProxyHttpTcp(s *NsSuite, proto string) error {
// create test file
err := exechelper.Run(fmt.Sprintf("ip netns exec server truncate -s %s %s", srcFile, srcFile))
- s.assertNil(err, "failed to run truncate command")
+ s.assertNil(err, "failed to run truncate command: " + fmt.Sprint(err))
defer func() { os.Remove(srcFile) }()
s.log("test file created...")
@@ -39,7 +39,7 @@ func testProxyHttpTcp(s *NsSuite, proto string) error {
c += fmt.Sprintf("%s:555/%s", clientVeth.ip4AddressString(), srcFile)
s.log(c)
_, err = exechelper.CombinedOutput(c)
- s.assertNil(err, "failed to run wget")
+ s.assertNil(err, "failed to run wget: '%s', cmd: %s", err, c)
stopServer <- struct{}{}
defer func() { os.Remove(outputFile) }()
@@ -66,19 +66,20 @@ func (s *NsSuite) TestVppProxyHttpTcp() {
proto := "tcp"
configureVppProxy(s, proto)
err := testProxyHttpTcp(s, proto)
- s.assertNil(err)
+ s.assertNil(err, err)
}
func (s *NsSuite) TestVppProxyHttpTls() {
proto := "tls"
configureVppProxy(s, proto)
err := testProxyHttpTcp(s, proto)
- s.assertNil(err)
+ s.assertNil(err, err)
}
func configureEnvoyProxy(s *NsSuite) {
envoyContainer := s.getContainerByName("envoy")
- envoyContainer.create()
+ err := envoyContainer.create()
+ s.assertNil(err, "Error creating envoy container: %s", err)
serverVeth := s.netInterfaces[serverInterface]
address := struct {
@@ -97,5 +98,5 @@ func configureEnvoyProxy(s *NsSuite) {
func (s *NsSuite) TestEnvoyProxyHttpTcp() {
configureEnvoyProxy(s)
err := testProxyHttpTcp(s, "tcp")
- s.assertNil(err)
+ s.assertNil(err, err)
}