X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fdmaapmed_api_functions.sh;h=4c34ad6dcf9efbf8e376aeb46dc56c0de4af1683;hb=b188e12cc1b4be627ae6f8f424f06c38ffb89804;hp=5188a454a9bf2386aef04a7b02d85bf2a1657d0a;hpb=09e21f39a3ffcfc2063110bcad028014b0056398;p=nonrtric.git diff --git a/test/common/dmaapmed_api_functions.sh b/test/common/dmaapmed_api_functions.sh index 5188a454..4c34ad6d 100644 --- a/test/common/dmaapmed_api_functions.sh +++ b/test/common/dmaapmed_api_functions.sh @@ -17,7 +17,7 @@ # ============LICENSE_END================================================= # -# This is a script that contains container/service managemnt functions test functions for the Dmaap Adatper +# This is a script that contains container/service management functions test functions for the Dmaap Mediator ################ Test engine functions ################ @@ -26,7 +26,7 @@ # arg: (selects staging, snapshot, release etc) # is present only for images with staging, snapshot,release tags __DMAAPMED_imagesetup() { - __check_and_create_image_var DMAAPMED "DMAAP_MED_IMAGE" "DMAAP_MED_IMAGE_BASE" "DMAAP_MED_IMAGE_TAG" $1 "$DMAAP_MED_DISPLAY_NAME" + __check_and_create_image_var DMAAPMED "DMAAP_MED_IMAGE" "DMAAP_MED_IMAGE_BASE" "DMAAP_MED_IMAGE_TAG" $1 "$DMAAP_MED_DISPLAY_NAME" "" } # Pull image from remote repo or use locally built image @@ -63,12 +63,12 @@ __DMAAPMED_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. __DMAAPMED_kube_scale_zero_and_wait() { __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app "$KUBE_NONRTRIC_NAMESPACE"-dmaapmediatorservice } -# 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. __DMAAPMED_kube_delete_all() { __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest DMAAPMED @@ -76,10 +76,10 @@ __DMAAPMED_kube_delete_all() { # Store docker logs # This function is called for apps managed by the test script. -# args: +# args: __DMAAPMED_store_docker_logs() { if [ $RUNMODE == "KUBE" ]; then - kubectl logs -l "autotest=DMAAPMED" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_dmaapmediator.log 2>&1 + kubectl $KUBECONF logs -l "autotest=DMAAPMED" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_dmaapmediator.log 2>&1 else docker logs $DMAAP_MED_APP_NAME > $1$2_dmaapmediator.log 2>&1 fi @@ -92,11 +92,11 @@ __DMAAPMED_initial_setup() { use_dmaapmed_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: - -__DMAAPMED_statisics_setup() { +__DMAAPMED_statistics_setup() { if [ $RUNMODE == "KUBE" ]; then echo "DMAAPMED $DMAAP_MED_APP_NAME $KUBE_NONRTRIC_NAMESPACE" else @@ -104,6 +104,12 @@ __DMAAPMED_statisics_setup() { fi } +# Check application requirements, e.g. helm, the the test needs. Exit 1 if req not satisfied +# args: - +__DMAAPMED_test_requirements() { + : +} + ####################################################### # Set http as the protocol to use for all communication to the Dmaap mediator @@ -124,7 +130,7 @@ use_dmaapmed_https() { # args: __dmaapmed_set_protocoll() { echo -e $BOLD"$DMAAP_MED_DISPLAY_NAME protocol setting"$EBOLD - echo -e " Using $BOLD http $EBOLD towards $DMAAP_MED_DISPLAY_NAME" + echo -e " Using $BOLD $1 $EBOLD towards $DMAAP_MED_DISPLAY_NAME" ## Access to Dmaap mediator @@ -159,7 +165,7 @@ __dmaapmed_export_vars() { export DMAAP_MED_DATA_MOUNT_PATH export DMAAP_MED_HOST_MNT_DIR - export DMAAP_MED_DATA_FILE + export DMAAP_MED_CONTR_DATA_FILE export DMAAP_MED_DATA_CONFIGMAP_NAME=$DMAAP_MED_APP_NAME"-data" if [ $1 == "PROXY" ]; then @@ -177,11 +183,13 @@ __dmaapmed_export_vars() { fi # paths to other components - export ECS_SERVICE_PATH + export ICS_SERVICE_PATH export DMAAP_MED_CONF_SELF_HOST=$(echo $DMAAP_MED_SERVICE_PATH | cut -d: -f1-2) export DMAAP_MED_CONF_SELF_PORT=$(echo $DMAAP_MED_SERVICE_PATH | cut -d: -f3) export MR_SERVICE_PATH + export MR_KAFKA_SERVICE_PATH + } # Start the Dmaap mediator @@ -197,7 +205,7 @@ start_dmaapmed() { __check_included_image "DMAAPMED" 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 "DMAAPMED" retcode_p=$? @@ -227,7 +235,7 @@ start_dmaapmed() { __dmaapmed_export_vars $1 # Create config map for data - data_json=$PWD/tmp/$DMAAP_MED_DATA_FILE + data_json=$PWD/tmp/$DMAAP_MED_CONTR_DATA_FILE if [ $# -lt 2 ]; then #create empty dummy file echo "{}" > $data_json @@ -262,7 +270,7 @@ start_dmaapmed() { __dmaapmed_export_vars $1 - dest_file=$SIM_GROUP/$DMAAP_MED_COMPOSE_DIR/$DMAAP_MED_HOST_MNT_DIR/$DMAAP_MED_DATA_FILE + dest_file=$SIM_GROUP/$DMAAP_MED_COMPOSE_DIR/$DMAAP_MED_HOST_MNT_DIR/$DMAAP_MED_CONTR_DATA_FILE envsubst < $2 > $dest_file