X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fagent_api_functions.sh;h=80b49d1ee7dd64f5e42c41671faf88af2cb17ebc;hb=c963b73942867f631f9e5708e28025140afcb893;hp=1cd430eb5ea176e0299b0b685cae8ec26e574099;hpb=28ea034c54771d3680743f3885c97d6bc9eb7f7b;p=nonrtric.git diff --git a/test/common/agent_api_functions.sh b/test/common/agent_api_functions.sh index 1cd430eb..80b49d1e 100644 --- a/test/common/agent_api_functions.sh +++ b/test/common/agent_api_functions.sh @@ -88,7 +88,8 @@ use_agent_dmaap_https() { } # Start the policy agent -# args: (kube only) PROXY|NOPROXY [ ] +# args: (docker) PROXY|NOPROXY +# args: (kube) PROXY|NOPROXY [ ] # (Function for test scripts) start_policy_agent() { echo -e $BOLD"Starting $POLICY_AGENT_DISPLAY_NAME"$EBOLD @@ -143,9 +144,15 @@ start_policy_agent() { if [ $1 == "PROXY" ]; then AGENT_HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_CONFIG_PORT #Set if proxy is started AGENT_HTTP_PROXY_CONFIG_HOST_NAME=$HTTP_PROXY_CONFIG_HOST_NAME #Set if proxy is started + if [ $AGENT_HTTP_PROXY_CONFIG_PORT -eq 0 ] || [ -z "$AGENT_HTTP_PROXY_CONFIG_HOST_NAME" ]; then + echo -e $YELLOW" Warning: HTTP PROXY will not be configured, proxy app not started"$EYELLOW + else + echo " Configured with http proxy" + fi else AGENT_HTTP_PROXY_CONFIG_PORT=0 AGENT_HTTP_PROXY_CONFIG_HOST_NAME="" + echo " Configured without http proxy" fi export AGENT_HTTP_PROXY_CONFIG_PORT export AGENT_HTTP_PROXY_CONFIG_HOST_NAME @@ -225,9 +232,15 @@ start_policy_agent() { if [ $1 == "PROXY" ]; then AGENT_HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_CONFIG_PORT #Set if proxy is started AGENT_HTTP_PROXY_CONFIG_HOST_NAME=$HTTP_PROXY_CONFIG_HOST_NAME #Set if proxy is started + if [ $AGENT_HTTP_PROXY_CONFIG_PORT -eq 0 ] || [ -z "$AGENT_HTTP_PROXY_CONFIG_HOST_NAME" ]; then + echo -e $YELLOW" Warning: HTTP PROXY will not be configured, proxy app not started"$EYELLOW + else + echo " Configured with http proxy" + fi else AGENT_HTTP_PROXY_CONFIG_PORT=0 AGENT_HTTP_PROXY_CONFIG_HOST_NAME="" + echo " Configured without http proxy" fi export AGENT_HTTP_PROXY_CONFIG_PORT export AGENT_HTTP_PROXY_CONFIG_HOST_NAME @@ -819,7 +832,7 @@ api_put_policy_parallel() { pids=$1; shift; #if [ $PA_ADAPTER != $RESTBASE ] && [ $PA_ADAPTER != $RESTBASE_SECURE ]; then - if [ $__ADAPTER_TYPE != "REST" ]; then + if [ $PA_ADAPTER_TYPE != "REST" ]; then echo " Info - api_put_policy_parallel uses only the agent REST interface - create over dmaap in parallel is not supported" echo " Info - will execute over agent REST" fi @@ -827,7 +840,7 @@ api_put_policy_parallel() { if [ $serv == "NOSERVICE" ]; then serv="" fi - query="/v2/policies" + query="$PMS_API_PREFIX/v2/policies" else if [ $serv == "NOSERVICE" ]; then serv="" @@ -1020,13 +1033,13 @@ api_delete_policy_parallel() { pids=$1; shift; #if [ $PA_ADAPTER != $RESTBASE ] && [ $PA_ADAPTER != $RESTBASE_SECURE ]; then - if [ $__ADAPTER_TYPE != "REST" ]; then + if [ $PA_ADAPTER_TYPE != "REST" ]; then echo " Info - api_delete_policy_parallel uses only the agent REST interface - create over dmaap in parallel is not supported" echo " Info - will execute over agent REST" fi if [ "$PMS_VERSION" == "V2" ]; then - query="/v2/policies/" + query="$PMS_API_PREFIX/v2/policies/" else query="/policy" fi