X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fdmaapadp_api_functions.sh;h=7f4046e60a40ee5b4c9576ec714d89499a24489e;hb=9ddce2b0e23655371aa311c94ce9605dcc74f74e;hp=26da2d08aa0568c083083d808c5de4079c12c6cc;hpb=663566c28930429775ea9921f0e32ddf5253da28;p=nonrtric.git diff --git a/test/common/dmaapadp_api_functions.sh b/test/common/dmaapadp_api_functions.sh index 26da2d08..7f4046e6 100644 --- a/test/common/dmaapadp_api_functions.sh +++ b/test/common/dmaapadp_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 Adapter ################ Test engine functions ################ @@ -26,7 +26,7 @@ # arg: (selects staging, snapshot, release etc) # is present only for images with staging, snapshot,release tags __DMAAPADP_imagesetup() { - __check_and_create_image_var DMAAPADP "DMAAP_ADP_IMAGE" "DMAAP_ADP_IMAGE_BASE" "DMAAP_ADP_IMAGE_TAG" $1 "$DMAAP_ADP_DISPLAY_NAME" + __check_and_create_image_var DMAAPADP "DMAAP_ADP_IMAGE" "DMAAP_ADP_IMAGE_BASE" "DMAAP_ADP_IMAGE_TAG" $1 "$DMAAP_ADP_DISPLAY_NAME" "" } # Pull image from remote repo or use locally built image @@ -63,12 +63,12 @@ __DMAAPADP_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. __DMAAPADP_kube_scale_zero_and_wait() { __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app "$KUBE_NONRTRIC_NAMESPACE"-dmaapadapterservice } -# 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. __DMAAPADP_kube_delete_all() { __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest DMAAPADP @@ -76,10 +76,10 @@ __DMAAPADP_kube_delete_all() { # Store docker logs # This function is called for apps managed by the test script. -# args: +# args: __DMAAPADP_store_docker_logs() { if [ $RUNMODE == "KUBE" ]; then - kubectl logs -l "autotest=DMAAPADP" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_dmaapadapter.log 2>&1 + kubectl $KUBECONF logs -l "autotest=DMAAPADP" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_dmaapadapter.log 2>&1 else docker logs $DMAAP_ADP_APP_NAME > $1$2_dmaapadapter.log 2>&1 fi @@ -92,6 +92,24 @@ __DMAAPADP_initial_setup() { use_dmaapadp_http } +# 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 pre-started apps. +# args: - +__DMAAPADP_statistics_setup() { + if [ $RUNMODE == "KUBE" ]; then + echo "DMAAPADP $DMAAP_ADP_APP_NAME $KUBE_NONRTRIC_NAMESPACE" + else + echo "DMAAPADP $DMAAP_ADP_APP_NAME" + fi +} + +# Check application requirements, e.g. helm, the the test needs. Exit 1 if req not satisfied +# args: - +__DMAAPADP_test_requirements() { + : +} + ####################################################### # Set http as the protocol to use for all communication to the Dmaap adapter @@ -112,7 +130,7 @@ use_dmaapadp_https() { # args: __dmaapadp_set_protocoll() { echo -e $BOLD"$DMAAP_ADP_DISPLAY_NAME protocol setting"$EBOLD - echo -e " Using $BOLD http $EBOLD towards $DMAAP_ADP_DISPLAY_NAME" + echo -e " Using $BOLD $1 $EBOLD towards $DMAAP_ADP_DISPLAY_NAME" ## Access to Dmaap adapter @@ -173,7 +191,7 @@ __dmaapadp_export_vars() { # paths to other components - export ECS_SERVICE_PATH + export ICS_SERVICE_PATH export DMAAP_ADP_SERVICE_PATH export MR_SERVICE_PATH @@ -192,7 +210,7 @@ start_dmaapadp() { __check_included_image "DMAAPADP" 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 "DMAAPADP" retcode_p=$?