diff options
Diffstat (limited to 'extras/hs-test/proxy_test.go')
-rw-r--r-- | extras/hs-test/proxy_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/extras/hs-test/proxy_test.go b/extras/hs-test/proxy_test.go index 5ca151f6228..1f5d13e269b 100644 --- a/extras/hs-test/proxy_test.go +++ b/extras/hs-test/proxy_test.go @@ -9,6 +9,7 @@ import ( func init() { RegisterVppProxyTests(VppProxyHttpGetTcpTest, VppProxyHttpGetTlsTest, VppProxyHttpPutTcpTest, VppProxyHttpPutTlsTest, VppConnectProxyGetTest, VppConnectProxyPutTest) + RegisterVppUdpProxyTests(VppProxyUdpTest) RegisterEnvoyProxyTests(EnvoyProxyHttpGetTcpTest, EnvoyProxyHttpPutTcpTest) RegisterNginxProxyTests(NginxMirroringTest) RegisterNginxProxySoloTests(MirrorMultiThreadTest) @@ -101,3 +102,18 @@ func VppConnectProxyPutTest(s *VppProxySuite) { targetUri := fmt.Sprintf("http://%s:%d/upload/testFile", s.NginxAddr(), s.NginxPort()) s.CurlUploadResourceViaTunnel(targetUri, proxyUri, CurlContainerTestFile) } + +func VppProxyUdpTest(s *VppUdpProxySuite) { + remoteServerConn := s.StartEchoServer() + defer remoteServerConn.Close() + + vppProxy := s.GetContainerByName(VppUdpProxyContainerName).VppInstance + cmd := fmt.Sprintf("test proxy server fifo-size 512k server-uri udp://%s/%d", s.VppProxyAddr(), s.ProxyPort()) + cmd += fmt.Sprintf(" client-uri udp://%s/%d", s.ServerAddr(), s.ServerPort()) + s.Log(vppProxy.Vppctl(cmd)) + + b := make([]byte, 1500) + n, err := s.ClientSendReceive([]byte("hello"), b) + s.AssertNil(err, fmt.Sprint(err)) + s.AssertEqual([]byte("hello"), b[:n]) +} |