X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fics_api_functions.sh;h=0c067ca3ee79c8e89b1ca7ef86e29feba6c86f05;hb=refs%2Fchanges%2F28%2F10128%2F1;hp=0df2ae41ab0a08bd2afab52519a66f4dd80da8c2;hpb=d2aeca8843fe3ffca2e73dec5b64daeef0dda938;p=nonrtric.git diff --git a/test/common/ics_api_functions.sh b/test/common/ics_api_functions.sh index 0df2ae41..0c067ca3 100644 --- a/test/common/ics_api_functions.sh +++ b/test/common/ics_api_functions.sh @@ -89,6 +89,7 @@ __ICS_store_docker_logs() { # args: - __ICS_initial_setup() { use_ics_rest_http + export ICS_SIDECAR_JWT_FILE="" } # Set app short-name, app name and namespace for logging runtime statistics of kubernets pods or docker containers @@ -278,6 +279,10 @@ start_ics() { # Create app input_yaml=$SIM_GROUP"/"$ICS_COMPOSE_DIR"/"app.yaml output_yaml=$PWD/tmp/ics_app.yaml + if [ -z "$ICS_SIDECAR_JWT_FILE" ]; then + cat $input_yaml | sed '/#ICS_JWT_START/,/#ICS_JWT_STOP/d' > $PWD/tmp/ics_app_tmp.yaml + input_yaml=$PWD/tmp/ics_app_tmp.yaml + fi __kube_create_instance app $ICS_APP_NAME $input_yaml $output_yaml fi @@ -321,6 +326,7 @@ start_ics() { fi else echo " No files in mounted dir or dir does not exists" + mkdir db fi cd $curdir @@ -448,7 +454,7 @@ set_ics_debug() { # (Function for test scripts) set_ics_trace() { echo -e $BOLD"Setting ics trace logging"$EBOLD - curlString="$ICS_SERVICE_PATH/actuator/loggers/org.oransc.information -X POST -H Content-Type:application/json -d {\"configuredLevel\":\"trace\"}" + curlString="$ICS_SERVICE_PATH$ICS_ACTUATOR -X POST -H Content-Type:application/json -d {\"configuredLevel\":\"trace\"}" result=$(__do_curl "$curlString") if [ $? -ne 0 ]; then __print_err "Could not set trace mode" $@ @@ -2461,4 +2467,17 @@ ics_kube_pvc_reset() { __log_test_pass return 0 +} + +# args: +ics_configure_sec() { + export ICS_CREDS_GRANT_TYPE="client_credentials" + export ICS_CREDS_CLIENT_SECRET=$3 + export ICS_CREDS_CLIENT_ID=$2 + export ICS_AUTH_SERVICE_URL=$KEYCLOAK_SERVICE_PATH$KEYCLOAK_TOKEN_URL_PREFIX/$1/protocol/openid-connect/token + export ICS_SIDECAR_MOUNT="/token-cache" + export ICS_SIDECAR_JWT_FILE=$ICS_SIDECAR_MOUNT"/jwt.txt" + + export AUTHSIDECAR_APP_NAME + export AUTHSIDECAR_DISPLAY_NAME } \ No newline at end of file