From 2b17004639bc1d9929ed9e7bb8b20d99f893cd9a Mon Sep 17 00:00:00 2001 From: Onyeocha Favour <97852822+FavourEva@users.noreply.github.com> Date: Wed, 8 Nov 2023 18:07:53 +0100 Subject: [PATCH] Add Test Case for Protocol Forced to HTTP in buildListenerCreateOpt (#2470) --- pkg/openstack/loadbalancer_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkg/openstack/loadbalancer_test.go b/pkg/openstack/loadbalancer_test.go index 4759fc383f..58022027ef 100644 --- a/pkg/openstack/loadbalancer_test.go +++ b/pkg/openstack/loadbalancer_test.go @@ -2385,6 +2385,27 @@ func TestBuildListenerCreateOpt(t *testing.T) { Tags: nil, }, }, + { + name: "Test with Protocol forced to HTTP", + port: corev1.ServicePort{ + Protocol: "TCP", + Port: 80, + }, + svcConf: &serviceConfig{ + connLimit: 100, + lbName: "my-lb", + keepClientIP: true, + tlsContainerRef: "", + }, + expectedCreateOpt: listeners.CreateOpts{ + Name: "Test with Protocol forced to HTTP", + Protocol: listeners.ProtocolHTTP, + ProtocolPort: 80, + ConnLimit: &svcConf.connLimit, + InsertHeaders: map[string]string{"X-Forwarded-For": "true"}, + Tags: nil, + }, + }, } for _, tc := range testCases {