X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fcr_api_functions.sh;h=40ef7ea79be9b8aa1caebf5f5e59b955d197850d;hb=1b732d17463fad74721391b3a87a2a12172da63c;hp=a9acd6e5d12f61e6e71f74342b886cb0687fbb68;hpb=79e37003f5c94bfe12d197727dd31334e50397a6;p=nonrtric.git diff --git a/test/common/cr_api_functions.sh b/test/common/cr_api_functions.sh index a9acd6e5..40ef7ea7 100644 --- a/test/common/cr_api_functions.sh +++ b/test/common/cr_api_functions.sh @@ -122,11 +122,21 @@ __CR_statisics_setup() { CR_INSTANCE_KUBE=$(($CR_INSTANCE-1)) echo -n " CR-$CR_INSTANCE_KUBE $CR_APP_NAME-$CR_INSTANCE_KUBE $KUBE_SIM_NAMESPACE " else - echo -n " CR_$CR_INSTANCE ${CR_APP_NAME}_cr_$CR_INSTANCE " + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + echo -n " CR_$CR_INSTANCE ${CR_APP_NAME}_cr_$CR_INSTANCE " + else + echo -n " CR_$CR_INSTANCE ${CR_APP_NAME}-cr-$CR_INSTANCE " + fi fi done } +# Check application requirements, e.g. helm, the the test needs. Exit 1 if req not satisfied +# args: - +__CR_test_requirements() { + : +} + ####################################################### ################ @@ -156,12 +166,16 @@ use_cr_https() { __cr_set_protocoll() { echo -e $BOLD"$CR_DISPLAY_NAME protocol setting"$EBOLD - echo -e " Using $BOLD http $EBOLD towards $CR_DISPLAY_NAME" + echo -e " Using $BOLD $1 $EBOLD towards $CR_DISPLAY_NAME" ## Access to Dmaap adapter for ((CR_INSTANCE=0; CR_INSTANCE<$MAX_CR_APP_COUNT; CR_INSTANCE++ )); do CR_DOCKER_INSTANCE=$(($CR_INSTANCE+1)) # CR_SERVICE_PATH is the base path to cr - __CR_SERVICE_PATH=$1"://"$CR_APP_NAME"_cr_"${CR_DOCKER_INSTANCE}":"$2 # docker access, container->container and script->container via proxy + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + __CR_SERVICE_PATH=$1"://"$CR_APP_NAME"_cr_"${CR_DOCKER_INSTANCE}":"$2 # docker access, container->container and script->container via proxy + else + __CR_SERVICE_PATH=$1"://"$CR_APP_NAME"-cr-"${CR_DOCKER_INSTANCE}":"$2 # docker access, container->container and script->container via proxy + fi if [ $RUNMODE == "KUBE" ]; then __CR_SERVICE_PATH=$1"://"$CR_APP_NAME"-"$CR_INSTANCE.$CR_APP_NAME"."$KUBE_SIM_NAMESPACE":"$3 # kube access, pod->svc and script->svc via proxy fi @@ -285,7 +299,11 @@ start_cr() { app_data="" cntr=1 while [ $cntr -le $CR_APP_COUNT ]; do - app=$CR_APP_NAME"_cr_"$cntr + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + app=$CR_APP_NAME"_cr_"$cntr + else + app=$CR_APP_NAME"-cr-"$cntr + fi app_data="$app_data $app" let cntr=cntr+1 done @@ -297,7 +315,11 @@ start_cr() { cntr=1 #Counter for docker instance, starts on 1 cntr2=0 #Couter for env var name, starts with 0 to be compablible with kube while [ $cntr -le $CR_APP_COUNT ]; do - app=$CR_APP_NAME"_cr_"$cntr + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + app=$CR_APP_NAME"_cr_"$cntr + else + app=$CR_APP_NAME"-cr-"$cntr + fi __dynvar="CR_SERVICE_PATH_"$cntr2 __check_service_start $app ${!__dynvar}$CR_ALIVE_URL let cntr=cntr+1 @@ -473,10 +495,10 @@ cr_api_check_all_sync_events() { return 0 } -# CR API: Check the contents of all current status events for one id from ECS +# CR API: Check the contents of all current status events for one id from ICS # [ EMPTY | ( )+ ] # (Function for test scripts) -cr_api_check_all_ecs_events() { +cr_api_check_all_ics_events() { __log_test_start $@ if [ $# -lt 3 ]; then @@ -530,10 +552,10 @@ cr_api_check_all_ecs_events() { return 0 } -# CR API: Check the contents of all current type subscription events for one id from ECS +# CR API: Check the contents of all current type subscription events for one id from ICS # [ EMPTY | ( )+ ] # (Function for test scripts) -cr_api_check_all_ecs_subscription_events() { +cr_api_check_all_ics_subscription_events() { __log_test_start $@ #Valid number of parameter 3,4,8,12 @@ -609,7 +631,7 @@ cr_api_check_all_ecs_subscription_events() { cr_api_reset() { __log_conf_start $@ - if [ $# -ne 0 ]; then + if [ $# -ne 1 ]; then __print_err "" $@ return 1 fi