mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 20:50:24 +00:00
Make e2e shell tests work standalone
Simply incorporate some of the boilerplate from hack/e2e.go into the scripts in hack/e2e-suite. Use environment variables with default values to allow overrides in kubectl command line and to use a versioned package root. Tested: - Ran `go run hack/e2e.go -test` on a test cluster. - Ran the test cases individually. - Ran hack/e2e-suite/goe2e.sh -t Pods to confirm it takes arguments. - Also fixed cluster/test-network.sh (which should be more and more irrelevant.)
This commit is contained in:
@@ -22,8 +22,17 @@ set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
|
||||
: ${KUBE_VERSION_ROOT:=${KUBE_ROOT}}
|
||||
: ${KUBECTL:="${KUBE_VERSION_ROOT}/cluster/kubectl.sh"}
|
||||
: ${KUBE_CONFIG_FILE:="config-test.sh"}
|
||||
|
||||
export KUBECTL KUBE_CONFIG_FILE
|
||||
|
||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
||||
source "${KUBE_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh"
|
||||
source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
||||
|
||||
prepare-e2e
|
||||
|
||||
if [[ "$KUBERNETES_PROVIDER" != "gce" ]] && [[ "$KUBERNETES_PROVIDER" != "gke" ]]; then
|
||||
echo "WARNING: Skipping pd.sh for cloud provider: ${KUBERNETES_PROVIDER}."
|
||||
|
Reference in New Issue
Block a user