#### TEST BEGIN ####
-#Local vars in test script
-##########################
-
-# Path to callback receiver
-CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
generate_uuid
echo "#####################################################################"
echo "#####################################################################"
+ #Local vars in test script
+ ##########################
+
+ if [ $__httpx == "HTTPS" ]; then
+ # Path to callback receiver
+ CR_PATH="https://$CR_APP_NAME:$CR_EXTERNAL_SECURE_PORT/callbacks"
+ use_cr_https
+ else
+ # Path to callback receiver
+ CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+ use_cr_http
+ fi
# Clean container and start all needed containers #
clean_containers
start_cr
- if [ $interface == "SDNC" ]; then
+ if [ $interface == "REST+SDNC" ] || [ $interface == "DMAAP+SDNC" ]; then
start_sdnc
start_control_panel
- if [ $interface == "REST+SDNC" ] || [ $interface == "DMAAP+SDNC" ]; then
- start_sdnc
- fi
-
start_policy_agent
set_agent_debug
if [ $interface == "DMAAP" ] || [ $interface == "DMAAP+SDNC" ]; then
- use_agent_dmaap
+ if [ $__httpx == "HTTPS" ]; then
+ echo "Using secure ports towards dmaap"
+ use_agent_dmaap_https
+ else
+ echo "Using non-secure ports towards dmaap"
+ use_agent_dmaap_http
+ fi
else
if [ $__httpx == "HTTPS" ]; then
echo "Using secure ports towards the agent"
##########################
# Path to callback receiver
CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+use_cr_http
clean_containers
sim_equal ricsim_g1_1 num_instances 1
-use_agent_dmaap
+use_agent_dmaap_http
api_put_policy 201 "service1" ricsim_g1_1 1 3000 NOTRANSIENT testdata/OSC/pi1_template.json 1
sim_equal ricsim_g2_1 num_instances 1
-use_agent_dmaap
+use_agent_dmaap_http
api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT testdata/STD/pi1_template.json 1
sim_equal ricsim_g1_1 num_instances 2
-use_agent_dmaap
+use_agent_dmaap_http
api_put_policy 200 "service1" ricsim_g1_1 1 3000 NOTRANSIENT testdata/OSC/pi1_template.json 1
sim_equal ricsim_g2_1 num_instances 2
-use_agent_dmaap
+use_agent_dmaap_http
api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT testdata/STD/pi1_template.json 1
# Remove policies
-use_agent_dmaap
+use_agent_dmaap_http
api_delete_policy 204 2000
use_agent_rest_http
api_delete_policy 204 3000
-use_agent_dmaap
+use_agent_dmaap_http
api_delete_policy 204 2100
use_agent_rest_http
api_delete_policy 204 3100
api_get_policy 404 3100
# Remove the service
-use_agent_dmaap
+use_agent_dmaap_http
api_delete_services 204 "service1"
api_get_services 404 "service1"
generate_uuid
-#Local vars in test script
-##########################
-
-# Path to callback receiver
-CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
-
# Tested variants of REST/DMAAP/SDNC config
TESTED_VARIANTS="REST DMAAP REST+SDNC DMAAP+SDNC"
#Test agent and simulator protocol versions (others are http only)
echo "#####################################################################"
echo "#####################################################################"
+ #Local vars in test script
+ ##########################
+
+ if [ $__httpx == "HTTPS" ]; then
+ # Path to callback receiver
+ CR_PATH="https://$CR_APP_NAME:$CR_EXTERNAL_SECURE_PORT/callbacks"
+ use_cr_https
+ else
+ # Path to callback receiver
+ CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+ use_cr_http
+ fi
# Clean container and start all needed containers #
clean_containers
set_agent_debug
if [ $interface == "DMAAP" ] || [ $interface == "DMAAP+SDNC" ]; then
- use_agent_dmaap
+ if [ $__httpx == "HTTPS" ]; then
+ echo "Using secure ports towards dmaap"
+ use_agent_dmaap_https
+ else
+ echo "Using non-secure ports towards dmaap"
+ use_agent_dmaap_http
+ fi
else
if [ $__httpx == "HTTPS" ]; then
#"Using secure ports towards the agent"
##########################
# Path to callback receiver
CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+use_cr_http
#### TEST BEGIN ####
generate_uuid
-#Local vars in test script
-##########################
-# Path to callback receiver
-CR_PATH="https://$CR_APP_NAME:$CR_EXTERNAL_SECURE_PORT/callbacks"
-
# Tested variants of REST/DMAAP/SDNC config
TESTED_VARIANTS="REST DMAAP REST+SDNC DMAAP+SDNC DMAAP_BATCH DMAAP_BATCH+SDNC"
#Test agent and simulator protocol versions (others are http only)
echo "#####################################################################"
echo "#####################################################################"
+ #Local vars in test script
+ ##########################
+
+ if [ $__httpx == "HTTPS" ]; then
+ # Path to callback receiver
+ CR_PATH="https://$CR_APP_NAME:$CR_EXTERNAL_SECURE_PORT/callbacks"
+ use_cr_https
+ else
+ # Path to callback receiver
+ CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+ use_cr_http
+ fi
# Clean container and start all needed containers #
clean_containers
if [[ $interface = *"SDNC"* ]]; then
start_sdnc
+ if [ $__httpx == "HTTPS" ]; then
+ # "Using secure ports towards SDNC"
+ use_sdnc_https
+ else
+ #"Using non-secure ports towards SDNC"
+ use_sdnc_http
+ fi
prepare_consul_config SDNC ".consul_config.json"
else
prepare_consul_config NOSDNC ".consul_config.json"
set_agent_debug
if [[ $interface == *"DMAAP"* ]]; then
- use_agent_dmaap
+ if [ $__httpx == "HTTPS" ]; then
+ echo "Using secure ports towards dmaap"
+ use_agent_dmaap_https
+ else
+ echo "Using non-secure ports towards dmaap"
+ use_agent_dmaap_http
+ fi
else
if [ $__httpx == "HTTPS" ]; then
echo "Using secure ports towards the agent"
##########################
# Path to callback receiver
CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+use_cr_http
NUM_RICS=10
NUM_RICS_2=$(($NUM_RICS-2))
#Local vars in test script
##########################
-# Path to callback receiver
-CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
# Number of policies in each sequence
NUM_POLICIES=10000
echo "#####################################################################"
echo "#####################################################################"
+ #Local vars in test script
+ ##########################
+
+ if [ $__httpx == "HTTPS" ]; then
+ # Path to callback receiver
+ CR_PATH="https://$CR_APP_NAME:$CR_EXTERNAL_SECURE_PORT/callbacks"
+ use_cr_https
+ else
+ # Path to callback receiver
+ CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+ use_cr_http
+ fi
+
# Policy instance start id
START_ID=1
sim_equal ricsim_g2_1 num_instances $NUM_POLICIES
- use_agent_dmaap
+ if [ $__httpx == "HTTPS" ]; then
+ echo "Using secure ports towards dmaap"
+ use_agent_dmaap_https
+ else
+ echo "Using non-secure ports towards dmaap"
+ use_agent_dmaap_http
+ fi
START_ID=$(($START_ID+$NUM_POLICIES))
#Local vars in test script
##########################
-# Path to callback receiver
-CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+
# Number of RICs per interface type (OSC and STD)
NUM_RICS=30
# Number of policy instances per RIC
clean_containers
-# use http or https for all apis
-HTTPX=https
+# use HTTP or HTTPS for all apis
+HTTPX=HTTPS
-if [ $HTTPX == "http" ]; then
+if [ $HTTPX == "HTTP" ]; then
+ # Path to callback receiver
+ CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+ use_cr_http
use_agent_rest_http
use_sdnc_http
use_simulator_http
else
+ # Path to callback receiver
+ CR_PATH="https://$CR_APP_NAME:$CR_EXTERNAL_SECURE_PORT/callbacks"
+ use_cr_https
use_agent_rest_https
use_sdnc_https
use_simulator_https
echo "############################################"
if [ $interface == "REST" ] || [ $interface == "REST_PARALLEL" ]; then
- if [ $HTTPX == "http" ]; then
+ if [ $HTTPX == "HTTP" ]; then
use_agent_rest_http
else
use_agent_rest_https
fi
else
- use_agent_dmaap
+ if [ $HTTPX == "HTTPS" ]; then
+ echo "Using secure ports towards dmaap"
+ use_agent_dmaap_https
+ else
+ echo "Using non-secure ports towards dmaap"
+ use_agent_dmaap_http
+ fi
fi
echo "Create $NUM_INSTANCES instances in each OSC RIC"
#Local vars in test script
##########################
-# Path to callback receiver
-CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
# Tested variants of REST/DMAAP/SDNC config
TESTED_VARIANTS="REST REST+SDNC"
echo "#####################################################################"
echo "#####################################################################"
+ #Local vars in test script
+ ##########################
+
+ if [ $__httpx == "HTTPS" ]; then
+ # Path to callback receiver
+ CR_PATH="https://$CR_APP_NAME:$CR_EXTERNAL_SECURE_PORT/callbacks"
+ use_cr_https
+ else
+ # Path to callback receiver
+ CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+ use_cr_http
+ fi
# Clean container and start all needed containers #
clean_containers
##########################
# Path to callback receiver
CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
+use_cr_http
clean_containers
############# TEST CASES #################
ARG1=$1
-./FTC1.sh $1
+./FTC1.sh $ARG1
if [ $ARG1 == "remote-remove" ]; then
#Prevent image removal for every test case
ARG1="remote"
fi
-./FTC10.sh $1
-./FTC100.sh $1
-./FTC110.sh $1
-./FTC150.sh $1
-./FTC300.sh $1
-./FTC310.sh $1
-./FTC350.sh $1
-./FTC800.sh $1
-./FTC850.sh $1
+./FTC10.sh $ARG1
+./FTC100.sh $ARG1
+./FTC110.sh $ARG1
+./FTC150.sh $ARG1
+./FTC300.sh $ARG1
+./FTC310.sh $ARG1
+./FTC350.sh $ARG1
+./FTC800.sh $ARG1
+./FTC850.sh $ARG1
##########################################
|--|
| None |
+#### Function: use_cr_http ####
+Use http for getting event from CR. The admin API is not affected. This is the default.
+| arg list |
+|--|
+| None |
+
+#### Function: use_cr_https ####
+Use https for getting event from CR. The admin API is not affected.
+Note: Not yet used as callback event is not fully implemented/deciced.
+| arg list |
+|--|
+| None |
+
#### Function: start_policy_agent ####
Start the Policy Agent container. If the test script is configured to use a stand alone Policy Agent (for example other container or stand alone app) the script will prompt for starting the stand alone Policy Agent.
| arg list |
|--|
| None |
-#### Function: use_agent_dmaap ####
-Send and recieve all API calls to the Policy Agent over Dmaap via the MR.
+#### Function: use_agent_dmaap_http ####
+Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
+| arg list |
+|--|
+| None |
+
+#### Function: use_agent_dmaap_https ####
+Send and recieve all API calls to the Policy Agent over Dmaap via the MR over https.
| arg list |
|--|
| None |
if [ $# -ne 2 ]; then
paramError=1
fi
- if ! [ $ADAPTER == $DMAAPBASE ]; then
+ if [ $ADAPTER == $RESTBASE ] || [ $ADAPTER == $RESTBASE_SECURE ]; then
paramError=1
fi
else
#urlencode the request url since it will be carried by send-request url
requestUrl=$(python3 -c "from __future__ import print_function; import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))" "$2")
url=" "${ADAPTER}"/send-request?url="${requestUrl}"&operation="${oper}
- curlString="curl -X POST${timeout}${httpcode}${content}${url}${file}"
+ curlString="curl -k -X POST${timeout}${httpcode}${content}${url}${file}"
echo " CMD: "$curlString >> $HTTPLOG
res=$($curlString)
retcode=$?
cid=$2
fi
url=" "${ADAPTER}"/receive-response?correlationid="${cid}
- curlString="curl -X GET"${timeout}${httpcode}${url}
+ curlString="curl -k -X GET"${timeout}${httpcode}${url}
echo " CMD: "$curlString >> $HTTPLOG
res=$($curlString)
retcode=$?
RESTBASE="http://localhost:"$POLICY_AGENT_EXTERNAL_PORT # Base url to the Agent NB REST interface
RESTBASE_SECURE="https://localhost:"$POLICY_AGENT_EXTERNAL_SECURE_PORT # Base url to the secure Agent NB REST interface
-DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT # Base url to the Dmaap adapter
+DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT # Base url to the Dmaap adapter, http
+DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT # Base url to the Dmaap adapter, https
ADAPTER=$RESTBASE # Adapter holds the address the agent R-APP interface (REST OR DMAAP)
# The values of this var is swiched between the two base url when needed
\ No newline at end of file
export MR_PORT=$MR_INTERNAL_PORT
export MR_LOCAL_PORT=$MR_EXTERNAL_PORT #When agent is running outside the docker net
+export CR_HTTPX="http"
+export CR_PORT=$CR_INTERNAL_PORT
+export CR_LOCAL_PORT=$CR_EXTERNAL_PORT #When CR is running outside the docker net
+
export SDNC_HTTPX="http"
export SDNC_PORT=$SDNC_INTERNAL_PORT
export SDNC_LOCAL_PORT=$SDNC_EXTERNAL_PORT #When agent is running outside the docker net
}
+use_cr_http() {
+ echo -e $BOLD"Using http between test script and CR"$EBOLD
+ export CR_HTTPX="http"
+ export CR_PORT=$CR_INTERNAL_PORT
+ export CR_LOCAL_PORT=$CR_EXTERNAL_PORT
+ echo ""
+}
+
+use_cr_https() {
+ echo -e $BOLD"Using https between test script and CR"$EBOLD
+ export CR_HTTPX="https"
+ export CR_PORT=$CR_INTERNAL_SECURE_PORT
+ export CR_LOCAL_PORT=$CR_EXTERNAL_SECURE_PORT
+ echo ""
+}
+
###########################
### Policy Agents functions
###########################
return 0
}
-# All calls to the agent will be directed to the agent dmaap interface from now on
+# All calls to the agent will be directed to the agent dmaap interface over http from now on
# args: -
# (Function for test scripts)
-use_agent_dmaap() {
- echo -e $BOLD"Agent using DMAAP interface"$EBOLD
+use_agent_dmaap_http() {
+ echo -e $BOLD"Agent using DMAAP http interface"$EBOLD
export ADAPTER=$DMAAPBASE
echo ""
return 0
}
+# All calls to the agent will be directed to the agent dmaap interface over https from now on
+# args: -
+# (Function for test scripts)
+use_agent_dmaap_https() {
+ echo -e $BOLD"Agent using DMAAP https interface"$EBOLD
+ export ADAPTER=$DMAAPBASE_SECURE
+ echo ""
+ return 0
+}
# Turn on debug level tracing in the agent
# args: -