X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fa1pms_api_functions.sh;h=8a903b8ff5676541e43b8045327a37b9aae6454b;hb=refs%2Fchanges%2F62%2F8262%2F1;hp=f5397171c5a6264bc0c9638f17987a28b052169d;hpb=d2aeca8843fe3ffca2e73dec5b64daeef0dda938;p=nonrtric.git diff --git a/test/common/a1pms_api_functions.sh b/test/common/a1pms_api_functions.sh index f5397171..8a903b8f 100644 --- a/test/common/a1pms_api_functions.sh +++ b/test/common/a1pms_api_functions.sh @@ -89,6 +89,7 @@ __A1PMS_store_docker_logs() { # args: - __A1PMS_initial_setup() { use_a1pms_rest_http + export A1PMS_SIDECAR_JWT_FILE="" } # Set app short-name, app name and namespace for logging runtime statistics of kubernets pods or docker containers @@ -306,6 +307,10 @@ start_a1pms() { # Create app input_yaml=$SIM_GROUP"/"$A1PMS_COMPOSE_DIR"/"app.yaml output_yaml=$PWD/tmp/a1pmsapp.yaml + if [ -z "$A1PMS_SIDECAR_JWT_FILE" ]; then + cat $input_yaml | sed '/#A1PMS_JWT_START/,/#A1PMS_JWT_STOP/d' > $PWD/tmp/a1pmsapp_tmp.yaml + input_yaml=$PWD/tmp/a1pmsapp_tmp.yaml + fi __kube_create_instance app $A1PMS_APP_NAME $input_yaml $output_yaml fi @@ -346,6 +351,7 @@ start_a1pms() { fi else echo " No files in mounted dir or dir does not exists" + mkdir db fi cd $curdir @@ -542,7 +548,7 @@ prepare_consul_config() { ric_id=${ric%.*.*} #extract pod id from full hosthame ric_id=$(echo "$ric_id" | tr '-' '_') else - if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + if [ $DOCKER_COMPOSE_VERSION == "V1" ]; then ric_id=$ric else ric_id=$(echo "$ric" | tr '-' '_') #ric id still needs underscore as it is different from the container name @@ -2380,4 +2386,17 @@ a1pms_kube_pvc_reset() { __log_test_pass return 0 +} + +# args: +a1pms_configure_sec() { + export A1PMS_CREDS_GRANT_TYPE="client_credentials" + export A1PMS_CREDS_CLIENT_SECRET=$3 + export A1PMS_CREDS_CLIENT_ID=$2 + export A1PMS_AUTH_SERVICE_URL=$KEYCLOAK_SERVICE_PATH$KEYCLOAK_TOKEN_URL_PREFIX/$1/protocol/openid-connect/token + export A1PMS_SIDECAR_MOUNT="/token-cache" + export A1PMS_SIDECAR_JWT_FILE=$A1PMS_SIDECAR_MOUNT"/jwt.txt" + + export AUTHSIDECAR_APP_NAME + export AUTHSIDECAR_DISPLAY_NAME } \ No newline at end of file