TC_ONELINE_DESCR="Change supported policy types and reconfigure rics"
-#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
+#App names to include in the test when running docker, space separated list
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC NGW KUBEPROXY"
-#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+#App names to include in the test when running kubernetes, space separated list
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC KUBEPROXY NGW"
+#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+KUBE_PRESTARTED_IMAGES=""
+
+#Supported test environment profiles
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE"
+#Supported run modes
+SUPPORTED_RUNMODES="DOCKER KUBE"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
+. ../common/consul_cbs_functions.sh
. ../common/ricsimulator_api_functions.sh
. ../common/cr_api_functions.sh
+. ../common/mr_api_functions.sh
+. ../common/control_panel_api_functions.sh
+. ../common/controller_api_functions.sh
+. ../common/kube_proxy_api_functions.sh
+. ../common/gateway_api_functions.sh
+
+setup_testenvironment
#### TEST BEGIN ####
-generate_uuid
+generate_policy_uuid
use_cr_http
# Clean container and start all needed containers #
- clean_containers
+ clean_environment
+
+ start_kube_proxy
#Start simulators and prepare two configs
start_mr
- start_consul_cbs
+ if [ $RUNMODE == "DOCKER" ]; then
+ start_consul_cbs
+ fi
# Create first config
if [[ $interface = *"SDNC"* ]]; then
prepare_consul_config NOSDNC ".consul_config_all.json"
fi
- start_policy_agent
+ start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/$POLICY_AGENT_CONFIG_FILE
set_agent_trace
# Create service to be able to receive events when rics becomes available
# Must use rest towards the agent since dmaap is not configured yet
- api_put_service 201 "ric-registration" 0 "$CR_PATH/ric-registration"
+ api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH/ric-registration"
#Load first config
- consul_config_app ".consul_config_initial.json"
+ if [ $RUNMODE == "KUBE" ]; then
+ agent_load_config ".consul_config_initial.json"
+ else
+ consul_config_app ".consul_config_initial.json"
+ fi
for ((i=1; i<=${NUM_RICS}; i++))
do
done
# All sims running but 2 are not configured in consul
- api_equal json:rics 8 120
+ api_equal json:rics 8 300
if [ "$PMS_VERSION" == "V2" ]; then
cr_equal received_callbacks?id=ric-registration 8 120
fi
#Load config with all rics
- consul_config_app ".consul_config_all.json"
+ if [ $RUNMODE == "KUBE" ]; then
+ agent_load_config ".consul_config_all.json"
+ else
+ consul_config_app ".consul_config_all.json"
+ fi
api_equal json:rics 10 120
if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 5 120
+
echo "Check the number of types in the agent for each ric"
api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
else
+ api_equal json:policy_types 5 120
+
echo "Check the number of types in the agent for each ric"
api_equal json:policy_types?ric=ricsim_g1_1 1 120
api_equal json:policy_types?ric=ricsim_g1_2 2 120
api_equal json:policy_types 5
fi
- api_put_service 201 "serv1" 3600 "$CR_PATH/serv1"
+ api_put_service 201 "serv1" 3600 "$CR_SERVICE_APP_PATH/serv1"
if [ "$PMS_VERSION" == "V2" ]; then
- notificationurl=$CR_PATH"/test"
+ notificationurl=$CR_SERVICE_APP_PATH"/test"
else
notificationurl=""
fi
sleep_wait 120
# Load config with reduced number of rics
- consul_config_app ".consul_config_initial.json"
+ if [ $RUNMODE == "KUBE" ]; then
+ agent_load_config ".consul_config_initial.json"
+ else
+ consul_config_app ".consul_config_initial.json"
+ fi
api_equal json:rics 8 120
fi
if [ "$PMS_VERSION" == "V2" ]; then
+
+ api_equal json:policy-types 5 120
+
echo "Check the number of types in the agent for each ric"
api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
api_equal json:policy-types?ric_id=ricsim_g1_7 3 120
api_equal json:policy-types?ric_id=ricsim_g1_8 2 120
else
+
+ api_equal json:policy_types 5 120
+
echo "Check the number of types in the agent for each ric"
api_equal json:policy_types?ric=ricsim_g1_1 1 120
api_equal json:policy_types?ric=ricsim_g1_2 2 120
api_get_policy_types 404 ricsim_g1_9
# Load config with all rics
- consul_config_app ".consul_config_all.json"
+ if [ $RUNMODE == "KUBE" ]; then
+ agent_load_config ".consul_config_all.json"
+ else
+ consul_config_app ".consul_config_all.json"
+ fi
api_equal json:rics 10 120
if [ "$PMS_VERSION" == "V2" ]; then
+
+ api_equal json:policy-types 5 120
+
echo "Check the number of types in the agent for each ric"
api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
else
+
+ api_equal json:policy_types 5 120
+
echo "Check the number of types in the agent for each ric"
api_equal json:policy_types?ric=ricsim_g1_1 1 120
api_equal json:policy_types?ric=ricsim_g1_2 2 120
sleep_wait 120
if [ "$PMS_VERSION" == "V2" ]; then
+
+ api_equal json:policy-types 5 120
+
api_equal json:policy-types?ric_id=ricsim_g1_1 1 120
api_equal json:policy-types?ric_id=ricsim_g1_2 2 120
api_equal json:policy-types?ric_id=ricsim_g1_3 3 120
api_equal json:policy-types?ric_id=ricsim_g1_9 1 120
api_equal json:policy-types?ric_id=ricsim_g1_10 0 120
else
+
+ api_equal json:policy_types 5 120
+
api_equal json:policy_types?ric=ricsim_g1_1 1 120
api_equal json:policy_types?ric=ricsim_g1_2 2 120
api_equal json:policy_types?ric=ricsim_g1_3 3 120
sim_delete_policy_type 204 ricsim_g1_8 4
if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-types 5 120
api_equal json:policy-types?ric_id=ricsim_g1_8 1 120
else
+ api_equal json:policy_types 5 120
api_equal json:policy_types?ric=ricsim_g1_8 1 120
fi
print_result
-auto_clean_containers
\ No newline at end of file
+auto_clean_environment
\ No newline at end of file