From d64f0f1183efcbbaaa08e39147c96e8104040cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Mon, 2 Mar 2015 17:13:57 +0100 Subject: [PATCH] Make libvirt-CoreOS cluster able to run e2e tests --- cluster/libvirt-coreos/config-test.sh | 19 +++++++++++++++++++ cluster/libvirt-coreos/util.sh | 9 +++++++-- hack/ginkgo-e2e.sh | 8 +++++++- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 cluster/libvirt-coreos/config-test.sh diff --git a/cluster/libvirt-coreos/config-test.sh b/cluster/libvirt-coreos/config-test.sh new file mode 100644 index 00000000000..2d30bc9360c --- /dev/null +++ b/cluster/libvirt-coreos/config-test.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Copyright 2014 Google Inc. All rights reserved. +# +# 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. + +## Contains configuration values for interacting with the Vagrant cluster in test mode +KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. +source "${KUBE_ROOT}/cluster/libvirt-coreos/config-default.sh" diff --git a/cluster/libvirt-coreos/util.sh b/cluster/libvirt-coreos/util.sh index 7bcee77043c..64d7eb9553b 100644 --- a/cluster/libvirt-coreos/util.sh +++ b/cluster/libvirt-coreos/util.sh @@ -16,7 +16,7 @@ # A library of helper functions that each provider hosting Kubernetes must implement to use cluster/kube-*.sh scripts. -readonly KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. +KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. readonly ROOT=$(dirname "${BASH_SOURCE}") source $ROOT/${KUBE_CONFIG_FILE:-"config-default.sh"} @@ -277,7 +277,7 @@ function test-setup { # Execute after running tests to perform any required clean-up function test-teardown { - echo "TODO" + kube-down } # Set the {KUBE_USER} and {KUBE_PASSWORD} environment values required to interact with provider @@ -294,6 +294,11 @@ function teardown-monitoring-firewall { echo "TODO" 1>&2 } +# Perform preparations required to run e2e tests +function prepare-e2e() { + echo "libvirt-coreos doesn't need special preparations for e2e tests" 1>&2 +} + function setup-logging-firewall { echo "TODO: setup logging" } diff --git a/hack/ginkgo-e2e.sh b/hack/ginkgo-e2e.sh index e92c5f73757..2dd98e36112 100755 --- a/hack/ginkgo-e2e.sh +++ b/hack/ginkgo-e2e.sh @@ -103,10 +103,16 @@ else auth_config=() fi +if [[ "$KUBERNETES_PROVIDER" == "libvirt-coreos" ]]; then + host="http://${KUBE_MASTER_IP-}:8080" +else + host="https://${KUBE_MASTER_IP-}" +fi + # Use the kubectl binary from the same directory as the e2e binary. export PATH=$(dirname "${e2e}"):"${PATH}" "${e2e}" "${auth_config[@]:+${auth_config[@]}}" \ - --host="https://${KUBE_MASTER_IP-}" \ + --host="$host" \ --provider="${KUBERNETES_PROVIDER}" \ --gce_project="${PROJECT:-}" \ --gce_zone="${ZONE:-}" \