X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fics_api_functions.sh;h=0df2ae41ab0a08bd2afab52519a66f4dd80da8c2;hb=d2aeca8843fe3ffca2e73dec5b64daeef0dda938;hp=ea4036dad3cc3b2cb6758efbcb5e0bb1b9fcbfe3;hpb=007b64509101d8e3ef881955adee2ad15d062213;p=nonrtric.git diff --git a/test/common/ics_api_functions.sh b/test/common/ics_api_functions.sh index ea4036da..0df2ae41 100644 --- a/test/common/ics_api_functions.sh +++ b/test/common/ics_api_functions.sh @@ -78,7 +78,7 @@ __ICS_kube_delete_all() { # args: __ICS_store_docker_logs() { if [ $RUNMODE == "KUBE" ]; then - kubectl logs -l "autotest=ICS" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_ics.log 2>&1 + kubectl $KUBECONF logs -l "autotest=ICS" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_ics.log 2>&1 else docker logs $ICS_APP_NAME > $1$2_ics.log 2>&1 fi @@ -103,6 +103,12 @@ __ICS_statisics_setup() { fi } +# Check application requirements, e.g. helm, the the test needs. Exit 1 if req not satisfied +# args: - +__ICS_test_requirements() { + : +} + ####################################################### @@ -180,12 +186,13 @@ __ics_export_vars() { export ICS_CONFIG_FILE export DOCKER_SIM_NWNAME export ICS_DISPLAY_NAME - + export ICS_LOGPATH export ICS_DATA_PV_NAME=$ICS_APP_NAME"-pv" export ICS_DATA_PVC_NAME=$ICS_APP_NAME"-pvc" #Create a unique path for the pv each time to prevent a previous volume to be reused export ICS_PV_PATH="icsdata-"$(date +%s) + export HOST_PATH_BASE_DIR if [ $1 == "PROXY" ]; then export ICS_HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_CONFIG_PORT #Set if proxy is started @@ -231,7 +238,6 @@ start_ics() { exit fi - if [ $retcode_p -eq 0 ]; then echo -e " Using existing $ICS_APP_NAME deployment and service" echo " Setting ICS replicas=1" @@ -280,7 +286,7 @@ start_ics() { # Keep the initial worker node in case the pod need to be "restarted" - must be made to the same node due to a volume mounted on the host if [ $retcode_i -eq 0 ]; then - __ICS_WORKER_NODE=$(kubectl get pod -l "autotest=ICS" -n $KUBE_NONRTRIC_NAMESPACE -o jsonpath='{.items[*].spec.nodeName}') + __ICS_WORKER_NODE=$(kubectl $KUBECONF get pod -l "autotest=ICS" -n $KUBE_NONRTRIC_NAMESPACE -o jsonpath='{.items[*].spec.nodeName}') if [ -z "$__ICS_WORKER_NODE" ]; then echo -e $YELLOW" Cannot find worker node for pod for $ICS_APP_NAME, persistency may not work"$EYELLOW fi @@ -352,7 +358,7 @@ stop_ics() { __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest ICS echo " Deleting the replica set - a new will be started when the app is started" - tmp=$(kubectl delete rs -n $KUBE_NONRTRIC_NAMESPACE -l "autotest=ICS") + tmp=$(kubectl $KUBECONF delete rs -n $KUBE_NONRTRIC_NAMESPACE -l "autotest=ICS") if [ $? -ne 0 ]; then echo -e $RED" Could not delete replica set "$RED ((RES_CONF_FAIL++)) @@ -389,16 +395,16 @@ start_stopped_ics() { return 0 fi - # Tie the PMS to the same worker node it was initially started on - # A PVC of type hostPath is mounted to PMS, for persistent storage, so the PMS must always be on the node which mounted the volume + # Tie the ICS to the same worker node it was initially started on + # A PVC of type hostPath is mounted to A1PMS, for persistent storage, so the A1PMS must always be on the node which mounted the volume if [ -z "$__ICS_WORKER_NODE" ]; then echo -e $RED" No initial worker node found for pod "$RED ((RES_CONF_FAIL++)) return 1 else - echo -e $BOLD" Setting nodeSelector kubernetes.io/hostname=$__ICS_WORKER_NODE to deployment for $ICS_APP_NAME. Pod will always run on this worker node: $__PA_WORKER_NODE"$BOLD + echo -e $BOLD" Setting nodeSelector kubernetes.io/hostname=$__ICS_WORKER_NODE to deployment for $ICS_APP_NAME. Pod will always run on this worker node: $__ICS_WORKER_NODE"$BOLD echo -e $BOLD" The mounted volume is mounted as hostPath and only available on that worker node."$BOLD - tmp=$(kubectl patch deployment $ICS_APP_NAME -n $KUBE_NONRTRIC_NAMESPACE --patch '{"spec": {"template": {"spec": {"nodeSelector": {"kubernetes.io/hostname": "'$__ICS_WORKER_NODE'"}}}}}') + tmp=$(kubectl $KUBECONF patch deployment $ICS_APP_NAME -n $KUBE_NONRTRIC_NAMESPACE --patch '{"spec": {"template": {"spec": {"nodeSelector": {"kubernetes.io/hostname": "'$__ICS_WORKER_NODE'"}}}}}') if [ $? -ne 0 ]; then echo -e $YELLOW" Cannot set nodeSelector to deployment for $ICS_APP_NAME, persistency may not work"$EYELLOW fi @@ -1099,7 +1105,8 @@ ics_api_edp_get_producer_ids_2() { if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then query="/data-producer/v1/info-producers" if [ $# -gt 1 ] && [ $2 != "NOTYPE" ]; then - query=$query"?info_type_id=$2" + query=$query"?info_type_id=$2&infoTypeId=$2" #info_type_id changed to infoTypeId in F-release. + #Remove info_type_id when F-release is no longer supported fi else query="/ei-producer/v1/eiproducers" @@ -2444,7 +2451,7 @@ ics_api_admin_reset() { ics_kube_pvc_reset() { __log_test_start $@ - pvc_name=$(kubectl get pvc -n $KUBE_NONRTRIC_NAMESPACE --no-headers -o custom-columns=":metadata.name" | grep information) + pvc_name=$(kubectl $KUBECONF get pvc -n $KUBE_NONRTRIC_NAMESPACE --no-headers -o custom-columns=":metadata.name" | grep information) if [ -z "$pvc_name" ]; then pvc_name=informationservice-pvc fi