Skip to content

Commit

Permalink
Make libvirt-CoreOS cluster able to run e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
L3n41c committed Mar 2, 2015
1 parent c763fbf commit d64f0f1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
19 changes: 19 additions & 0 deletions cluster/libvirt-coreos/config-test.sh
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 7 additions & 2 deletions cluster/libvirt-coreos/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}

Expand Down Expand Up @@ -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
Expand All @@ -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"
}
Expand Down
8 changes: 7 additions & 1 deletion hack/ginkgo-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-}" \
Expand Down

0 comments on commit d64f0f1

Please sign in to comment.