Functional Test Updates for I Release
[nonrtric.git] / test / common / a1pms_api_functions.sh
index a114134..e065034 100644 (file)
@@ -543,19 +543,16 @@ prepare_a1pms_config() {
                        echo $YELLOW"Warning: No rics found for the configuration"$EYELLOW
                fi
        else
-               rics=$(docker ps --filter "name=$RIC_SIM_PREFIX" --filter "network=$DOCKER_SIM_NWNAME" --filter "label=a1sim" --filter "status=running" --format {{.Names}})
-               if [ $? -ne 0 ] || [ -z "$rics" ]; then
-                       echo -e $RED" FAIL - the names of the running RIC Simulator cannot be retrieved." $ERED
-                       ((RES_CONF_FAIL++))
-                       return 1
-               fi
+           rics=$(docker ps --filter "name=$RIC_SIM_PREFIX" --filter "network=$DOCKER_SIM_NWNAME" --filter "label=a1sim" --filter "status=running" --format {{.Names}})
                oranrics=$(docker ps --filter "name=$RIC_SIM_PREFIX" --filter "network=$DOCKER_SIM_NWNAME" --filter "label=orana1sim" --filter "status=running" --format {{.Names}})
+
+               rics="$rics $oranrics"
+
                if [ $? -ne 0 ] || [ -z "$rics" ]; then
-                       echo -e $RED" FAIL - the names of the running RIC Simulator cannot be retrieved." $ERED
+                       echo -e $RED" FAIL - the names of the running RIC Simulator or ORAN RIC cannot be retrieved." $ERED
                        ((RES_CONF_FAIL++))
-                       return 1
+                       exit 1
                fi
-               rics="$rics $oranrics"
        fi
        cntr=0
        for ric in $rics; do
@@ -567,13 +564,9 @@ prepare_a1pms_config() {
                        ric_id=${ric%.*.*} #extract pod id from full hosthame
                        ric_id=$(echo "$ric_id" | tr '-' '_')
                else
-                       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
-                       fi
+                       ric_id=$(echo "$ric" | tr '-' '_')  #ric var still needs underscore as it is different from the container name
                fi
-               echo " Found a1 sim: "$ric_id
+               echo " Found a1 sim: "$ric 
                config_json=$config_json"\n            \"name\": \"$ric_id\","
 
                xricfound=0