From 28edfb1d9bf5bf488e1385d2ddc81af192f9e709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20Suszy=C5=84ski?= Date: Fri, 6 Dec 2019 22:21:39 +0100 Subject: [PATCH] Invocation of upstream knative/serving-operator e2e tests A bash version of test invocation of upstream knative/serving-operator. There is a patch that skips TestKnativeServingDeployment/configure due to SRVKS-241. There is a 0.9.0 version of knative/serving-operator executed, as current serverless operator do not handle knativeservings.operator.knative.dev yet. After supporting that versions should be set to support/v0.10.0. For 0.11 we can use use knative instead of fork (cardil) as master has configurable test namespace. --- hack/lib/serverless.bash | 41 ++++---- test/e2e-tests.sh | 17 ++-- test/lib.bash | 93 ++++++++++++++++--- ...tive-serving-operator-skip-configure.patch | 14 +++ 4 files changed, 129 insertions(+), 36 deletions(-) create mode 100644 test/patches/SRVKS-241-knative-serving-operator-skip-configure.patch diff --git a/hack/lib/serverless.bash b/hack/lib/serverless.bash index 9f9fdca8ee..b7e0a8c171 100644 --- a/hack/lib/serverless.bash +++ b/hack/lib/serverless.bash @@ -10,37 +10,45 @@ function ensure_serverless_installed { } function install_serverless_previous { - local rootdir="$(dirname "$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")")" + local rootdir current_csv previous_csv + rootdir="$(dirname "$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")")" # Remove installplan from previous installations, leaving this would make the operator # upgrade to the latest version immediately - local current_csv=$(${rootdir}/hack/catalog.sh | grep currentCSV | awk '{ print $2 }') - remove_installplan $current_csv + current_csv=$("${rootdir}/hack/catalog.sh" | grep currentCSV | awk '{ print $2 }') + remove_installplan "$current_csv" - local previous_csv=$(${rootdir}/hack/catalog.sh | grep replaces: | tail -n1 | awk '{ print $2 }') - deploy_serverless_operator $previous_csv || return $? + previous_csv=$("${rootdir}/hack/catalog.sh" | grep replaces: | tail -n1 | awk '{ print $2 }') + deploy_serverless_operator "$previous_csv" || return $? deploy_knativeserving_cr || return $? } function remove_installplan { - local install_plan=$(find_install_plan $1) + local install_plan + install_plan=$(find_install_plan $1) if [[ -n $install_plan ]]; then - oc delete $install_plan -n ${OPERATORS_NAMESPACE} + oc delete "$install_plan" -n "${OPERATORS_NAMESPACE}" fi } function install_serverless_latest { - local rootdir="$(dirname "$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")")" + deploy_serverless_operator_latest || return $? + deploy_knativeserving_cr || return $? +} + +function deploy_serverless_operator_latest { + local rootdir csv + rootdir="$(dirname "$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")")" # Get the current/latest CSV - local csv=$(${rootdir}/hack/catalog.sh | grep currentCSV | awk '{ print $2 }') + csv=$("${rootdir}/hack/catalog.sh" | grep currentCSV | awk '{ print $2 }') - deploy_serverless_operator $csv || return $? - deploy_knativeserving_cr || return $? + deploy_serverless_operator "${csv}" } function deploy_serverless_operator { logger.info 'Install the Serverless Operator' - local csv=$1 + local csv + csv="$1" cat <