-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MINOR: 6060 as default controller port, fix pprof missing in maps, ad…
…d e2e tests This MR fixes several issues around the controller port: - set 6060 as default port, so techdump endpoint is working without adding --controller-port parameter - fix pprof backend, entries were missing in maps - have server for prometheus, pprof and techdump starts on ControllerPort and not hard-coded to 6060 This MR also adds e2e tests for techdump and pprof endpoints. Not testing the bahavior, but at least that: - pprof can be triggered
- Loading branch information
1 parent
37e3276
commit 8894726
Showing
10 changed files
with
134 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.vscode/* | ||
.idea/* | ||
.test/* | ||
kubernetes-ingress | ||
dist/ | ||
.code-generator/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2019 HAProxy Technologies LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//go:build e2e_parallel | ||
|
||
package adminport | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/haproxytech/kubernetes-ingress/deploy/tests/e2e" | ||
) | ||
|
||
func (suite *AdminPortSuite) Test_Pprof() { | ||
suite.Run("OK", func() { | ||
suite.Eventually(func() bool { | ||
suite.client.Path = "/debug/pprof/cmdline" | ||
res, cls, err := suite.client.Do() | ||
if err != nil { | ||
suite.T().Logf("Connection ERROR: %s", err.Error()) | ||
return false | ||
} | ||
defer cls() | ||
return res.StatusCode == http.StatusOK | ||
}, e2e.WaitDuration, e2e.TickDuration) | ||
}) | ||
suite.Run("OK", func() { | ||
suite.Eventually(func() bool { | ||
suite.client.Path = "/debug/pprof/symbol" | ||
res, cls, err := suite.client.Do() | ||
if err != nil { | ||
suite.T().Logf("Connection ERROR: %s", err.Error()) | ||
return false | ||
} | ||
defer cls() | ||
return res.StatusCode == http.StatusOK | ||
}, e2e.WaitDuration, e2e.TickDuration) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright 2019 HAProxy Technologies LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//go:build e2e_parallel | ||
|
||
package adminport | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/haproxytech/kubernetes-ingress/deploy/tests/e2e" | ||
) | ||
|
||
type AdminPortSuite struct { | ||
suite.Suite | ||
test e2e.Test | ||
client *e2e.Client | ||
tmplData tmplData | ||
} | ||
|
||
type tmplData struct { | ||
Host string | ||
} | ||
|
||
func (suite *AdminPortSuite) SetupSuite() { | ||
var err error | ||
suite.test, err = e2e.NewTest() | ||
suite.NoError(err) | ||
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"} | ||
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host) | ||
suite.NoError(err) | ||
} | ||
|
||
func (suite *AdminPortSuite) TearDownSuite() { | ||
err := suite.test.TearDown() | ||
if err != nil { | ||
suite.T().Error(err) | ||
} | ||
} | ||
|
||
func TestAdminPortSuite(t *testing.T) { | ||
suite.Run(t, new(AdminPortSuite)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters