diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index 7052cdb285..1555ab76de 100755 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -1443,11 +1443,13 @@ function test-build-release { } # Execute prior to running tests to initialize required structure. This is -# called from hack/e2e.go only when running -up (it is run after kube-up). +# called from hack/e2e.go only when running -up. # # Assumed vars: # Variables from config.sh function test-setup { + "${KUBE_ROOT}/cluster/kube-up.sh" + VPC_ID=$(get_vpc_id) detect-security-groups diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 0ea7de8698..698edecedc 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -1192,7 +1192,7 @@ function test-build-release { } # Execute prior to running tests to initialize required structure. This is -# called from hack/e2e.go only when running -up (it is run after kube-up). +# called from hack/e2e.go only when running -up. # # Assumed vars: # Variables from config.sh @@ -1200,6 +1200,16 @@ function test-setup { # Detect the project into $PROJECT if it isn't set detect-project + if [[ ${MULTIZONE:-} == "true" ]]; then + for KUBE_GCE_ZONE in ${E2E_ZONES} + do + KUBE_GCE_ZONE="${KUBE_GCE_ZONE}" KUBE_USE_EXISTING_MASTER="${KUBE_USE_EXISTING_MASTER:-}" "${KUBE_ROOT}/cluster/kube-up.sh" + KUBE_USE_EXISTING_MASTER="true" # For subsequent zones we use the existing master + done + else + "${KUBE_ROOT}/cluster/kube-up.sh" + fi + # Open up port 80 & 8080 so common containers on minions can be reached # TODO(roberthbailey): Remove this once we are no longer relying on hostPorts. local start=`date +%s` diff --git a/cluster/gke/util.sh b/cluster/gke/util.sh index 07dd18aff2..816890f460 100755 --- a/cluster/gke/util.sh +++ b/cluster/gke/util.sh @@ -167,8 +167,11 @@ function test-setup() { echo "... in gke:test-setup()" >&2 # Detect the project into $PROJECT if it isn't set detect-project >&2 - detect-nodes >&2 + "${KUBE_ROOT}/cluster/kube-up.sh" + + detect-nodes >&2 + # At this point, CLUSTER_NAME should have been used, so its value is final. NODE_TAG=$($GCLOUD compute instances describe ${NODE_NAMES[0]} --project="${PROJECT}" --zone="${ZONE}" | grep -o "gke-${CLUSTER_NAME}-.\{8\}-node" | head -1) OLD_NODE_TAG="k8s-${CLUSTER_NAME}-node" diff --git a/cluster/juju/util.sh b/cluster/juju/util.sh index 4d2f8078c4..71a334bfad 100755 --- a/cluster/juju/util.sh +++ b/cluster/juju/util.sh @@ -165,9 +165,9 @@ function test-build-release { } # Execute prior to running tests to initialize required structure. This is -# called from hack/e2e.go only when running -up (it is run after kube-up). +# called from hack/e2e.go only when running -up. function test-setup { - echo "test-setup() " 1>&2 + "${KUBE_ROOT}/cluster/kube-up.sh" } # Execute after running tests to perform any required clean-up. This is called diff --git a/cluster/libvirt-coreos/util.sh b/cluster/libvirt-coreos/util.sh index 80159a49b9..f70d202e76 100644 --- a/cluster/libvirt-coreos/util.sh +++ b/cluster/libvirt-coreos/util.sh @@ -316,7 +316,7 @@ function test-build-release { # Execute prior to running tests to initialize required structure function test-setup { - echo "TODO" + "${KUBE_ROOT}/cluster/kube-up.sh" } # Execute after running tests to perform any required clean-up diff --git a/cluster/mesos/docker/util.sh b/cluster/mesos/docker/util.sh index 83b3b3085e..9feb80d078 100644 --- a/cluster/mesos/docker/util.sh +++ b/cluster/mesos/docker/util.sh @@ -317,7 +317,8 @@ function kube-down { } function test-setup { - echo "TODO: test-setup" 1>&2 + echo "test-setup" 1>&2 + "${KUBE_ROOT}/cluster/kube-up.sh" } # Execute after running tests to perform any required clean-up diff --git a/cluster/vagrant/util.sh b/cluster/vagrant/util.sh index 0f90b1e2e0..dea623d0b9 100755 --- a/cluster/vagrant/util.sh +++ b/cluster/vagrant/util.sh @@ -317,6 +317,7 @@ function test-build-release { # Execute prior to running tests to initialize required structure function test-setup { + "${KUBE_ROOT}/cluster/kube-up.sh" echo "Vagrant test setup complete" 1>&2 } diff --git a/hack/e2e-internal/e2e-up.sh b/hack/e2e-internal/e2e-up.sh index d075a03f26..888b622710 100755 --- a/hack/e2e-internal/e2e-up.sh +++ b/hack/e2e-internal/e2e-up.sh @@ -31,14 +31,4 @@ source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" prepare-e2e -if [[ ${MULTIZONE:-} == "true" ]]; then - for KUBE_GCE_ZONE in ${E2E_ZONES} - do - KUBE_GCE_ZONE="${KUBE_GCE_ZONE}" KUBE_USE_EXISTING_MASTER="${KUBE_USE_EXISTING_MASTER:-}" KUBE_TEST_DEBUG=y "${KUBE_VERSION_ROOT}/cluster/kube-up.sh" - KUBE_USE_EXISTING_MASTER="true" # For subsequent zones we use the existing master - done -else - KUBE_TEST_DEBUG=y "${KUBE_VERSION_ROOT}/cluster/kube-up.sh" -fi - test-setup diff --git a/hack/e2e.go b/hack/e2e.go index 85f1c91956..9ddc34a973 100644 --- a/hack/e2e.go +++ b/hack/e2e.go @@ -122,6 +122,7 @@ func main() { } os.Setenv("KUBECTL", versionRoot+`/cluster/kubectl.sh`+kubectlArgs()) + os.Setenv("KUBE_TEST_DEBUG", "y") if *pushup { if IsUp() { @@ -175,7 +176,6 @@ func Up() bool { return false } } - return finishRunning("up", exec.Command(path.Join(*root, "hack/e2e-internal/e2e-up.sh"))) }