X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fprodstub_api_functions.sh;h=f30b87610e47dafb3ef1920e85fad9eece5c99fd;hb=6a39814272307d0207222c9229b0d765ac062bf0;hp=b41c79b1d28a50a5a91d7c1f596bc77b4c784a76;hpb=f38e1e8cb3652e73ea1e76b5a1a77a4aeb108577;p=nonrtric.git diff --git a/test/common/prodstub_api_functions.sh b/test/common/prodstub_api_functions.sh index b41c79b1..f30b8761 100644 --- a/test/common/prodstub_api_functions.sh +++ b/test/common/prodstub_api_functions.sh @@ -61,7 +61,7 @@ __execute_curl_to_prodstub() { # Prodstub API: Set (or reset) response code for producer supervision # [] # (Function for test scripts) -prodstub_arm_supervision() { +prodstub_arm_producer() { echo -e $BOLD"CONF(${BASH_LINENO[0]}): "${FUNCNAME[0]} $@ $EBOLD echo "CONF(${BASH_LINENO[0]}): "${FUNCNAME[0]} $@ >> $HTTPLOG if [ $# -ne 2 ] && [ $# -ne 3 ]; then @@ -86,7 +86,7 @@ prodstub_arm_supervision() { # Prodstub API: Set (or reset) response code job create # [] # (Function for test scripts) -prodstub_arm_create() { +prodstub_arm_job_create() { echo -e $BOLD"CONF(${BASH_LINENO[0]}): "${FUNCNAME[0]} $@ $EBOLD echo "CONF(${BASH_LINENO[0]}): "${FUNCNAME[0]} $@ >> $HTTPLOG if [ $# -ne 3 ] && [ $# -ne 4 ]; then @@ -111,7 +111,7 @@ prodstub_arm_create() { # Prodstub API: Set (or reset) response code job delete # [] # (Function for test scripts) -prodstub_arm_delete() { +prodstub_arm_job_delete() { echo -e $BOLD"CONF(${BASH_LINENO[0]}): "${FUNCNAME[0]} $@ $EBOLD echo "CONF(${BASH_LINENO[0]}): "${FUNCNAME[0]} $@ >> $HTTPLOG if [ $# -ne 3 ] && [ $# -ne 4 ]; then @@ -207,4 +207,20 @@ prodstub_check_jobdata() { ((RES_FAIL++)) fi return $retcode +} + +# Tests if a variable value in the prod stub is equal to a target value and and optional timeout. +# Arg: - This test set pass or fail depending on if the variable is +# equal to the target or not. +# Arg: - This test waits up to the timeout seconds +# before setting pass or fail depending on if the variable value becomes equal to the target +# value or not. +# (Function for test scripts) +prodstub_equal() { + if [ $# -eq 2 ] || [ $# -eq 3 ]; then + __var_test "PRODSTUB" "$LOCALHOST$PROD_STUB_EXTERNAL_PORT/counter/" $1 "=" $2 $3 + else + ((RES_CONF_FAIL++)) + __print_err "Wrong args to prodstub_equal, needs two or three args: [ timeout ]" $@ + fi } \ No newline at end of file