Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Uplift of PMS from ONAP
[nonrtric.git]
/
test
/
common
/
agent_api_functions.sh
diff --git
a/test/common/agent_api_functions.sh
b/test/common/agent_api_functions.sh
index
98a8b56
..
2f1f543
100644
(file)
--- 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
}
# Start the policy agent
-# args: (kube only) PROXY|NOPROXY <config-file> [ <data-file>]
+# args: (docker) PROXY|NOPROXY <config-file>
+# args: (kube) PROXY|NOPROXY <config-file> [ <data-file>]
# (Function for test scripts)
start_policy_agent() {
echo -e $BOLD"Starting $POLICY_AGENT_DISPLAY_NAME"$EBOLD
# (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 [ $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=""
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
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 [ $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=""
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
fi
export AGENT_HTTP_PROXY_CONFIG_PORT
export AGENT_HTTP_PROXY_CONFIG_HOST_NAME
@@
-244,6
+257,7
@@
start_policy_agent() {
return 0
}
return 0
}
+# Load the the appl config for the agent into a config map
agent_load_config() {
echo -e $BOLD"Agent - load config from "$EBOLD$1
data_json=$PWD/tmp/$POLICY_AGENT_DATA_FILE
agent_load_config() {
echo -e $BOLD"Agent - load config from "$EBOLD$1
data_json=$PWD/tmp/$POLICY_AGENT_DATA_FILE
@@
-308,7
+322,7
@@
api_equal() {
if [ $# -eq 2 ] || [ $# -eq 3 ]; then
if [[ $1 == "json:"* ]]; then
if [ "$PMS_VERSION" == "V2" ]; then
if [ $# -eq 2 ] || [ $# -eq 3 ]; then
if [[ $1 == "json:"* ]]; then
if [ "$PMS_VERSION" == "V2" ]; then
- __var_test "Policy Agent" $PA_PATH"/v2/" $1 "=" $2 $3
+ __var_test "Policy Agent" $PA_PATH
$PMS_API_PREFIX
"/v2/" $1 "=" $2 $3
else
__var_test "Policy Agent" $PA_PATH"/" $1 "=" $2 $3
fi
else
__var_test "Policy Agent" $PA_PATH"/" $1 "=" $2 $3
fi
@@
-819,7
+833,7
@@
api_put_policy_parallel() {
pids=$1; shift;
#if [ $PA_ADAPTER != $RESTBASE ] && [ $PA_ADAPTER != $RESTBASE_SECURE ]; then
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
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
+841,7
@@
api_put_policy_parallel() {
if [ $serv == "NOSERVICE" ]; then
serv=""
fi
if [ $serv == "NOSERVICE" ]; then
serv=""
fi
- query="/v2/policies"
+ query="
$PMS_API_PREFIX
/v2/policies"
else
if [ $serv == "NOSERVICE" ]; then
serv=""
else
if [ $serv == "NOSERVICE" ]; then
serv=""
@@
-1020,13
+1034,13
@@
api_delete_policy_parallel() {
pids=$1; shift;
#if [ $PA_ADAPTER != $RESTBASE ] && [ $PA_ADAPTER != $RESTBASE_SECURE ]; then
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
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
else
query="/policy"
fi