diff options
Diffstat (limited to 'extras/hs-test/infra')
-rw-r--r-- | extras/hs-test/infra/suite_envoy_proxy.go | 6 | ||||
-rw-r--r-- | extras/hs-test/infra/suite_vpp_proxy.go | 22 |
2 files changed, 26 insertions, 2 deletions
diff --git a/extras/hs-test/infra/suite_envoy_proxy.go b/extras/hs-test/infra/suite_envoy_proxy.go index e1bfae293a2..52f94bc76aa 100644 --- a/extras/hs-test/infra/suite_envoy_proxy.go +++ b/extras/hs-test/infra/suite_envoy_proxy.go @@ -136,6 +136,12 @@ func (s *EnvoyProxySuite) CurlDownloadResource(uri string) { s.AssertContains(log, "HTTP/1.1 200") } +func (s *EnvoyProxySuite) CurlUploadResource(uri, file string) { + args := fmt.Sprintf("--insecure --noproxy '*' -T %s %s", file, uri) + _, log := s.RunCurlContainer(args) + s.AssertContains(log, "HTTP/1.1 201") +} + var _ = Describe("EnvoyProxySuite", Ordered, ContinueOnFailure, func() { var s EnvoyProxySuite BeforeAll(func() { diff --git a/extras/hs-test/infra/suite_vpp_proxy.go b/extras/hs-test/infra/suite_vpp_proxy.go index 94bd0f9aa4e..a13897eb8d0 100644 --- a/extras/hs-test/infra/suite_vpp_proxy.go +++ b/extras/hs-test/infra/suite_vpp_proxy.go @@ -18,6 +18,7 @@ const ( VppProxyContainerName = "vpp-proxy" ClientTapInterfaceName = "hstcln" ServerTapInterfaceName = "hstsrv" + CurlContainerTestFile = "/tmp/testFile" ) type VppProxySuite struct { @@ -102,7 +103,7 @@ func (s *VppProxySuite) CurlRequest(targetUri string) (string, string) { } func (s *VppProxySuite) CurlRequestViaTunnel(targetUri string, proxyUri string) (string, string) { - args := fmt.Sprintf("--insecure -p -x %s %s", proxyUri, targetUri) + args := fmt.Sprintf("--max-time 60 --insecure -p -x %s %s", proxyUri, targetUri) body, log := s.RunCurlContainer(args) return body, log } @@ -114,11 +115,28 @@ func (s *VppProxySuite) CurlDownloadResource(uri string) { s.AssertContains(log, "HTTP/1.1 200") } +func (s *VppProxySuite) CurlUploadResource(uri, file string) { + args := fmt.Sprintf("--insecure --noproxy '*' -T %s %s", file, uri) + _, log := s.RunCurlContainer(args) + s.AssertContains(log, "HTTP/1.1 201") +} + func (s *VppProxySuite) CurlDownloadResourceViaTunnel(uri string, proxyUri string) { - args := fmt.Sprintf("--insecure -p -x %s --remote-name --output-dir /tmp %s", proxyUri, uri) + args := fmt.Sprintf("--max-time 180 --insecure -p -x %s --remote-name --output-dir /tmp %s", proxyUri, uri) _, log := s.RunCurlContainer(args) s.AssertNotContains(log, "Recv failure") + s.AssertNotContains(log, "Operation timed out") + s.AssertContains(log, "CONNECT tunnel established") s.AssertContains(log, "HTTP/1.1 200") + s.AssertNotContains(log, "bytes remaining to read") +} + +func (s *VppProxySuite) CurlUploadResourceViaTunnel(uri, proxyUri, file string) { + args := fmt.Sprintf("--max-time 180 --insecure -p -x %s -T %s %s", proxyUri, file, uri) + _, log := s.RunCurlContainer(args) + s.AssertNotContains(log, "Operation timed out") + s.AssertContains(log, "CONNECT tunnel established") + s.AssertContains(log, "HTTP/1.1 201") } var _ = Describe("VppProxySuite", Ordered, ContinueOnFailure, func() { |