X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fkeycloak_api_functions.sh;h=858c3ec17afac5c56b0f5f6cb40862a04ef01bfb;hb=refs%2Fchanges%2F44%2F11344%2F1;hp=7f49595bc4e8b4d5a2f3cd94ec58b6cb1253ea46;hpb=cd93844db2fd8a9901fbf4df3b597b138af6e042;p=nonrtric.git diff --git a/test/common/keycloak_api_functions.sh b/test/common/keycloak_api_functions.sh index 7f49595b..858c3ec1 100644 --- a/test/common/keycloak_api_functions.sh +++ b/test/common/keycloak_api_functions.sh @@ -26,7 +26,7 @@ # arg: (selects staging, snapshot, release etc) # is present only for images with staging, snapshot,release tags __KEYCLOAK_imagesetup() { - __check_and_create_image_var KEYCLOAK "KEYCLOAK_IMAGE" "KEYCLOAK_IMAGE_BASE" "KEYCLOAK_IMAGE_TAG" REMOTE_OTHER "$KEYCLOAK_DISPLAY_NAME" + __check_and_create_image_var KEYCLOAK "KEYCLOAK_IMAGE" "KEYCLOAK_IMAGE_BASE" "KEYCLOAK_IMAGE_TAG" REMOTE_OTHER "$KEYCLOAK_DISPLAY_NAME" "" } # Pull image from remote repo or use locally built image @@ -63,12 +63,12 @@ __KEYCLOAK_kube_scale_zero() { } # 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. __KEYCLOAK_kube_scale_zero_and_wait() { echo -e $RED" KEYCLOAK app is not scaled in this state"$ERED } -# 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. __KEYCLOAK_kube_delete_all() { __kube_delete_all_resources $KUBE_KEYCLOAK_NAMESPACE autotest KEYCLOAK @@ -76,7 +76,7 @@ __KEYCLOAK_kube_delete_all() { # Store docker logs # This function is called for apps managed by the test script. -# args: +# args: __KEYCLOAK_store_docker_logs() { if [ $RUNMODE == "KUBE" ]; then kubectl $KUBECONF logs -l "autotest=KEYCLOAK" -n $KUBE_KEYCLOAK_NAMESPACE --tail=-1 > $1$2_keycloak.log 2>&1 @@ -92,11 +92,11 @@ __KEYCLOAK_initial_setup() { use_keycloak_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: - -__KEYCLOAK_statisics_setup() { +__KEYCLOAK_statistics_setup() { if [ $RUNMODE == "KUBE" ]; then echo "KEYCLOAK $KEYCLOAK_APP_NAME $KUBE_KEYCLOAK_NAMESPACE" else @@ -191,7 +191,7 @@ start_keycloak() { __check_included_image "KEYCLOAK" 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 "KEYCLOAK" retcode_p=$? @@ -247,7 +247,7 @@ start_keycloak() { return 0 } -# Excute a curl cmd towards the keycloak and check the response code is 2XX. +# Execute a curl cmd towards the keycloak and check the response code is 2XX. # args: # resp: if return code is 0 otherwise __execute_curl_to_keycloak() { @@ -280,7 +280,7 @@ __execute_curl_to_keycloak() { return 0 } -# Excute a curl cmd towards the keycloak and check the response code is 2XX. +# Execute a curl cmd towards the keycloak and check the response code is 2XX. # args: # resp: if return code is 0 otherwise __execute_curl_to_keycloak2() { @@ -561,18 +561,6 @@ keycloak_api_map_client_roles() { return 1 fi - - - - # while [ $# -gt 0 ]; do - # __json='{"name":"'$1'"}' - # res=$(__execute_curl_to_keycloak2 POST "$KEYCLOAK_SERVICE_PATH$KEYCLOAK_REALM_URL_PREFIX/$__realm/clients/$__c_id/roles" "$__KEYCLOAK_ADMIN_TOKEN" "$__json") - # if [ $? -ne 0 ]; then - # __log_conf_fail_general " Fatal error when adding client role, response: "$? - # return 1 - # fi - # shift - # done __log_conf_ok return 0 }