Blob Blame Raw
From 43f9b66744362240332241788d9811f863366f4e Mon Sep 17 00:00:00 2001
From: Jan Chaloupka <jchaloup@redhat.com>
Date: Thu, 5 Jan 2017 10:01:34 +0100
Subject: [PATCH] make e2e_node run over distro bins

---
 src/k8s.io/kubernetes/hack/lib/init.sh                   | 2 +-
 src/k8s.io/kubernetes/hack/make-rules/test-e2e-node.sh   | 2 +-
 src/k8s.io/kubernetes/test/e2e_node/builder/build.go     | 6 +++++-
 src/k8s.io/kubernetes/test/e2e_node/services/services.go | 5 +++++
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/k8s.io/kubernetes/hack/lib/init.sh b/src/k8s.io/kubernetes/hack/lib/init.sh
index ae50779..0a601ac 100644
--- a/src/k8s.io/kubernetes/hack/lib/init.sh
+++ b/src/k8s.io/kubernetes/hack/lib/init.sh
@@ -42,7 +42,7 @@ source "${KUBE_ROOT}/hack/lib/version.sh"
 source "${KUBE_ROOT}/hack/lib/golang.sh"
 source "${KUBE_ROOT}/hack/lib/etcd.sh"
 
-KUBE_OUTPUT_HOSTBIN="${KUBE_OUTPUT_BINPATH}/$(kube::util::host_platform)"
+KUBE_OUTPUT_HOSTBIN="/usr/bin"
 
 # list of all available group versions.  This should be used when generated code
 # or when starting an API server that you want to have everything.
diff --git a/src/k8s.io/kubernetes/hack/make-rules/test-e2e-node.sh b/src/k8s.io/kubernetes/hack/make-rules/test-e2e-node.sh
index e98842d..3d51a06 100755
--- a/src/k8s.io/kubernetes/hack/make-rules/test-e2e-node.sh
+++ b/src/k8s.io/kubernetes/hack/make-rules/test-e2e-node.sh
@@ -148,6 +148,6 @@ else
   # Provided for backwards compatibility
   go run test/e2e_node/runner/local/run_local.go --ginkgo-flags="$ginkgoflags" \
     --test-flags="--alsologtostderr --v 4 --report-dir=${artifacts} --node-name $(hostname) \
-    $test_args" --build-dependencies=true 2>&1 | tee -i "${artifacts}/build-log.txt"
+    $test_args --k8s-bin-dir /usr/bin" --build-dependencies=true 2>&1 | tee -i "${artifacts}/build-log.txt"
   exit $?
 fi
diff --git a/src/k8s.io/kubernetes/test/e2e_node/builder/build.go b/src/k8s.io/kubernetes/test/e2e_node/builder/build.go
index f22232a..c49c35f 100644
--- a/src/k8s.io/kubernetes/test/e2e_node/builder/build.go
+++ b/src/k8s.io/kubernetes/test/e2e_node/builder/build.go
@@ -31,7 +31,7 @@ import (
 var k8sBinDir = flag.String("k8s-bin-dir", "", "Directory containing k8s kubelet binaries.")
 
 var buildTargets = []string{
-	"cmd/kubelet",
+	//"cmd/kubelet",
 	"test/e2e_node/e2e_node.test",
 	"vendor/github.com/onsi/ginkgo/ginkgo",
 }
@@ -53,6 +53,10 @@ func BuildGo() error {
 	return nil
 }
 
+func GetK8sBinDir() string {
+       return *k8sBinDir
+}
+
 func getK8sBin(bin string) (string, error) {
 	// Use commandline specified path
 	if *k8sBinDir != "" {
diff --git a/src/k8s.io/kubernetes/test/e2e_node/services/services.go b/src/k8s.io/kubernetes/test/e2e_node/services/services.go
index ae73721..b243168 100644
--- a/src/k8s.io/kubernetes/test/e2e_node/services/services.go
+++ b/src/k8s.io/kubernetes/test/e2e_node/services/services.go
@@ -141,6 +141,11 @@ func (e *E2EServices) startInternalServices() (*server, error) {
 	}
 	// Pass all flags into the child process, so that it will see the same flag set.
 	startCmd := exec.Command(testBin, append([]string{"--run-services-mode"}, os.Args[1:]...)...)
+
+	if build.GetK8sBinDir() != "" {
+		startCmd.Args = append(startCmd.Args, fmt.Sprintf("--k8s-bin-dir=%v", build.GetK8sBinDir()))
+	}
+
 	server := newServer("services", startCmd, nil, nil, getServicesHealthCheckURLs(), servicesLogFile, e.monitorParent, false)
 	return server, server.start()
 }
-- 
2.7.4