X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fngw_api_functions.sh;h=6c2ba33b18e519d1fb8021391a62e725edf6abcc;hb=2f3e40b4e4786b84cb70848fcdcfadd040ffda4a;hp=9e29278c7dbb039921ee2802eb898b68f1587242;hpb=007b64509101d8e3ef881955adee2ad15d062213;p=nonrtric.git diff --git a/test/common/ngw_api_functions.sh b/test/common/ngw_api_functions.sh index 9e29278c..6c2ba33b 100644 --- a/test/common/ngw_api_functions.sh +++ b/test/common/ngw_api_functions.sh @@ -26,7 +26,7 @@ # arg: (selects staging, snapshot, release etc) # is present only for images with staging, snapshot,release tags __NGW_imagesetup() { - __check_and_create_image_var NGW "NRT_GATEWAY_IMAGE" "NRT_GATEWAY_IMAGE_BASE" "NRT_GATEWAY_IMAGE_TAG" $1 "$NRT_GATEWAY_DISPLAY_NAME" + __check_and_create_image_var NGW "NRT_GATEWAY_IMAGE" "NRT_GATEWAY_IMAGE_BASE" "NRT_GATEWAY_IMAGE_TAG" $1 "$NRT_GATEWAY_DISPLAY_NAME" "" } # Pull image from remote repo or use locally built image @@ -63,12 +63,12 @@ __NGW_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. __NGW_kube_scale_zero_and_wait() { echo -e " NGW replicas kept as is" } -# 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. __NGW_kube_delete_all() { __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest NGW @@ -76,10 +76,10 @@ __NGW_kube_delete_all() { # Store docker logs # This function is called for apps managed by the test script. -# args: +# args: __NGW_store_docker_logs() { if [ $RUNMODE == "KUBE" ]; then - kubectl logs -l "autotest=NGW" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_gateway.log 2>&1 + kubectl $KUBECONF logs -l "autotest=NGW" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_gateway.log 2>&1 else docker logs $NRT_GATEWAY_APP_NAME > $1$2_gateway.log 2>&1 fi @@ -92,11 +92,11 @@ __NGW_initial_setup() { use_gateway_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: - -__NGW_statisics_setup() { +__NGW_statistics_setup() { if [ $RUNMODE == "KUBE" ]; then echo "NGW $NRT_GATEWAY_APP_NAME $KUBE_NONRTRIC_NAMESPACE" else @@ -104,6 +104,12 @@ __NGW_statisics_setup() { fi } +# Check application requirements, e.g. helm, the the test needs. Exit 1 if req not satisfied +# args: - +__NGW_test_requirements() { + : +} + ####################################################### @@ -198,12 +204,12 @@ __gateway_export_vars() { export NRT_GATEWAY_COMPOSE_DIR if [ $RUNMODE == "KUBE" ]; then - export POLICY_AGENT_EXTERNAL_SECURE_PORT + export A1PMS_EXTERNAL_SECURE_PORT export ICS_EXTERNAL_SECURE_PORT - export POLICY_AGENT_DOMAIN_NAME=$POLICY_AGENT_APP_NAME.$KUBE_NONRTRIC_NAMESPACE + export A1PMS_DOMAIN_NAME=$A1PMS_APP_NAME.$KUBE_NONRTRIC_NAMESPACE export ICS_DOMAIN_NAME=$ICS_APP_NAME.$KUBE_NONRTRIC_NAMESPACE else - export POLICY_AGENT_DOMAIN_NAME=$POLICY_AGENT_APP_NAME + export A1PMS_DOMAIN_NAME=$A1PMS_APP_NAME export ICS_DOMAIN_NAME=$ICS_APP_NAME fi } @@ -221,7 +227,7 @@ start_gateway() { __check_included_image "NGW" 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 "NGW" retcode_p=$? @@ -297,16 +303,16 @@ start_gateway() { } -# API Test function: V2 GET /status towards PMS +# API Test function: V2 GET /status towards A1PMS # args: # (Function for test scripts) -gateway_pms_get_status() { +gateway_a1pms_get_status() { __log_test_start $@ if [ $# -ne 1 ]; then __print_err "" $@ return 1 fi - query=$PMS_API_PREFIX"/v2/status" + query=$A1PMS_API_PREFIX"/v2/status" res="$(__do_curl_to_api NGW GET $query)" status=${res:${#res}-3}