X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fhttpproxy_api_functions.sh;h=ce7fcadaf01406a2f3cb9264e9e0641d1d2ca540;hb=0a882454d203e62e18f55ed1d3d5b3790801169b;hp=e80526418af7b1cea899010fd7a6c9ce2205b94a;hpb=2918bef3d237c99e6cf7e9c1ab1722781128617b;p=nonrtric.git diff --git a/test/common/httpproxy_api_functions.sh b/test/common/httpproxy_api_functions.sh index e8052641..ce7fcada 100644 --- a/test/common/httpproxy_api_functions.sh +++ b/test/common/httpproxy_api_functions.sh @@ -130,14 +130,14 @@ __HTTPPROXY_test_requirements() { # args: - # (Function for test scripts) use_http_proxy_http() { - __http_proxy_set_protocoll "http" $HTTP_PROXY_INTERNAL_PORT $HTTP_PROXY_EXTERNAL_PORT + __http_proxy_set_protocoll "http" $HTTP_PROXY_INTERNAL_PORT $HTTP_PROXY_EXTERNAL_PORT $HTTP_PROXY_WEB_INTERNAL_PORT $HTTP_PROXY_WEB_EXTERNAL_PORT } # Set https as the protocol to use for all communication to the http proxy # args: - # (Function for test scripts) use_http_proxy_https() { - __http_proxy_set_protocoll "https" $HTTP_PROXY_INTERNAL_SECURE_PORT $HTTP_PROXY_EXTERNAL_SECURE_PORT + __http_proxy_set_protocoll "https" $HTTP_PROXY_INTERNAL_SECURE_PORT $HTTP_PROXY_EXTERNAL_SECURE_PORT $HTTP_PROXY_WEB_INTERNAL_SECURE_PORT $HTTP_PROXY_WEB_EXTERNAL_SECURE_PORT } # Setup paths to svc/container for internal and external access @@ -150,12 +150,14 @@ __http_proxy_set_protocoll() { ## HTTP_PROXY_CONFIG_HOST_NAME and HTTP_PROXY_CONFIG_PORT used by apps as config for proxy host and port HTTP_PROXY_SERVICE_PATH=$1"://"$HTTP_PROXY_APP_NAME":"$2 # docker access, container->container and script->container via proxy + HTTP_PROXY_WEB_PATH=$1"://"$HTTP_PROXY_APP_NAME":"$4 HTTP_PROXY_CONFIG_HOST_NAME=$HTTP_PROXY_APP_NAME HTTP_PROXY_CONFIG_PORT=$2 if [ $RUNMODE == "KUBE" ]; then HTTP_PROXY_CONFIG_HOST_NAME=$HTTP_PROXY_APP_NAME"."$KUBE_SIM_NAMESPACE HTTP_PROXY_CONFIG_PORT=$3 HTTP_PROXY_SERVICE_PATH=$1"://"$HTTP_PROXY_APP_NAME.$KUBE_SIM_NAMESPACE":"$3 # kube access, pod->svc and script->svc via proxy + HTTP_PROXY_WEB_PATH=$1"://"$HTTP_PROXY_APP_NAME.$KUBE_SIM_NAMESPACE":"$5 fi echo "" @@ -237,7 +239,7 @@ start_http_proxy() { fi - __check_service_start $HTTP_PROXY_APP_NAME $HTTP_PROXY_SERVICE_PATH$HTTP_PROXY_ALIVE_URL + __check_service_start $HTTP_PROXY_APP_NAME $HTTP_PROXY_WEB_PATH$HTTP_PROXY_ALIVE_URL else # Check if docker app shall be fully managed by the test script @@ -252,7 +254,23 @@ start_http_proxy() { __start_container $HTTP_PROXY_COMPOSE_DIR "" NODOCKERARGS 1 $HTTP_PROXY_APP_NAME - __check_service_start $HTTP_PROXY_APP_NAME $HTTP_PROXY_SERVICE_PATH$HTTP_PROXY_ALIVE_URL + __check_service_start $HTTP_PROXY_APP_NAME $HTTP_PROXY_WEB_PATH$HTTP_PROXY_ALIVE_URL fi echo "" } + +# Turn on debug logging in httpproxy +# args: - +# (Function for test scripts) +set_httpproxy_debug() { + echo -e $BOLD"Setting httpproxy debug logging"$EBOLD + curlString="$HTTP_PROXY_WEB_PATH/debug -X PUT" + result=$(__do_curl "$curlString") + if [ $? -ne 0 ]; then + __print_err "could not set debug logging" $@ + ((RES_CONF_FAIL++)) + return 1 + fi + echo "" + return 0 +}