From dc3f16a9b890349f8c90c3b996a8d528bf8e7e78 Mon Sep 17 00:00:00 2001 From: Zihong Zheng Date: Fri, 5 May 2017 14:44:25 -0700 Subject: [PATCH] Update kube-proxy healthz port in e2e test --- test/e2e/framework/networking_utils.go | 4 ++-- test/e2e/networking.go | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/e2e/framework/networking_utils.go b/test/e2e/framework/networking_utils.go index c62260eae2d..943835ef92a 100644 --- a/test/e2e/framework/networking_utils.go +++ b/test/e2e/framework/networking_utils.go @@ -273,8 +273,8 @@ func (config *NetworkingTestConfig) DialFromNode(protocol, targetIP string, targ // GetSelfURL executes a curl against the given path via kubectl exec into a // test container running with host networking, and fails if the output // doesn't match the expected string. -func (config *NetworkingTestConfig) GetSelfURL(path string, expected string) { - cmd := fmt.Sprintf("curl -q -s --connect-timeout 1 http://localhost:10249%s", path) +func (config *NetworkingTestConfig) GetSelfURL(port int32, path string, expected string) { + cmd := fmt.Sprintf("curl -i -q -s --connect-timeout 1 http://localhost:%d%s", port, path) By(fmt.Sprintf("Getting kube-proxy self URL %s", path)) // These are arbitrary timeouts. The curl command should pass on first try, diff --git a/test/e2e/networking.go b/test/e2e/networking.go index 15d722ad627..9834a5efcba 100644 --- a/test/e2e/networking.go +++ b/test/e2e/networking.go @@ -20,9 +20,11 @@ import ( "fmt" "net/http" - . "github.com/onsi/ginkgo" "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/kubernetes/pkg/master/ports" "k8s.io/kubernetes/test/e2e/framework" + + . "github.com/onsi/ginkgo" ) var _ = framework.KubeDescribe("Networking", func() { @@ -80,8 +82,8 @@ var _ = framework.KubeDescribe("Networking", func() { config := framework.NewNetworkingTestConfig(f) By("checking kube-proxy URLs") - config.GetSelfURL("/healthz", "ok") - config.GetSelfURL("/proxyMode", "iptables") // the default + config.GetSelfURL(ports.ProxyHealthzPort, "/healthz", "200 OK") + config.GetSelfURL(ports.ProxyStatusPort, "/proxyMode", "iptables") // the default }) // TODO: Remove [Slow] when this has had enough bake time to prove presubmit worthiness.