diff --git a/deploy/tests/e2e/access-control/access_control_test.go b/deploy/tests/e2e/access-control/access_control_test.go index f9841768..eb97e9ad 100644 --- a/deploy/tests/e2e/access-control/access_control_test.go +++ b/deploy/tests/e2e/access-control/access_control_test.go @@ -44,7 +44,7 @@ func (suite *AccessControlSuite) Test_Whitelist() { {"allow-list", " 192.168.2.0/24"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.eventuallyReturns("192.168.2.3", http.StatusOK) suite.eventuallyReturns("192.168.5.3", http.StatusForbidden) @@ -57,7 +57,7 @@ func (suite *AccessControlSuite) Test_Whitelist() { {"whitelist", "192.168.4.0/24"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.eventuallyReturns("192.168.4.3", http.StatusOK) suite.eventuallyReturns("192.168.5.3", http.StatusForbidden) @@ -71,7 +71,7 @@ func (suite *AccessControlSuite) Test_Whitelist() { {"allow-list", "192.168.5.0/24"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.eventuallyReturns("192.168.5.3", http.StatusOK) suite.eventuallyReturns("192.168.4.3", http.StatusForbidden) @@ -84,8 +84,8 @@ func (suite *AccessControlSuite) Test_Whitelist() { {"allow-list", " patterns/ips"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) - suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) suite.eventuallyReturns("192.168.0.3", http.StatusOK) suite.eventuallyReturns("192.168.2.3", http.StatusForbidden) @@ -98,8 +98,8 @@ func (suite *AccessControlSuite) Test_Whitelist() { {"whitelist", " patterns/ips2"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) - suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) suite.eventuallyReturns("192.169.0.3", http.StatusOK) suite.eventuallyReturns("192.168.2.3", http.StatusForbidden) @@ -113,8 +113,8 @@ func (suite *AccessControlSuite) Test_Whitelist() { {"allow-list", " patterns/ips"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) - suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) suite.eventuallyReturns("192.168.0.3", http.StatusOK) suite.eventuallyReturns("192.168.2.3", http.StatusForbidden) @@ -129,7 +129,7 @@ func (suite *AccessControlSuite) Test_Blacklist() { {"deny-list", " 192.168.2.0/24"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.eventuallyReturns("192.168.2.3", http.StatusForbidden) suite.eventuallyReturns("192.168.5.3", http.StatusOK) @@ -142,7 +142,7 @@ func (suite *AccessControlSuite) Test_Blacklist() { {"blacklist", "192.168.4.0/24"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.eventuallyReturns("192.168.4.3", http.StatusForbidden) suite.eventuallyReturns("192.168.5.3", http.StatusOK) @@ -156,7 +156,7 @@ func (suite *AccessControlSuite) Test_Blacklist() { {"deny-list", "192.168.5.0/24"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.eventuallyReturns("192.168.5.3", http.StatusForbidden) suite.eventuallyReturns("192.168.4.3", http.StatusOK) @@ -169,8 +169,8 @@ func (suite *AccessControlSuite) Test_Blacklist() { {"deny-list", "patterns/ips"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) - suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) suite.eventuallyReturns("192.168.0.3", http.StatusForbidden) suite.eventuallyReturns("192.168.2.3", http.StatusOK) @@ -183,8 +183,8 @@ func (suite *AccessControlSuite) Test_Blacklist() { {"blacklist", " patterns/ips2"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) - suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) suite.eventuallyReturns("192.169.0.3", http.StatusForbidden) suite.eventuallyReturns("192.168.2.3", http.StatusOK) @@ -197,8 +197,8 @@ func (suite *AccessControlSuite) Test_Blacklist() { {"deny-list", "patterns/ips"}, } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) - suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil)) suite.eventuallyReturns("192.168.0.3", http.StatusForbidden) suite.eventuallyReturns("192.169.2.3", http.StatusOK) diff --git a/deploy/tests/e2e/access-control/suite_test.go b/deploy/tests/e2e/access-control/suite_test.go index 755a7ac9..abe700f3 100644 --- a/deploy/tests/e2e/access-control/suite_test.go +++ b/deploy/tests/e2e/access-control/suite_test.go @@ -39,12 +39,12 @@ type tmplData struct { func (suite *AccessControlSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) + suite.Require().NoError(err) - suite.NoError(suite.test.Apply("config/patternfile-empty.yml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/patternfile-empty.yml", "", nil)) } func (suite *AccessControlSuite) TearDownSuite() { diff --git a/deploy/tests/e2e/admin-port/suite_test.go b/deploy/tests/e2e/admin-port/suite_test.go index f852a07c..048b02ce 100644 --- a/deploy/tests/e2e/admin-port/suite_test.go +++ b/deploy/tests/e2e/admin-port/suite_test.go @@ -38,10 +38,10 @@ type tmplData struct { func (suite *AdminPortSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) + suite.Require().NoError(err) } func (suite *AdminPortSuite) TearDownSuite() { diff --git a/deploy/tests/e2e/basic-auth/basic_auth_test.go b/deploy/tests/e2e/basic-auth/basic_auth_test.go index 9be224af..9a5d23c7 100644 --- a/deploy/tests/e2e/basic-auth/basic_auth_test.go +++ b/deploy/tests/e2e/basic-auth/basic_auth_test.go @@ -24,7 +24,7 @@ import ( func (suite *HTTPBasicAuthSuite) Test_BasicAuth() { suite.Run("Denied", func() { - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/basic-auth/suite_test.go b/deploy/tests/e2e/basic-auth/suite_test.go index 6b81176f..79e4ce06 100644 --- a/deploy/tests/e2e/basic-auth/suite_test.go +++ b/deploy/tests/e2e/basic-auth/suite_test.go @@ -38,10 +38,10 @@ type tmplData struct { func (suite *HTTPBasicAuthSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) + suite.Require().NoError(err) } func (suite *HTTPBasicAuthSuite) TearDownSuite() { diff --git a/deploy/tests/e2e/canary-deployment/percentage_test.go b/deploy/tests/e2e/canary-deployment/percentage_test.go index 829f1f32..b24221c1 100644 --- a/deploy/tests/e2e/canary-deployment/percentage_test.go +++ b/deploy/tests/e2e/canary-deployment/percentage_test.go @@ -28,7 +28,7 @@ func (suite *CanaryDeploymentSuite) Test_Response_Percentage() { for _, percentage := range []int{0, 25, 100} { suite.Run(fmt.Sprintf("%d", percentage), func() { suite.tmplData.StagingRouteACL = fmt.Sprintf("rand(100) lt %d", percentage) - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Eventually(func() bool { counter := 0 for i := 0; i < 10; i++ { diff --git a/deploy/tests/e2e/canary-deployment/suite_test.go b/deploy/tests/e2e/canary-deployment/suite_test.go index b0e8e446..98e3f627 100644 --- a/deploy/tests/e2e/canary-deployment/suite_test.go +++ b/deploy/tests/e2e/canary-deployment/suite_test.go @@ -41,13 +41,13 @@ type tmplData struct { func (suite *CanaryDeploymentSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{ Host: suite.test.GetNS() + ".test", StagingRouteACL: "rand(100) lt 0", } suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) + suite.Require().NoError(err) suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { res, cls, err := suite.client.Do() diff --git a/deploy/tests/e2e/config-snippet/backend_cfg_snippet_test.go b/deploy/tests/e2e/config-snippet/backend_cfg_snippet_test.go index 3658762f..05b0ef8b 100644 --- a/deploy/tests/e2e/config-snippet/backend_cfg_snippet_test.go +++ b/deploy/tests/e2e/config-snippet/backend_cfg_snippet_test.go @@ -24,7 +24,7 @@ import ( ) func (suite *ConfigSnippetSuite) TestBackendCfgSnippet() { - suite.NoError(suite.test.Apply("config/backend-cfg-snippet.yaml", suite.test.GetNS(), nil)) + suite.Require().NoError(suite.test.Apply("config/backend-cfg-snippet.yaml", suite.test.GetNS(), nil)) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if err != nil { diff --git a/deploy/tests/e2e/config-snippet/frontend_cfg_snippet_test.go b/deploy/tests/e2e/config-snippet/frontend_cfg_snippet_test.go index 1ff86e40..089fb4b3 100644 --- a/deploy/tests/e2e/config-snippet/frontend_cfg_snippet_test.go +++ b/deploy/tests/e2e/config-snippet/frontend_cfg_snippet_test.go @@ -24,7 +24,7 @@ import ( ) func (suite *ConfigSnippetSuite) TestFrontendCfgSnippet() { - suite.NoError(suite.test.Apply("config/configmap.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/configmap.yaml", "", nil)) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if err != nil { diff --git a/deploy/tests/e2e/config-snippet/suite_test.go b/deploy/tests/e2e/config-snippet/suite_test.go index 717c46e0..233b967c 100644 --- a/deploy/tests/e2e/config-snippet/suite_test.go +++ b/deploy/tests/e2e/config-snippet/suite_test.go @@ -38,11 +38,11 @@ type tmplData struct { func (suite *ConfigSnippetSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/cors/cors_test.go b/deploy/tests/e2e/cors/cors_test.go index af33ab9a..70f5ab50 100644 --- a/deploy/tests/e2e/cors/cors_test.go +++ b/deploy/tests/e2e/cors/cors_test.go @@ -46,7 +46,7 @@ func (suite *CorsSuite) Test_Configmap_Alone() { suite.Run("CorsMethodsCredentialAlone", suite.CorsMethodsCredentialAlone(false)) suite.Run("CorsDisable", suite.CorsDisable(false)) suite.Run("CorsMethodsCredentialDisable", suite.CorsMethodsCredentialDisable(false)) - suite.NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil)) } func (suite *CorsSuite) Test_Ingress_Alone() { @@ -116,7 +116,7 @@ func (suite *CorsSuite) Default(ingressCors bool) func() { yamlFile = "config/configmap.yaml.tmpl" ns = "" } - suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) + suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) suite.eventuallyReturns(expectedHeaders, unexpectedHeaders) } @@ -148,7 +148,7 @@ func (suite *CorsSuite) CorsOriginAlone(ingressCors bool) func() { yamlFile = "config/configmap.yaml.tmpl" ns = "" } - suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) + suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) suite.eventuallyReturns(expectedHeaders, unexpectedHeaders) } @@ -180,7 +180,7 @@ func (suite *CorsSuite) CorsMethodsAlone(ingressCors bool) func() { yamlFile = "config/configmap.yaml.tmpl" ns = "" } - suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) + suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) suite.eventuallyReturns(expectedHeaders, unexpectedHeaders) } @@ -212,7 +212,7 @@ func (suite *CorsSuite) CorsMethodsHeadersAlone(ingressCors bool) func() { yamlFile = "config/configmap.yaml.tmpl" ns = "" } - suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) + suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) suite.eventuallyReturns(expectedHeaders, unexpectedHeaders) } @@ -244,7 +244,7 @@ func (suite *CorsSuite) CorsMethodsAgeAlone(ingressCors bool) func() { yamlFile = "config/configmap.yaml.tmpl" ns = "" } - suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) + suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) suite.eventuallyReturns(expectedHeaders, unexpectedHeaders) } @@ -276,7 +276,7 @@ func (suite *CorsSuite) CorsMethodsCredentialDisable(ingressCors bool) func() { yamlFile = "config/configmap.yaml.tmpl" ns = "" } - suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) + suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) suite.eventuallyReturns(expectedHeaders, unexpectedHeaders) } @@ -305,7 +305,7 @@ func (suite *CorsSuite) CorsMethodsCredentialAlone(ingressCors bool) func() { yamlFile = "config/configmap.yaml.tmpl" ns = "" } - suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) + suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) suite.eventuallyReturns(expectedHeaders, http.Header{}) } @@ -339,7 +339,7 @@ func (suite *CorsSuite) CorsDisable(ingressCors bool) func() { yamlFile = "config/configmap.yaml.tmpl" ns = "" } - suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) + suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData)) suite.eventuallyReturns(http.Header{}, unexpectedHeaders) } } diff --git a/deploy/tests/e2e/cors/suite_test.go b/deploy/tests/e2e/cors/suite_test.go index dc176155..376d28da 100644 --- a/deploy/tests/e2e/cors/suite_test.go +++ b/deploy/tests/e2e/cors/suite_test.go @@ -40,18 +40,18 @@ type tmplData struct { func (suite *CorsSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) + suite.Require().NoError(err) - suite.NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil)) - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), tmplData{Host: suite.test.GetNS() + ".test"})) + suite.Require().NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), tmplData{Host: suite.test.GetNS() + ".test"})) } func (suite *CorsSuite) TearDownSuite() { // suite.test.Apply("../../config/2.configmap.yaml", "", nil) - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), tmplData{Host: suite.test.GetNS() + ".test"})) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), tmplData{Host: suite.test.GetNS() + ".test"})) suite.test.TearDown() } diff --git a/deploy/tests/e2e/crd-tcp/cr_tcp_additional_services_test.go b/deploy/tests/e2e/crd-tcp/cr_tcp_additional_services_test.go index ec3d95e8..747cf3e5 100644 --- a/deploy/tests/e2e/crd-tcp/cr_tcp_additional_services_test.go +++ b/deploy/tests/e2e/crd-tcp/cr_tcp_additional_services_test.go @@ -91,10 +91,10 @@ func (suite *TCPSuiteAddtionalServices) Test_CRD_TCP_Additional_Services() { // Get updated config and check it cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg") - suite.NoError(err, "Could not get Haproxy config") + suite.Require().NoError(err, "Could not get Haproxy config") reader := strings.NewReader(cfg) p, err := parser.New(options.Reader(reader)) - suite.NoError(err, "Could not get Haproxy config parser") + suite.Require().NoError(err, "Could not get Haproxy config parser") suite.checkFrontends(p) diff --git a/deploy/tests/e2e/crd-tcp/cr_tcp_backend_switching_rule_test.go b/deploy/tests/e2e/crd-tcp/cr_tcp_backend_switching_rule_test.go index 459d028c..be6a6288 100644 --- a/deploy/tests/e2e/crd-tcp/cr_tcp_backend_switching_rule_test.go +++ b/deploy/tests/e2e/crd-tcp/cr_tcp_backend_switching_rule_test.go @@ -96,7 +96,7 @@ func (suite *TCPSuiteBackendSwitchingRule) Test_CRD_TCP_BackendSwitchingRule() { // Any other SNI should go to default http-echo suite.client, err = e2e.NewHTTPSClient("foo.bar", 32766) - suite.NoError(err) + suite.Require().NoError(err) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { @@ -114,10 +114,10 @@ func (suite *TCPSuiteBackendSwitchingRule) Test_CRD_TCP_BackendSwitchingRule() { // Get updated config and check it cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg") - suite.NoError(err, "Could not get Haproxy config") + suite.Require().NoError(err, "Could not get Haproxy config") reader := strings.NewReader(cfg) p, err := parser.New(options.Reader(reader)) - suite.NoError(err, "Could not get Haproxy config parser") + suite.Require().NoError(err, "Could not get Haproxy config parser") feName := "tcpcr_e2e-tests-crd-tcp_fe-http-echo" suite.checkBasicHttpEchoFrontend(p, feName) @@ -140,7 +140,7 @@ func (suite *TCPSuiteBackendSwitchingRule) Test_CRD_TCP_BackendSwitchingRule_Wit // Any other SNI should go to default http-echo // suite.checkClientRequest("foo.bar", "http-echo-0") suite.client, err = e2e.NewHTTPSClient("foo.bar", 32766) - suite.NoError(err) + suite.Require().NoError(err) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { @@ -158,10 +158,10 @@ func (suite *TCPSuiteBackendSwitchingRule) Test_CRD_TCP_BackendSwitchingRule_Wit // Get updated config and check it cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg") - suite.NoError(err, "Could not get Haproxy config") + suite.Require().NoError(err, "Could not get Haproxy config") reader := strings.NewReader(cfg) p, err := parser.New(options.Reader(reader)) - suite.NoError(err, "Could not get Haproxy config parser") + suite.Require().NoError(err, "Could not get Haproxy config parser") feName := "tcpcr_e2e-tests-crd-tcp_fe-http-echo" suite.checkBasicHttpEchoFrontend(p, feName) diff --git a/deploy/tests/e2e/crd-tcp/cr_tcp_full_test.go b/deploy/tests/e2e/crd-tcp/cr_tcp_full_test.go index 4e7f4a91..482bc62a 100644 --- a/deploy/tests/e2e/crd-tcp/cr_tcp_full_test.go +++ b/deploy/tests/e2e/crd-tcp/cr_tcp_full_test.go @@ -69,10 +69,10 @@ func (suite *TCPSuiteFull) Test_CRD_TCP_Full() { // Get updated config and check it cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg") - suite.NoError(err, "Could not get Haproxy config") + suite.Require().NoError(err, "Could not get Haproxy config") reader := strings.NewReader(cfg) p, err := parser.New(options.Reader(reader)) - suite.NoError(err, "Could not get Haproxy config parser") + suite.Require().NoError(err, "Could not get Haproxy config parser") // Check client Http Echo calls to both backend0 and backend1 feName := "tcpcr_e2e-tests-crd-tcp_fe-http-echo" diff --git a/deploy/tests/e2e/crd-tcp/cr_tcp_no_ingress_class_test.go b/deploy/tests/e2e/crd-tcp/cr_tcp_no_ingress_class_test.go index f6de506b..e9f34817 100644 --- a/deploy/tests/e2e/crd-tcp/cr_tcp_no_ingress_class_test.go +++ b/deploy/tests/e2e/crd-tcp/cr_tcp_no_ingress_class_test.go @@ -53,10 +53,10 @@ func (suite *TCPSuiteNoIngressClass) Test_CRD_TCP_No_Ingress_Class() { // Get updated config and check it cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg") - suite.NoError(err, "Could not get Haproxy config") + suite.Require().NoError(err, "Could not get Haproxy config") reader := strings.NewReader(cfg) p, err := parser.New(options.Reader(reader)) - suite.NoError(err, "Could not get Haproxy config parser") + suite.Require().NoError(err, "Could not get Haproxy config parser") _, err = p.Get(parser.Frontends, "tcpcr_e2e-tests-crd-tcp_fe-http-echo-80", "bind") suite.Require().Equal(err.Error(), "section missing") diff --git a/deploy/tests/e2e/crd-tcp/cr_tcp_test.go b/deploy/tests/e2e/crd-tcp/cr_tcp_test.go index bd34093c..6286da02 100644 --- a/deploy/tests/e2e/crd-tcp/cr_tcp_test.go +++ b/deploy/tests/e2e/crd-tcp/cr_tcp_test.go @@ -42,7 +42,7 @@ func (suite *TCPSuite) Test_CRD_TCP_OK() { var err error suite.Require().NoError(suite.test.Apply("config/tcp-cr.yaml", suite.test.GetNS(), nil)) suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host, 32766) - suite.NoError(err) + suite.Require().NoError(err) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { @@ -55,10 +55,10 @@ func (suite *TCPSuite) Test_CRD_TCP_OK() { // Get updated config and check it cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg") - suite.NoError(err, "Could not get Haproxy config") + suite.Require().NoError(err, "Could not get Haproxy config") reader := strings.NewReader(cfg) p, err := parser.New(options.Reader(reader)) - suite.NoError(err, "Could not get Haproxy config parser") + suite.Require().NoError(err, "Could not get Haproxy config parser") suite.checkFrontends(p) @@ -87,7 +87,7 @@ func (suite *TCPSuite) Test_CRD_TCP_CR_Backend() { var err error suite.Require().NoError(suite.test.Apply("config/tcp-cr.yaml", suite.test.GetNS(), nil)) suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host, 32766) - suite.NoError(err) + suite.Require().NoError(err) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { @@ -100,10 +100,10 @@ func (suite *TCPSuite) Test_CRD_TCP_CR_Backend() { // Get updated config and check it cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg") - suite.NoError(err, "Could not get Haproxy config") + suite.Require().NoError(err, "Could not get Haproxy config") reader := strings.NewReader(cfg) p, err := parser.New(options.Reader(reader)) - suite.NoError(err, "Could not get Haproxy config parser") + suite.Require().NoError(err, "Could not get Haproxy config parser") suite.checkFrontends(p) // Checks for backend e2e-tests-crd-tcp_http-echo_http @@ -145,7 +145,7 @@ func (suite *TCPSuite) Test_CRD_TCP_SSL() { var err error suite.Require().NoError(suite.test.Apply("config/tcp-cr-ssl.yaml", suite.test.GetNS(), nil)) suite.client, err = e2e.NewHTTPSClient("crdtcp-test.haproxy", 32766) - suite.NoError(err) + suite.Require().NoError(err) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { @@ -160,10 +160,10 @@ func (suite *TCPSuite) Test_CRD_TCP_SSL() { // Get updated config and check it cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg") - suite.NoError(err, "Could not get Haproxy config") + suite.Require().NoError(err, "Could not get Haproxy config") reader := strings.NewReader(cfg) p, err := parser.New(options.Reader(reader)) - suite.NoError(err, "Could not get Haproxy config parser") + suite.Require().NoError(err, "Could not get Haproxy config parser") // Check for tcp tcp-http-echo-443 binds443 := []types.Bind{ { diff --git a/deploy/tests/e2e/crd-tcp/suite_test.go b/deploy/tests/e2e/crd-tcp/suite_test.go index 11dd0662..ce5f2214 100644 --- a/deploy/tests/e2e/crd-tcp/suite_test.go +++ b/deploy/tests/e2e/crd-tcp/suite_test.go @@ -48,20 +48,20 @@ type tmplData struct { func (suite *CRDTCPSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{ Host: suite.test.GetNS() + ".test", Host2: suite.test.GetNS() + ".test2", } suite.tmplData.BackendCrNamespace = suite.test.GetNS() suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) - suite.NoError(suite.test.Apply("config/tcp-secret.yaml", suite.test.GetNS(), nil)) - suite.NoError(suite.test.Apply("config/backend-cr.yaml", suite.test.GetNS(), nil)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/tcp-secret.yaml", suite.test.GetNS(), nil)) + suite.Require().NoError(suite.test.Apply("config/backend-cr.yaml", suite.test.GetNS(), nil)) nbEchoApps := 3 for i := 0; i < nbEchoApps; i++ { suite.tmplData.EchoAppIndex = i - suite.NoError(suite.test.Apply("config/deploy-index.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy-index.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) } } @@ -75,25 +75,25 @@ func (suite *CRDTCPSuite) BeforeTest(suiteName, testName string) { case "Test_CRD_TCP_CR_Backend": suite.tmplData.BackendCrName = "mybackend" } - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) } func (suite *CRDTCPSuite) checkFrontend(p parser.Parser, frontendName, param string, value common.ParserData) { v, err := p.Get(parser.Frontends, frontendName, param) - suite.NoError(err, "Could not get Haproxy config parser Frontend %s param %s", frontendName, param) + suite.Require().NoError(err, "Could not get Haproxy config parser Frontend %s param %s", frontendName, param) suite.Equal(value, v, fmt.Sprintf("Frontend param %s should be equal to %v but is %v", param, value, v)) } func (suite *CRDTCPSuite) checkBackend(p parser.Parser, backendName, param string, value common.ParserData) { v, err := p.Get(parser.Backends, backendName, param) - suite.NoError(err, "Could not get Haproxy config parser Frontend %s param %s", backendName, param) + suite.Require().NoError(err, "Could not get Haproxy config parser Frontend %s param %s", backendName, param) suite.Equal(value, v, fmt.Sprintf("Backend param %s should be equal to %v but is %v", param, value, v)) } func (suite *CRDTCPSuite) checkClientRequest(host, backend string) { var err error suite.client, err = e2e.NewHTTPSClient(host, 32766) - suite.NoError(err) + suite.Require().NoError(err) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/crd/cr_global_test.go b/deploy/tests/e2e/crd/cr_global_test.go index 1c7d83c5..45e30885 100644 --- a/deploy/tests/e2e/crd/cr_global_test.go +++ b/deploy/tests/e2e/crd/cr_global_test.go @@ -53,10 +53,10 @@ func (suite *GlobalSuite) Test_CR_Global() { // Get updated config and do all neede param checks cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg") - suite.NoError(err, "Could not get Haproxy config") + suite.Require().NoError(err, "Could not get Haproxy config") reader := strings.NewReader(cfg) p, err := parser.New(options.Reader(reader)) - suite.NoError(err, "Could not get Haproxy config parser") + suite.Require().NoError(err, "Could not get Haproxy config parser") suite.checkGlobalParam(p, "default-path", &types.DefaultPath{ Type: "config", }) @@ -213,12 +213,12 @@ func (suite *GlobalSuite) Test_CR_Global() { func (suite *GlobalSuite) checkGlobalParam(p parser.Parser, param string, value common.ParserData) { v, err := p.Get(parser.Global, parser.GlobalSectionName, param) - suite.NoError(err, "Could not get Haproxy config parser Global param %s", param) + suite.Require().NoError(err, "Could not get Haproxy config parser Global param %s", param) suite.Equal(value, v, fmt.Sprintf("Global param %s should be equal to %v but is %v", param, value, v)) } func (suite *GlobalSuite) checkLogTargetParam(p parser.Parser, param string, value common.ParserData) { v, err := p.GetOne(parser.Global, parser.GlobalSectionName, param, 0) - suite.NoError(err, "Could not get Haproxy config parser Global param %s", param) + suite.Require().NoError(err, "Could not get Haproxy config parser Global param %s", param) suite.Equal(value, v, fmt.Sprintf("Global param %s should be equal to %v but is %v", param, value, v)) } diff --git a/deploy/tests/e2e/crd/suite_test.go b/deploy/tests/e2e/crd/suite_test.go index e3c7669a..7ac0231f 100644 --- a/deploy/tests/e2e/crd/suite_test.go +++ b/deploy/tests/e2e/crd/suite_test.go @@ -50,12 +50,12 @@ type tmplData struct { func (suite *CRDSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) - suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { r, cls, err := suite.client.Do() if err != nil { @@ -72,10 +72,10 @@ func (suite *CRDSuite) TearDownSuite() { func (suite *CRDSuite) getVersion() int64 { cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg") - suite.NoError(err, "Could not get Haproxy config") + suite.Require().NoError(err, "Could not get Haproxy config") reader := strings.NewReader(cfg) p, err := parser.New(options.Reader(reader)) - suite.NoError(err, "Could not get Haproxy config parser") + suite.Require().NoError(err, "Could not get Haproxy config parser") data, _ := p.Get(parser.Comments, parser.CommentsSectionName, "# _version", false) diff --git a/deploy/tests/e2e/endpoints/http_test.go b/deploy/tests/e2e/endpoints/http_test.go index 963a3b71..f3decb9d 100644 --- a/deploy/tests/e2e/endpoints/http_test.go +++ b/deploy/tests/e2e/endpoints/http_test.go @@ -30,14 +30,14 @@ func (suite *EndpointsSuite) Test_HTTP_Reach() { for _, replicas := range []int{4, 8, 2, 0, 3} { suite.Run(fmt.Sprintf("%d-replicas", replicas), func() { suite.tmplData.Replicas = replicas - suite.NoError(suite.test.Apply("config/endpoints.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/endpoints.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Eventually(func() bool { counter := map[string]int{} for i := 0; i < replicas*2; i++ { func() { res, cls, err := suite.client.Do() if err != nil { - suite.NoError(err) + suite.Require().NoError(err) return } defer cls() diff --git a/deploy/tests/e2e/endpoints/not_ready_test.go b/deploy/tests/e2e/endpoints/not_ready_test.go index 323a3e57..f05b342e 100644 --- a/deploy/tests/e2e/endpoints/not_ready_test.go +++ b/deploy/tests/e2e/endpoints/not_ready_test.go @@ -23,7 +23,7 @@ import ( func (suite *EndpointsSuite) Test_Non_Ready_Endpoints() { suite.tmplData.NotReady = true suite.tmplData.Replicas = 3 - suite.NoError(suite.test.Apply("config/endpoints.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/endpoints.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/endpoints/suite_test.go b/deploy/tests/e2e/endpoints/suite_test.go index 056dae8c..5d85fe0a 100644 --- a/deploy/tests/e2e/endpoints/suite_test.go +++ b/deploy/tests/e2e/endpoints/suite_test.go @@ -41,7 +41,7 @@ type tmplData struct { func (suite *EndpointsSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{ Host: suite.test.GetNS() + ".test", } @@ -64,10 +64,10 @@ func (suite *EndpointsSuite) BeforeTest(suiteName, testName string) { switch testName { case "Test_TCP_Reach": suite.client, err = e2e.NewHTTPSClient("tcp-service.test", 32766) - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData.Replicas = 4 - suite.NoError(test.Apply("config/endpoints.yaml.tmpl", test.GetNS(), suite.tmplData)) - suite.NoError(test.Apply("config/tcp.yaml", "", nil)) + suite.Require().NoError(test.Apply("config/endpoints.yaml.tmpl", test.GetNS(), suite.tmplData)) + suite.Require().NoError(test.Apply("config/tcp.yaml", "", nil)) suite.test.AddTearDown(func() error { return suite.test.Delete("config/tcp.yaml") }) @@ -82,9 +82,9 @@ func (suite *EndpointsSuite) BeforeTest(suiteName, testName string) { }, e2e.WaitDuration, e2e.TickDuration) default: suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData.Replicas = 1 - suite.NoError(test.Apply("config/endpoints.yaml.tmpl", test.GetNS(), suite.tmplData)) + suite.Require().NoError(test.Apply("config/endpoints.yaml.tmpl", test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/endpoints/tcp_test.go b/deploy/tests/e2e/endpoints/tcp_test.go index 0b3a61fb..a2f8ebb0 100644 --- a/deploy/tests/e2e/endpoints/tcp_test.go +++ b/deploy/tests/e2e/endpoints/tcp_test.go @@ -24,7 +24,7 @@ func (suite *EndpointsSuite) Test_TCP_Reach() { func() { res, cls, err := suite.client.Do() if err != nil { - suite.NoError(err) + suite.Require().NoError(err) return } defer cls() diff --git a/deploy/tests/e2e/global-config/maxconn_test.go b/deploy/tests/e2e/global-config/maxconn_test.go index 9d53e51b..281df22b 100644 --- a/deploy/tests/e2e/global-config/maxconn_test.go +++ b/deploy/tests/e2e/global-config/maxconn_test.go @@ -21,11 +21,11 @@ import ( ) func (suite *GlobalConfigSuite) TestMaxconn() { - suite.NoError(suite.test.Apply("config/configmap-maxconn.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/configmap-maxconn.yaml", "", nil)) suite.maxconn = "1111" suite.Eventually(suite.checkMaxconn, e2e.WaitDuration, e2e.TickDuration) - suite.NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil)) suite.maxconn = "1000" suite.Eventually(suite.checkMaxconn, e2e.WaitDuration, e2e.TickDuration) } diff --git a/deploy/tests/e2e/global-config/proxy_protocol_test.go b/deploy/tests/e2e/global-config/proxy_protocol_test.go index 8ca06a23..d9001610 100644 --- a/deploy/tests/e2e/global-config/proxy_protocol_test.go +++ b/deploy/tests/e2e/global-config/proxy_protocol_test.go @@ -24,7 +24,7 @@ import ( func (suite *GlobalConfigSuite) Test_Proxy_Protocol() { suite.Run("Source_IP_OK", func() { - suite.NoError(suite.test.Apply("config/configmap-pp-1.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/configmap-pp-1.yaml", "", nil)) suite.Eventually(func() bool { res, err := e2e.ProxyProtoConn() if err != nil { @@ -36,7 +36,7 @@ func (suite *GlobalConfigSuite) Test_Proxy_Protocol() { }) suite.Run("Source_IP_KO", func() { - suite.NoError(suite.test.Apply("config/configmap-pp-2.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/configmap-pp-2.yaml", "", nil)) suite.Eventually(func() bool { res, err := e2e.ProxyProtoConn() if err != nil { @@ -49,5 +49,5 @@ func (suite *GlobalConfigSuite) Test_Proxy_Protocol() { }) // revert to initial configmap - suite.NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil)) } diff --git a/deploy/tests/e2e/global-config/suite_test.go b/deploy/tests/e2e/global-config/suite_test.go index 0482c258..6d3cb0b5 100644 --- a/deploy/tests/e2e/global-config/suite_test.go +++ b/deploy/tests/e2e/global-config/suite_test.go @@ -33,7 +33,7 @@ type GlobalConfigSuite struct { func (suite *GlobalConfigSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) } func (suite *GlobalConfigSuite) TearDownSuite() { diff --git a/deploy/tests/e2e/haproxy-files/errorfiles_test.go b/deploy/tests/e2e/haproxy-files/errorfiles_test.go index 76cad370..33f5be6f 100644 --- a/deploy/tests/e2e/haproxy-files/errorfiles_test.go +++ b/deploy/tests/e2e/haproxy-files/errorfiles_test.go @@ -22,7 +22,7 @@ import ( func (suite *HAProxyFilesSuite) Test_ErrorFiles() { suite.Run("Enabled", func() { - suite.NoError(suite.test.Apply("config/errorfiles.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/errorfiles.yaml", "", nil)) suite.Require().Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { @@ -35,7 +35,7 @@ func (suite *HAProxyFilesSuite) Test_ErrorFiles() { }) suite.Run("Disabled", func() { - suite.NoError(suite.test.Delete("config/errorfiles.yaml")) + suite.Require().NoError(suite.test.Delete("config/errorfiles.yaml")) suite.Require().Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/haproxy-files/patternfiles_test.go b/deploy/tests/e2e/haproxy-files/patternfiles_test.go index 63a80ee1..99703db1 100644 --- a/deploy/tests/e2e/haproxy-files/patternfiles_test.go +++ b/deploy/tests/e2e/haproxy-files/patternfiles_test.go @@ -43,7 +43,7 @@ func (suite *HAProxyFilesSuite) Test_PatternFiles() { } }) suite.Run("Updated", func() { - suite.NoError(suite.test.Apply("config/patternfiles-2.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/patternfiles-2.yaml", "", nil)) for i, path := range tests2 { suite.Require().Eventually(func() bool { return suite.testHeader(path, strconv.Itoa(i)) diff --git a/deploy/tests/e2e/haproxy-files/suite_test.go b/deploy/tests/e2e/haproxy-files/suite_test.go index c992643f..1b951734 100644 --- a/deploy/tests/e2e/haproxy-files/suite_test.go +++ b/deploy/tests/e2e/haproxy-files/suite_test.go @@ -38,12 +38,12 @@ type tmplData struct { func (suite *HAProxyFilesSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) - suite.NoError(suite.test.Apply("config/patternfiles-1.yaml", "", nil)) - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/patternfiles-1.yaml", "", nil)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) } func (suite *HAProxyFilesSuite) TearDownSuite() { diff --git a/deploy/tests/e2e/https/offload_test.go b/deploy/tests/e2e/https/offload_test.go index dcc924ab..45041654 100644 --- a/deploy/tests/e2e/https/offload_test.go +++ b/deploy/tests/e2e/https/offload_test.go @@ -22,9 +22,9 @@ import ( func (suite *HTTPSSuite) Test_HTTPS_Offload() { var err error - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.client, err = e2e.NewHTTPSClient("offload-test.haproxy", 0) - suite.NoError(err) + suite.Require().NoError(err) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/https/passthrough_test.go b/deploy/tests/e2e/https/passthrough_test.go index cc5e9159..7dc0f958 100644 --- a/deploy/tests/e2e/https/passthrough_test.go +++ b/deploy/tests/e2e/https/passthrough_test.go @@ -59,7 +59,7 @@ func (suite *HTTPSSuite) Test_HTTPS_Passthrough() { {"ssl-passthrough", "'true'"}, {"whitelist", "6.6.6.6"}, } - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if err == nil { diff --git a/deploy/tests/e2e/https/redirect_test.go b/deploy/tests/e2e/https/redirect_test.go index 91f126f7..f959abc2 100644 --- a/deploy/tests/e2e/https/redirect_test.go +++ b/deploy/tests/e2e/https/redirect_test.go @@ -21,7 +21,7 @@ import ( ) func (suite *HTTPSSuite) Test_HTTPS_Redirect() { - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { @@ -34,7 +34,7 @@ func (suite *HTTPSSuite) Test_HTTPS_Redirect() { suite.Run("implicit_via_TLS", func() { suite.tmplData.TLSEnabled = true suite.Eventually(func() bool { - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) res, cls, err := suite.client.Do() if res == nil { suite.T().Log(err) @@ -50,7 +50,7 @@ func (suite *HTTPSSuite) Test_HTTPS_Redirect() { {"ssl-redirect", "'true'"}, {"ssl-redirect-code", "'301'"}, } - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { @@ -66,7 +66,7 @@ func (suite *HTTPSSuite) Test_HTTPS_Redirect() { suite.tmplData.IngAnnotations = []struct{ Key, Value string }{ {"ssl-redirect", "'false'"}, } - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/https/suite_test.go b/deploy/tests/e2e/https/suite_test.go index 08799343..6ba95f4a 100644 --- a/deploy/tests/e2e/https/suite_test.go +++ b/deploy/tests/e2e/https/suite_test.go @@ -51,15 +51,15 @@ func (suite *HTTPSSuite) BeforeTest(suiteName, testName string) { suite.client, err = e2e.NewHTTPSClient(suite.tmplData.Host) suite.tmplData.TLSEnabled = true } - suite.NoError(err) + suite.Require().NoError(err) } func (suite *HTTPSSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} - suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) } func (suite *HTTPSSuite) TearDownSuite() { diff --git a/deploy/tests/e2e/ingress-match/ingress_match_path_test.go b/deploy/tests/e2e/ingress-match/ingress_match_path_test.go index 46738d68..90573e82 100644 --- a/deploy/tests/e2e/ingress-match/ingress_match_path_test.go +++ b/deploy/tests/e2e/ingress-match/ingress_match_path_test.go @@ -61,7 +61,7 @@ var tests = []test{ func (suite *IngressMatchSuite) BeforeTest(suiteName, testName string) { suite.tmplData.PathTypeSupported = true major, minor, err := suite.test.GetK8sVersion() - suite.NoError(err) + suite.Require().NoError(err) if major == 1 && minor < 18 { suite.tmplData.PathTypeSupported = false tests[0] = test{ingressRules[0].Service, "app.haproxy", []string{"/", "/test", "/prefixxx"}} diff --git a/deploy/tests/e2e/ingress-match/suite_test.go b/deploy/tests/e2e/ingress-match/suite_test.go index 0812350e..6fa54507 100644 --- a/deploy/tests/e2e/ingress-match/suite_test.go +++ b/deploy/tests/e2e/ingress-match/suite_test.go @@ -47,9 +47,9 @@ type tmplData struct { func (suite *IngressMatchSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.client, err = e2e.NewHTTPClient(suite.test.GetNS() + ".test") - suite.NoError(err) + suite.Require().NoError(err) } func (suite *IngressMatchSuite) TearDownSuite() { diff --git a/deploy/tests/e2e/ingressclass/ingressClass_test.go b/deploy/tests/e2e/ingressclass/ingressClass_test.go index 5218c8ae..b0168b66 100644 --- a/deploy/tests/e2e/ingressclass/ingressClass_test.go +++ b/deploy/tests/e2e/ingressclass/ingressClass_test.go @@ -25,7 +25,7 @@ import ( func (suite *IngressClassSuite) Test_IngressClassName_Field() { test := suite.test suite.Run("Disabled", func() { - suite.NoError(test.Apply("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData)) + suite.Require().NoError(test.Apply("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData)) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if err != nil { @@ -39,7 +39,7 @@ func (suite *IngressClassSuite) Test_IngressClassName_Field() { suite.Run("Enabled", func() { suite.tmplData.IngressClassName = "haproxy" - suite.NoError(test.Apply("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData)) + suite.Require().NoError(test.Apply("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData)) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if err != nil { @@ -55,9 +55,9 @@ func (suite *IngressClassSuite) Test_IngressClassName_Field() { func (suite *IngressClassSuite) Test_IngressClassName_Resource() { test := suite.test suite.Run("Disabled", func() { - suite.NoError(test.Apply("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData)) - suite.NoError(suite.test.Apply("config/ingressclass.yaml", "", nil)) - suite.NoError(test.Delete("config/ingressclass.yaml")) + suite.Require().NoError(test.Apply("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/ingressclass.yaml", "", nil)) + suite.Require().NoError(test.Delete("config/ingressclass.yaml")) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if err != nil { @@ -71,8 +71,8 @@ func (suite *IngressClassSuite) Test_IngressClassName_Resource() { suite.Run("Enabled", func() { suite.tmplData.IngressClassName = "haproxy" - suite.NoError(test.Apply("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData)) - suite.NoError(suite.test.Apply("config/ingressclass.yaml", "", nil)) + suite.Require().NoError(test.Apply("config/ingress.yaml.tmpl", test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/ingressclass.yaml", "", nil)) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if err != nil { diff --git a/deploy/tests/e2e/ingressclass/suite_test.go b/deploy/tests/e2e/ingressclass/suite_test.go index 85f278c0..cc51fe5a 100644 --- a/deploy/tests/e2e/ingressclass/suite_test.go +++ b/deploy/tests/e2e/ingressclass/suite_test.go @@ -39,17 +39,17 @@ type tmplData struct { func (suite *IngressClassSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) major, minor, err := suite.test.GetK8sVersion() - suite.NoError(err) + suite.Require().NoError(err) if major == 1 && minor < 18 { suite.T().SkipNow() } suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) - suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) - suite.NoError(suite.test.Apply("config/ingressclass.yaml", "", nil)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) + suite.Require().NoError(suite.test.Apply("config/ingressclass.yaml", "", nil)) suite.test.AddTearDown(func() error { return suite.test.Delete("config/ingressclass.yaml") }) diff --git a/deploy/tests/e2e/map-updates/suite_test.go b/deploy/tests/e2e/map-updates/suite_test.go index 041cc05d..1f9d6809 100644 --- a/deploy/tests/e2e/map-updates/suite_test.go +++ b/deploy/tests/e2e/map-updates/suite_test.go @@ -39,12 +39,12 @@ type tmplData struct { func (suite *MapUpdateSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test", Paths: []string{""}} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) - suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { r, cls, err := suite.client.Do() if err != nil { diff --git a/deploy/tests/e2e/map-updates/update_test.go b/deploy/tests/e2e/map-updates/update_test.go index d9035b9d..8777f6da 100644 --- a/deploy/tests/e2e/map-updates/update_test.go +++ b/deploy/tests/e2e/map-updates/update_test.go @@ -31,13 +31,13 @@ func (suite *MapUpdateSuite) Test_Update() { } oldInfo, err := e2e.GetGlobalHAProxyInfo() oldCount, err := e2e.GetHAProxyMapCount("path-prefix") - suite.NoError(err) - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { newInfo, err := e2e.GetGlobalHAProxyInfo() - suite.NoError(err) + suite.Require().NoError(err) count, err := e2e.GetHAProxyMapCount("path-prefix") - suite.NoError(err) + suite.Require().NoError(err) numOfAddedEntries := count - oldCount + 1 // We add one because there's already an entry at the begining which will be removed suite.T().Logf("oldInfo.Pid(%s) == newInfo.Pid(%s) && additional path-prefix.count(%d) == %d", oldInfo.Pid, newInfo.Pid, numOfAddedEntries, n) return oldInfo.Pid == newInfo.Pid && numOfAddedEntries == n diff --git a/deploy/tests/e2e/rate-limiting/suite_test.go b/deploy/tests/e2e/rate-limiting/suite_test.go index b364c88b..e1281cbe 100644 --- a/deploy/tests/e2e/rate-limiting/suite_test.go +++ b/deploy/tests/e2e/rate-limiting/suite_test.go @@ -39,12 +39,12 @@ type tmplData struct { func (suite *RateLimitingSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) - suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { r, cls, err := suite.client.Do() if err != nil { diff --git a/deploy/tests/e2e/send-proxy-protocol/suite_test.go b/deploy/tests/e2e/send-proxy-protocol/suite_test.go index a15bb149..e412a234 100644 --- a/deploy/tests/e2e/send-proxy-protocol/suite_test.go +++ b/deploy/tests/e2e/send-proxy-protocol/suite_test.go @@ -39,10 +39,10 @@ type tmplData struct { func (suite *ProxyProtocolSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) + suite.Require().NoError(err) suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) } diff --git a/deploy/tests/e2e/service-discovery/port_discovery_test.go b/deploy/tests/e2e/service-discovery/port_discovery_test.go index e4312dec..be913add 100644 --- a/deploy/tests/e2e/service-discovery/port_discovery_test.go +++ b/deploy/tests/e2e/service-discovery/port_discovery_test.go @@ -36,7 +36,7 @@ func (suite *ServiceDiscoverySuite) testServicePort(serviceName, servicePort, po suite.tmplData.ServiceName = serviceName suite.tmplData.ServicePort = servicePort suite.tmplData.PortType = portType - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/service-discovery/suite_test.go b/deploy/tests/e2e/service-discovery/suite_test.go index 27fdb237..d7bd53a0 100644 --- a/deploy/tests/e2e/service-discovery/suite_test.go +++ b/deploy/tests/e2e/service-discovery/suite_test.go @@ -42,7 +42,7 @@ type tmplData struct { func (suite *ServiceDiscoverySuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{ Host: suite.test.GetNS() + ".test", ServiceName: "http-echo-1", @@ -50,9 +50,9 @@ func (suite *ServiceDiscoverySuite) SetupSuite() { PortType: "number", } suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) - suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/set-header/suite_test.go b/deploy/tests/e2e/set-header/suite_test.go index 9059609f..e253f241 100644 --- a/deploy/tests/e2e/set-header/suite_test.go +++ b/deploy/tests/e2e/set-header/suite_test.go @@ -39,12 +39,12 @@ type tmplData struct { func (suite *SetHeaderSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) - suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) - suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil)) + suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { r, cls, err := suite.client.Do() if err != nil { diff --git a/deploy/tests/e2e/source-ip/source_ip_test.go b/deploy/tests/e2e/source-ip/source_ip_test.go index 1b78dfd3..29d7bce0 100644 --- a/deploy/tests/e2e/source-ip/source_ip_test.go +++ b/deploy/tests/e2e/source-ip/source_ip_test.go @@ -36,7 +36,7 @@ func (suite *SourceIPSuite) Test_Set_Source_Ip() { {"blacklist", tc.IpValue}, } suite.Run(tc.HeaderName, func() { - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Eventually(func() bool { suite.client.Req.Header = map[string][]string{ tc.HeaderName: {tc.IpValue}, diff --git a/deploy/tests/e2e/source-ip/suite_test.go b/deploy/tests/e2e/source-ip/suite_test.go index c64d2f28..2d8e0876 100644 --- a/deploy/tests/e2e/source-ip/suite_test.go +++ b/deploy/tests/e2e/source-ip/suite_test.go @@ -40,11 +40,11 @@ type tmplData struct { func (suite *SourceIPSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) - suite.NoError(err) - suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) + suite.Require().NoError(err) + suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData)) suite.Require().Eventually(func() bool { res, cls, err := suite.client.Do() if res == nil { diff --git a/deploy/tests/e2e/tls-auth/suite_test.go b/deploy/tests/e2e/tls-auth/suite_test.go index 6df1d407..d9518cf8 100644 --- a/deploy/tests/e2e/tls-auth/suite_test.go +++ b/deploy/tests/e2e/tls-auth/suite_test.go @@ -36,13 +36,13 @@ type TLSAuthSuite struct { func (suite *TLSAuthSuite) SetupSuite() { var err error suite.test, err = e2e.NewTest() - suite.NoError(err) + suite.Require().NoError(err) suite.client, err = e2e.NewHTTPSClient(suite.test.GetNS() + ".test") - suite.NoError(err) + suite.Require().NoError(err) suite.validClientCert, err = tls.LoadX509KeyPair("client-certs/valid.crt", "client-certs/valid.key") - suite.NoError(err) + suite.Require().NoError(err) suite.wrongClientCert, err = tls.LoadX509KeyPair("client-certs/wrong.crt", "client-certs/wrong.key") - suite.NoError(err) + suite.Require().NoError(err) suite.Require().NoError(suite.test.Apply("config/secrets/default-cert.yaml", suite.test.GetNS(), nil)) suite.Require().NoError(suite.test.Apply("config/client-auth.yaml", "", nil)) suite.Eventually(func() bool {