summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/proxy_test.go
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2024-09-06 15:30:59 +0200
committerFlorin Coras <florin.coras@gmail.com>2024-09-10 16:35:23 +0000
commit5b175eca2d6389bfb0c09839436df83cf8df334c (patch)
treedeccee366af3239f0d132f6a58aa8c88004b8ce9 /extras/hs-test/proxy_test.go
parent6e129e3a4522f429fc6cee7f5bde2fde8082af83 (diff)
hs-test: upload via proxy tests
Type: test Change-Id: Id6b4e2348735081c827f814a814c976b601432ec Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'extras/hs-test/proxy_test.go')
-rw-r--r--extras/hs-test/proxy_test.go29
1 files changed, 24 insertions, 5 deletions
diff --git a/extras/hs-test/proxy_test.go b/extras/hs-test/proxy_test.go
index 167cf25fa52..7ec97c76c02 100644
--- a/extras/hs-test/proxy_test.go
+++ b/extras/hs-test/proxy_test.go
@@ -6,8 +6,8 @@ import (
)
func init() {
- RegisterVppProxyTests(VppProxyHttpTcpTest, VppProxyHttpTlsTest)
- RegisterEnvoyProxyTests(EnvoyProxyHttpTcpTest)
+ RegisterVppProxyTests(VppProxyHttpGetTcpTest, VppProxyHttpGetTlsTest, VppProxyHttpPutTcpTest, VppProxyHttpPutTlsTest)
+ RegisterEnvoyProxyTests(EnvoyProxyHttpGetTcpTest, EnvoyProxyHttpPutTcpTest)
RegisterNginxProxyTests(NginxMirroringTest)
}
@@ -24,25 +24,44 @@ func configureVppProxy(s *VppProxySuite, proto string, proxyPort uint16) {
s.Log("proxy configured: " + output)
}
-func VppProxyHttpTcpTest(s *VppProxySuite) {
+func VppProxyHttpGetTcpTest(s *VppProxySuite) {
var proxyPort uint16 = 8080
configureVppProxy(s, "tcp", proxyPort)
uri := fmt.Sprintf("http://%s:%d/httpTestFile", s.VppProxyAddr(), proxyPort)
s.CurlDownloadResource(uri)
}
-func VppProxyHttpTlsTest(s *VppProxySuite) {
+func VppProxyHttpGetTlsTest(s *VppProxySuite) {
var proxyPort uint16 = 8080
configureVppProxy(s, "tls", proxyPort)
uri := fmt.Sprintf("https://%s:%d/httpTestFile", s.VppProxyAddr(), proxyPort)
s.CurlDownloadResource(uri)
}
-func EnvoyProxyHttpTcpTest(s *EnvoyProxySuite) {
+func VppProxyHttpPutTcpTest(s *VppProxySuite) {
+ var proxyPort uint16 = 8080
+ configureVppProxy(s, "tcp", proxyPort)
+ uri := fmt.Sprintf("http://%s:%d/upload/testFile", s.VppProxyAddr(), proxyPort)
+ s.CurlUploadResource(uri, CurlContainerTestFile)
+}
+
+func VppProxyHttpPutTlsTest(s *VppProxySuite) {
+ var proxyPort uint16 = 8080
+ configureVppProxy(s, "tls", proxyPort)
+ uri := fmt.Sprintf("https://%s:%d/upload/testFile", s.VppProxyAddr(), proxyPort)
+ s.CurlUploadResource(uri, CurlContainerTestFile)
+}
+
+func EnvoyProxyHttpGetTcpTest(s *EnvoyProxySuite) {
uri := fmt.Sprintf("http://%s:%d/httpTestFile", s.ProxyAddr(), s.ProxyPort())
s.CurlDownloadResource(uri)
}
+func EnvoyProxyHttpPutTcpTest(s *EnvoyProxySuite) {
+ uri := fmt.Sprintf("http://%s:%d/upload/testFile", s.ProxyAddr(), s.ProxyPort())
+ s.CurlUploadResource(uri, CurlContainerTestFile)
+}
+
// broken when CPUS > 1
func NginxMirroringTest(s *NginxProxySuite) {
s.SkipIfMultiWorker()