diff --git a/tests/extra_test_k3s_versions.sh b/tests/extra_test_k3s_versions.sh index e9c8e93f..92374bd4 100755 --- a/tests/extra_test_k3s_versions.sh +++ b/tests/extra_test_k3s_versions.sh @@ -3,7 +3,8 @@ CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" [ -d "$CURR_DIR" ] || { echo "FATAL: no current dir (maybe running in zsh?)"; exit 1; } -K3S_VERSIONS=("v1.17.12-k3s1" "v1.18.9-k3s1" "v1.19.1-k3s1") +K3S_VERSIONS=("v1.17.12-k3s1" "v1.18.9-k3s1" "v1.19.2-rc2-k3s1" "v1.19.1-k3s1") +FAILED_VERSIONS=() # shellcheck source=./common.sh source "$CURR_DIR/common.sh" @@ -20,9 +21,15 @@ for version in "${K3S_VERSIONS[@]}"; do $EXE cluster delete c1 || failed "could not delete the cluster c1" K3S_IMAGE_TAG="$version" $CURR_DIR/test_multi_master.sh + if [[ $? -eq 1 ]]; then + FAILED_VERSIONS+=("$version") + fi done -exit 0 - - +if [[ ${#FAILED_VERSIONS[@]} -gt 0 ]]; then + failed "Tests failed for k3s versions: ${FAILED_VERSIONS[*]}" +else + passed "Successfully verified all given k3s versions" + exit 0 +fi diff --git a/tests/runner.sh b/tests/runner.sh index 5177cf1f..79753320 100755 --- a/tests/runner.sh +++ b/tests/runner.sh @@ -21,7 +21,11 @@ section "BASIC TESTS" for i in $CURR_DIR/test_*.sh ; do base=$(basename "$i" .sh) - if [[ $E2E_SKIP =~ (^| )$base($| ) ]]; then + skip=false + for skiptest in "${E2E_SKIP[@]}"; do + [[ "$skiptest" =~ (^| )${base}($| ) ]] && skip=true + done + if [ "$skip" = true ]; then highlight "***** Skipping $base *****" else highlight "***** Running $base *****" diff --git a/tests/test_multi_master.sh b/tests/test_multi_master.sh index d9497554..e0ce4d90 100755 --- a/tests/test_multi_master.sh +++ b/tests/test_multi_master.sh @@ -15,18 +15,20 @@ if [[ -n "$K3S_IMAGE_TAG" ]]; then fi info "Creating cluster multiserver $EXTRA_TITLE ..." -$EXE cluster create "multiserver" --servers 3 --api-port 6443 --wait --timeout 360s $EXTRA_FLAG || failed "could not create cluster multiserver" +$EXE cluster create "multiserver" --servers 3 --api-port 6443 --wait --timeout 360s $EXTRA_FLAG || failed "could not create cluster multiserver $EXTRA_TITLE" info "Checking that we have access to the cluster..." -check_clusters "multiserver" || failed "error checking cluster" +check_clusters "multiserver" || failed "error checking cluster $EXTRA_TITLE" info "Sleeping for 5 seconds to give the cluster enough time to get ready..." sleep 5 info "Checking that we have 3 server nodes online..." -check_multi_node "multiserver" 3 || failed "failed to verify number of nodes" +check_multi_node "multiserver" 3 || failed "failed to verify number of nodes $EXTRA_TITLE" info "Deleting cluster multiserver..." -$EXE cluster delete "multiserver" || failed "could not delete the cluster multiserver" +$EXE cluster delete "multiserver" || failed "could not delete the cluster multiserver $EXTRA_TITLE" + +passed "GOOD: multiserver cluster test successful $EXTRA_TITLE" exit 0