X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fcontroller_api_functions.sh;h=d703d838560c9b8f4c031aa05cbda1fd4a08c827;hb=d289079b1b15286e994bc29b98cd732fc32fb06f;hp=7bca91c60b4a35bcd039757781d9f6dfe3db2e17;hpb=483ee33ac3de88385c0eeb3f1ecf3a1bb760db54;p=nonrtric.git diff --git a/test/common/controller_api_functions.sh b/test/common/controller_api_functions.sh index 7bca91c6..d703d838 100644 --- a/test/common/controller_api_functions.sh +++ b/test/common/controller_api_functions.sh @@ -272,6 +272,57 @@ start_sdnc() { return 0 } + +# Stop the sndc +# args: - +# args: - +# (Function for test scripts) +stop_sdnc() { + echo -e $BOLD"Stopping $SDNC_DISPLAY_NAME"$EBOLD + + if [ $RUNMODE == "KUBE" ]; then + __log_conf_fail_not_supported " Cannot stop sndc in KUBE mode" + return 1 + else + docker stop $SDNC_APP_NAME &> ./tmp/.dockererr + if [ $? -ne 0 ]; then + __print_err "Could not stop $SDNC_APP_NAME" $@ + cat ./tmp/.dockererr + ((RES_CONF_FAIL++)) + return 1 + fi + fi + echo -e $BOLD$GREEN"Stopped"$EGREEN$EBOLD + echo "" + return 0 +} + +# Start a previously stopped sdnc +# args: - +# (Function for test scripts) +start_stopped_sdnc() { + echo -e $BOLD"Starting (the previously stopped) $SDNC_DISPLAY_NAME"$EBOLD + + if [ $RUNMODE == "KUBE" ]; then + __log_conf_fail_not_supported " Cannot restart sndc in KUBE mode" + return 1 + else + docker start $SDNC_APP_NAME &> ./tmp/.dockererr + if [ $? -ne 0 ]; then + __print_err "Could not start (the stopped) $SDNC_APP_NAME" $@ + cat ./tmp/.dockererr + ((RES_CONF_FAIL++)) + return 1 + fi + fi + __check_service_start $SDNC_APP_NAME $SDNC_PATH$SDNC_ALIVE_URL + if [ $? -ne 0 ]; then + return 1 + fi + echo "" + return 0 +} + # Check the agent logs for WARNINGs and ERRORs # args: - # (Function for test scripts) @@ -307,7 +358,11 @@ __do_curl_to_controller() { proxyflag="" if [ $RUNMODE == "KUBE" ]; then if [ ! -z "$KUBE_PROXY_PATH" ]; then - proxyflag=" --proxy KUBE_PROXY_PATH" + if [ $KUBE_PROXY_HTTPX == "http" ]; then + proxyflag=" --proxy $KUBE_PROXY_PATH" + else + proxyflag=" --proxy-insecure --proxy $KUBE_PROXY_PATH" + fi fi fi curlString="curl -skw %{http_code} $proxyflag -X POST $SDNC_API_PATH$1 -H accept:application/json -H Content-Type:application/json --data-binary @$payload"