Skip to content

Commit

Permalink
OCPBUGS-14914: Add e2e tests for tunnel and server timeouts
Browse files Browse the repository at this point in the history
- Added a new command to run a websocket server that delays responses
- Implemented e2e scenarios to test the server and tunnel timeout tuning options
  • Loading branch information
alebedev87 committed Jul 2, 2024
1 parent b18a07c commit 04bfed5
Show file tree
Hide file tree
Showing 25 changed files with 814 additions and 614 deletions.
2 changes: 2 additions & 0 deletions cmd/ingress-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
h2specclient "github.com/openshift/cluster-ingress-operator/test/h2spec"
httphealthcheck "github.com/openshift/cluster-ingress-operator/test/http"
http2testserver "github.com/openshift/cluster-ingress-operator/test/http2"
wstestserver "github.com/openshift/cluster-ingress-operator/test/ws"
)

var log = logf.Logger.WithName("main")
Expand Down Expand Up @@ -37,6 +38,7 @@ func main() {
})
rootCmd.AddCommand(h2specclient.NewClientCommand())
rootCmd.AddCommand(httphealthcheck.NewServeDelayConnectCommand())
rootCmd.AddCommand(wstestserver.NewServeWebSocketCommand())

if err := rootCmd.Execute(); err != nil {
log.Error(err, "error")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require (
github.com/go-logr/zapr v1.3.0
github.com/google/go-cmp v0.6.0
github.com/google/gopacket v1.1.19
github.com/gorilla/websocket v1.5.1
github.com/jongio/azidext/go/azidext v0.4.0
github.com/maistra/istio-operator v0.0.0-20230322122339-793794762e67
github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible
Expand Down Expand Up @@ -90,7 +91,6 @@ require (
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1299,8 +1299,9 @@ github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ func TestAll(t *testing.T) {
t.Run("TestSetRouteResponseHeaders", TestSetRouteResponseHeaders)
t.Run("TestReconcileInternalService", TestReconcileInternalService)
t.Run("TestConnectTimeout", TestConnectTimeout)
t.Run("TestServerTimeout", TestServerTimeout)
t.Run("TestTunnelTimeout", TestTunnelTimeout)
})

t.Run("serial", func(t *testing.T) {
Expand Down
Loading

0 comments on commit 04bfed5

Please sign in to comment.