X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fistio_api_functions.sh;h=e0fee9bc41e6aa92bf03724b9b8583419552907f;hb=refs%2Fchanges%2F10%2F11110%2F1;hp=2afc3f9c89c240d16488d1cd66d1c71c26316d33;hpb=844931b62f35ce6ee2d9dc7274573fc54e14407a;p=nonrtric.git diff --git a/test/common/istio_api_functions.sh b/test/common/istio_api_functions.sh index 2afc3f9c..e0fee9bc 100644 --- a/test/common/istio_api_functions.sh +++ b/test/common/istio_api_functions.sh @@ -17,7 +17,7 @@ # ============LICENSE_END================================================= # -# This is a script that contains function to handle helm on localhost +# This is a script that contain functions to handle istio configuration ################ Test engine functions ################ @@ -60,20 +60,25 @@ __ISTIO_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. __ISTIO_kube_scale_zero_and_wait() { : } -# 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. __ISTIO_kube_delete_all() { __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest ISTIO + __kube_delete_all_resources $KUBE_A1SIM_NAMESPACE autotest ISTIO + __kube_delete_all_resources $KUBE_ONAP_NAMESPACE autotest ISTIO + __kube_delete_all_resources $KUBE_KEYCLOAK_NAMESPACE autotest ISTIO + __kube_delete_all_resources $KUBE_SDNC_NAMESPACE autotest ISTIO + __kube_delete_all_resources $KUBE_SIM_NAMESPACE autotest ISTIO } # Store docker logs # This function is called for apps managed by the test script. -# args: +# args: __ISTIO_store_docker_logs() { : } @@ -87,11 +92,11 @@ __ISTIO_initial_setup() { KUBE_PROXY_ISTIO_JWKS_KEYS=$ISTIO_GENERIC_JWKS_KEY } -# 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: - -__ISTIO_statisics_setup() { +__ISTIO_statistics_setup() { : } @@ -189,11 +194,11 @@ istio_req_auth_by_jwks() { } # Authorization policy - by realm -# args: +# args: [ ] istio_auth_policy_by_realm() { __log_conf_start $@ - if [ $# -ne 3 ]; then - __print_err " " $@ + if [ $# -ne 3 ] && [ $# -ne 5 ]; then + __print_err " [ ]" $@ return 1 fi name="ap-realm-"$3"-"$1"-"$2 @@ -208,6 +213,17 @@ istio_auth_policy_by_realm() { __log_conf_fail_general "Cannot substitute yaml: $inputfile" return 1 fi + if [ $# -gt 3 ]; then + export ISTIO_TEMPLATE_REPLACE_AP_CLIENT=$4 + export ISTIO_TEMPLATE_REPLACE_AP_ROLE=$5 + inputfile=$SIM_GROUP/$ISTIO_COMPOSE_DIR/ap-role-snippet.yaml + envsubst < $inputfile >> $outputfile + if [ $? -ne 0 ]; then + __log_conf_fail_general "Cannot substitute yaml: $inputfile" + return 1 + fi + fi + kubectl $KUBECONF apply -f $outputfile &> tmp/kubeerr if [ $? -ne 0 ]; then __log_conf_fail_general "Cannot apply yaml: $outputfile"