# ============LICENSE_END=================================================
#
-# This is a script that contains container/service managemnt functions test functions for Helm Manager
+# This is a script that contains container/service management functions test functions for Helm Manager
################ Test engine functions ################
# arg: [<image-tag-suffix>] (selects staging, snapshot, release etc)
# <image-tag-suffix> is present only for images with staging, snapshot,release tags
__HELMMANAGER_imagesetup() {
- __check_and_create_image_var HELMMANAGER "HELM_MANAGER_IMAGE" "HELM_MANAGER_IMAGE_BASE" "HELM_MANAGER_IMAGE_TAG" $1 "$HELM_MANAGER_DISPLAY_NAME"
+ __check_and_create_image_var HELMMANAGER "HELM_MANAGER_IMAGE" "HELM_MANAGER_IMAGE_BASE" "HELM_MANAGER_IMAGE_TAG" $1 "$HELM_MANAGER_DISPLAY_NAME" ""
}
# Pull image from remote repo or use locally built image
}
# Scale kubernetes resources to zero and wait until this has been accomplished, if relevant. If not relevant to scale, then do no action.
-# This function is called for prestarted apps not managed by the test script.
+# This function is called for pre-started apps not managed by the test script.
__HELMMANAGER_kube_scale_zero_and_wait() {
- __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app "$KUBE_NONRTRIC_NAMESPACE"-helmmanagerservice
+ __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app "$KUBE_NONRTRIC_NAMESPACE"-"$HELM_MANAGER_APP_NAME"
}
-# Delete all kube resouces for the app
+# Delete all kube resources for the app
# This function is called for apps managed by the test script.
__HELMMANAGER_kube_delete_all() {
__kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest HELMMANAGER
# Store docker logs
# This function is called for apps managed by the test script.
-# args: <log-dir> <file-prexix>
+# args: <log-dir> <file-prefix>
__HELMMANAGER_store_docker_logs() {
if [ $RUNMODE == "KUBE" ]; then
- kubectl logs -l "autotest=HELMMANAGER" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_helmmanager.log 2>&1
+ kubectl $KUBECONF logs -l "autotest=HELMMANAGER" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_helmmanager.log 2>&1
else
docker logs $HELM_MANAGER_APP_NAME > $1$2_helmmanager.log 2>&1
fi
use_helm_manager_http
}
-# Set app short-name, app name and namespace for logging runtime statistics of kubernets pods or docker containers
+# Set app short-name, app name and namespace for logging runtime statistics of kubernetes pods or docker containers
# For docker, the namespace shall be excluded
-# This function is called for apps managed by the test script as well as for prestarted apps.
+# This function is called for apps managed by the test script as well as for pre-started apps.
# args: -
-__HELMMANAGER_statisics_setup() {
+__HELMMANAGER_statistics_setup() {
if [ $RUNMODE == "KUBE" ]; then
echo "HELMMANAGER $HELM_MANAGER_APP_NAME $KUBE_NONRTRIC_NAMESPACE"
else
__check_included_image "HELMMANAGER"
retcode_i=$?
- # Check if app shall only be used by the testscipt
+ # Check if app shall only be used by the test script
__check_prestarted_image "HELMMANAGER"
retcode_p=$?
if [ $retcode_p -eq 0 ]; then
echo -e " Using existing $HELM_MANAGER_APP_NAME deployment and service"
echo " Setting $HELM_MANAGER_APP_NAME replicas=1"
- __kube_scale deployment $HELM_MANAGER_APP_NAME $KUBE_NONRTRIC_NAMESPACE 1
+ __kube_scale sts $HELM_MANAGER_APP_NAME $KUBE_NONRTRIC_NAMESPACE 1
fi
if [ $retcode_i -eq 0 ]; then
echo ""
}
-# Excute a curl cmd towards the helm manager.
+# Execute a curl cmd towards the helm manager.
# args: GET <path>
# args: POST <path> <file-to-post>
# args: POST3 <path> <name> <file-to-post> <name> <file-to-post> <name> <file-to-post>
return 1
fi
else
- retmsg=$(kubectl exec -it $HELM_MANAGER_APP_NAME -n $KUBE_NONRTRIC_NAMESPACE -- helm repo add $1 $2)
+ retmsg=$(kubectl $KUBECONF exec -it $HELM_MANAGER_APP_NAME -n $KUBE_NONRTRIC_NAMESPACE -- helm repo add $1 $2)
retcode=$?
if [ $retcode -ne 0 ]; then
__log_conf_fail_general " Cannot add repo to helm, return code: $retcode, msg: $retmsg"