From 7c7849a61a682d46a87f18634cb6540467dbe6f6 Mon Sep 17 00:00:00 2001 From: jadarsie Date: Mon, 20 Apr 2020 23:09:49 -0700 Subject: [PATCH] test variables --- env/defaults.env | 45 +++++++++++++++++++++ env/sample.env | 17 -------- hack/{cloud.sh => cloud-variables.sh} | 6 --- hack/test-variables.sh | 8 ++++ scripts/e2e.sh | 11 +++--- test_clusters/linux-azure-cni.json | 6 +-- test_clusters/linux-containerd.json | 6 +-- test_clusters/linux-kubenet.json | 6 +-- test_clusters/linux-upgrade.json | 56 +++++++++++++++++++++++++++ test_clusters/mixed-azure-cni.json | 8 ++-- test_clusters/variables-example.json | 16 -------- test_clusters/windows-azure-cni.json | 6 +-- 12 files changed, 131 insertions(+), 60 deletions(-) create mode 100644 env/defaults.env rename hack/{cloud.sh => cloud-variables.sh} (86%) create mode 100644 hack/test-variables.sh create mode 100644 test_clusters/linux-upgrade.json delete mode 100644 test_clusters/variables-example.json diff --git a/env/defaults.env b/env/defaults.env new file mode 100644 index 0000000..fa138d2 --- /dev/null +++ b/env/defaults.env @@ -0,0 +1,45 @@ +# Constants +export DEV_IMAGE="quay.io/deis/go-dev:v1.25.0" +export API_PROFILE="2019-03-01-hybrid" +export ENVIRONMENT_NAME="AzureStackCloud" +export AUTHENTICATION_METHOD="client_secret" +export ORCHESTRATOR="kubernetes" +export AZURE_ENV="AzureStackCloud" + +# Runner +export CLEANUP_ON_EXIT=true +export CLEANUP_IF_FAIL=false +export RETAIN_SSH=true +export SKIP_TESTS=false +export E2E_TEST_TIMEOUT="60m" +export SKIP_LOGS_COLLECTION=true + +# First deployment repo & branch +export AKSE_REPO="jadarsie/aks-engine" +export AKSE_BRANCH="e2e" + +# Upgrade/Scale repo & branch +export UPGRADE_FORK="jadarsie" +export UPGRADE_BRANCH="e2e" + +# Scale +export SCALE_CLUSTER=false +export NODE_COUNT=2 +export SKIP_TESTS_AFTER_SCALE_DOWN=true +export SKIP_TESTS_AFTER_SCALE_UP=true + +# Upgrade +export UPGRADE_CLUSTER=false +export UPGRADE_VERSIONS="1.15.10" +export MASTER_VM_UPGRADE_SKU="Standard_D3_v2" +export SKIP_TESTS_AFTER_UPGRADE=true + +# Log Collection +export GET_CLUSTER_LOGS=false + +# Custom VNET +export CREATE_VNET=false + +# Tests +export GINKGO_SKIP="should have the correct storage classes deployed" +export TEST_PVC=true diff --git a/env/sample.env b/env/sample.env index 8876365..5ac0a49 100644 --- a/env/sample.env +++ b/env/sample.env @@ -9,20 +9,3 @@ export AZURE_SUBSCRIPTION_ID="" export AZURE_TENANT_ID="" export SSH_PRIVATE_KEY="" export DVM_HOST="" - -# TEST DETAILS -export CLUSTER_DEFINITION="" -export DEV_IMAGE="" -export AKSE_REPO="" -export AKSE_BRANCH="" -export UPGRADE_FORK="" -export UPGRADE_BRANCH="" -export E2E_TEST_TIMEOUT="30m" -export CLEANUP_ON_EXIT=false -export CLEANUP_IF_FAIL=false -export RETAIN_SSH=true -export SKIP_TESTS=false -export SKIP_LOGS_COLLECTION=true -export CREATE_VNET=false -export SCALE_CLUSTER=true -export GINKGO_SKIP="should have the correct storage classes deployed" diff --git a/hack/cloud.sh b/hack/cloud-variables.sh similarity index 86% rename from hack/cloud.sh rename to hack/cloud-variables.sh index 15445fe..96944ea 100644 --- a/hack/cloud.sh +++ b/hack/cloud-variables.sh @@ -8,12 +8,6 @@ set -o xtrace METADATA=$(mktemp) curl -sk -o ${METADATA} "https://management.${AZURE_LOCATION}.${CLOUD_FQDN}/metadata/endpoints?api-version=2015-01-01" -echo export API_PROFILE=\"2019-03-01-hybrid\" -echo export ENVIRONMENT_NAME=\"AzureStackCloud\" -echo export AUTHENTICATION_METHOD=\"client_secret\" -echo export ORCHESTRATOR=\"kubernetes\" -echo export AZURE_ENV=\"AzureStackCloud\" - echo export LOCATION=\"$AZURE_LOCATION\" echo export REGION_OPTIONS=\"$AZURE_LOCATION\" echo export CLIENT_ID=\"$AZURE_CLIENT_ID\" diff --git a/hack/test-variables.sh b/hack/test-variables.sh new file mode 100644 index 0000000..8e9e233 --- /dev/null +++ b/hack/test-variables.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail +set -o xtrace + +jq .env ${CLUSTER_DEFINITION} | jq -r 'keys[] as $k | "export \($k)=\"\(.[$k])\""' diff --git a/scripts/e2e.sh b/scripts/e2e.sh index b3fafd1..648aa9c 100755 --- a/scripts/e2e.sh +++ b/scripts/e2e.sh @@ -8,12 +8,13 @@ set -o xtrace REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. cd "${REPO_ROOT}" || exit 1 -source "${REPO_ROOT}/hack/akse-clone.sh" -source "${REPO_ROOT}/hack/akse-build.sh" - -source "${REPO_ROOT}/hack/cloud.sh" > env/cloud.env +source "${REPO_ROOT}/env/defaults.env" +source "${REPO_ROOT}/hack/test-variables.sh" > env/test.env +source "${REPO_ROOT}/env/test.env" +source "${REPO_ROOT}/hack/cloud-variables.sh" > env/cloud.env source "${REPO_ROOT}/env/cloud.env" +source "${REPO_ROOT}/hack/akse-clone.sh" +source "${REPO_ROOT}/hack/akse-build.sh" source "${REPO_ROOT}/hack/cloud-register.sh" - source "${REPO_ROOT}/hack/akse-e2e.sh" diff --git a/test_clusters/linux-azure-cni.json b/test_clusters/linux-azure-cni.json index 07a5464..7f95a7b 100644 --- a/test_clusters/linux-azure-cni.json +++ b/test_clusters/linux-azure-cni.json @@ -2,7 +2,7 @@ "env": {}, "apiModel": { "apiVersion": "vlabs", - "location": "westus2", + "location": "", "properties": { "orchestratorProfile": { "orchestratorType": "Kubernetes", @@ -14,7 +14,7 @@ } }, "masterProfile": { - "count": 1, + "count": 3, "dnsPrefix": "", "vmSize": "Standard_D2_v2", "distro": "aks-ubuntu-16.04" @@ -22,7 +22,7 @@ "agentPoolProfiles": [ { "name": "linuxpool", - "count": 2, + "count": 3, "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet", "distro": "aks-ubuntu-16.04", diff --git a/test_clusters/linux-containerd.json b/test_clusters/linux-containerd.json index 3f4bfc9..ea5f43e 100644 --- a/test_clusters/linux-containerd.json +++ b/test_clusters/linux-containerd.json @@ -2,7 +2,7 @@ "env": {}, "apiModel": { "apiVersion": "vlabs", - "location": "westus2", + "location": "", "properties": { "orchestratorProfile": { "orchestratorType": "Kubernetes", @@ -15,7 +15,7 @@ } }, "masterProfile": { - "count": 1, + "count": 3, "dnsPrefix": "", "vmSize": "Standard_D2_v2", "distro": "aks-ubuntu-16.04" @@ -23,7 +23,7 @@ "agentPoolProfiles": [ { "name": "linuxpool", - "count": 2, + "count": 3, "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet", "distro": "aks-ubuntu-16.04", diff --git a/test_clusters/linux-kubenet.json b/test_clusters/linux-kubenet.json index 62563a7..a765ada 100644 --- a/test_clusters/linux-kubenet.json +++ b/test_clusters/linux-kubenet.json @@ -2,7 +2,7 @@ "env": {}, "apiModel": { "apiVersion": "vlabs", - "location": "westus2", + "location": "", "properties": { "orchestratorProfile": { "orchestratorType": "Kubernetes", @@ -14,7 +14,7 @@ } }, "masterProfile": { - "count": 1, + "count": 3, "dnsPrefix": "", "vmSize": "Standard_D2_v2", "distro": "aks-ubuntu-16.04" @@ -22,7 +22,7 @@ "agentPoolProfiles": [ { "name": "linuxpool", - "count": 2, + "count": 3, "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet", "distro": "aks-ubuntu-16.04", diff --git a/test_clusters/linux-upgrade.json b/test_clusters/linux-upgrade.json new file mode 100644 index 0000000..7998023 --- /dev/null +++ b/test_clusters/linux-upgrade.json @@ -0,0 +1,56 @@ +{ + "env": { + "UPGRADE_CLUSTER": true, + "SKIP_TESTS": true + }, + "apiModel": { + "apiVersion": "vlabs", + "location": "", + "properties": { + "orchestratorProfile": { + "orchestratorType": "Kubernetes", + "orchestratorRelease": "1.14", + "orchestratorVersion": "1.14.7", + "kubernetesConfig": { + "networkPlugin": "kubenet", + "useInstanceMetadata": false + } + }, + "masterProfile": { + "count": 3, + "dnsPrefix": "", + "vmSize": "Standard_D2_v2", + "distro": "aks-ubuntu-16.04" + }, + "agentPoolProfiles": [ + { + "name": "linuxpool", + "count": 3, + "vmSize": "Standard_D2_v2", + "availabilityProfile": "AvailabilitySet", + "distro": "aks-ubuntu-16.04", + "acceleratedNetworkingEnabled": false + } + ], + "linuxProfile": { + "adminUsername": "azureuser", + "ssh": { + "publicKeys": [ + { + "keyData": "" + } + ] + } + }, + "servicePrincipalProfile": { + "clientId": "", + "secret": "" + }, + "customCloudProfile": { + "identitySystem": "", + "authenticationMethod": "client_secret", + "portalURL": "" + } + } + } +} \ No newline at end of file diff --git a/test_clusters/mixed-azure-cni.json b/test_clusters/mixed-azure-cni.json index 0a7e961..7d707d0 100644 --- a/test_clusters/mixed-azure-cni.json +++ b/test_clusters/mixed-azure-cni.json @@ -2,7 +2,7 @@ "env": {}, "apiModel": { "apiVersion": "vlabs", - "location": "westus2", + "location": "", "properties": { "orchestratorProfile": { "orchestratorType": "Kubernetes", @@ -14,7 +14,7 @@ } }, "masterProfile": { - "count": 1, + "count": 3, "dnsPrefix": "", "vmSize": "Standard_D2_v2", "distro": "aks-ubuntu-16.04" @@ -22,7 +22,7 @@ "agentPoolProfiles": [ { "name": "linuxpool", - "count": 2, + "count": 3, "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet", "distro": "aks-ubuntu-16.04", @@ -30,7 +30,7 @@ }, { "name": "windowspool", - "count": 2, + "count": 3, "vmSize": "Standard_D2_v2", "osType": "Windows", "availabilityProfile": "AvailabilitySet", diff --git a/test_clusters/variables-example.json b/test_clusters/variables-example.json deleted file mode 100644 index 292b89b..0000000 --- a/test_clusters/variables-example.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "env": { - "SCALE_CLUSTER": true, - "UPGRADE_CLUSTER": true, - "GET_CLUSTER_LOGS": true, - "CREATE_VNET": true, - "UPGRADE_VERSIONS": "1.23.45", - "GINKGO_FOCUS": "should apply various network policies", - "SKIP_TESTS": "true", - "GINKGO_SKIP": "should report all nodes in a Ready state", - "TEST_PVC": true, - "UPGRADE_FORK": "jadarsie", - "UPGRADE_BRANCH": "wip" - }, - "apiModel": {} -} \ No newline at end of file diff --git a/test_clusters/windows-azure-cni.json b/test_clusters/windows-azure-cni.json index f3b3c49..0ac0fd0 100644 --- a/test_clusters/windows-azure-cni.json +++ b/test_clusters/windows-azure-cni.json @@ -2,7 +2,7 @@ "env": {}, "apiModel": { "apiVersion": "vlabs", - "location": "westus2", + "location": "", "properties": { "orchestratorProfile": { "orchestratorType": "Kubernetes", @@ -14,7 +14,7 @@ } }, "masterProfile": { - "count": 1, + "count": 3, "dnsPrefix": "", "vmSize": "Standard_D2_v2", "distro": "aks-ubuntu-16.04" @@ -22,7 +22,7 @@ "agentPoolProfiles": [ { "name": "windowspool", - "count": 2, + "count": 3, "vmSize": "Standard_D2_v2", "osType": "Windows", "availabilityProfile": "AvailabilitySet",