TC_ONELINE_DESCR="Change supported policy types and reconfigure rics"
#App names to include in the test when running docker, space separated list
-DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
+DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC KUBEPROXY"
#App names to include in the test when running kubernetes, space separated list
-KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC"
+KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC KUBEPROXY"
#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
KUBE_PRESTARTED_IMAGES=""
+#Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
+#the image is not configured in the supplied env_file
+#Used for images not applicable to all supported profile
+CONDITIONALLY_IGNORED_IMAGES="CBS CONSUL"
+
#Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN"
+SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ONAP-JAKARTA ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE ORAN-F-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/testcase_common.sh $@
+
+setup_testenvironment
#### TEST BEGIN ####
-generate_uuid
+generate_policy_uuid
use_cr_http
# Clean container and start all needed containers #
clean_environment
+ start_kube_proxy
+
#Start simulators and prepare two configs
start_ric_simulators ricsim_g1 $NUM_RICS_2 OSC_2.1.0
- start_cr
+ start_cr 1
start_mr
if [ $RUNMODE == "DOCKER" ]; then
- start_consul_cbs
+ if [[ "$PMS_FEATURE_LEVEL" != *"NOCONSUL"* ]]; then
+ start_consul_cbs
+ fi
fi
# Create first config
prepare_consul_config NOSDNC ".consul_config_all.json"
fi
- start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml
+ if [ $RUNMODE == "KUBE" ] && [[ "$PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
+ start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application2.yaml
+ else
+ start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/$POLICY_AGENT_CONFIG_FILE
+ fi
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_SERVICE_PATH/ric-registration"
+ api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
#Load first config
if [ $RUNMODE == "KUBE" ]; then
- agent_load_config ".consul_config_initial.json"
+ if [[ "$PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
+ api_put_configuration 200 ".consul_config_initial.json"
+ api_get_configuration 200 ".consul_config_initial.json"
+ else
+ agent_load_config ".consul_config_initial.json"
+ fi
else
- consul_config_app ".consul_config_initial.json"
+ if [[ "$PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
+ api_put_configuration 200 ".consul_config_initial.json"
+ api_get_configuration 200 ".consul_config_initial.json"
+ else
+ consul_config_app ".consul_config_initial.json"
+ fi
fi
for ((i=1; i<=${NUM_RICS}; i++))
api_equal json:rics 8 300
if [ "$PMS_VERSION" == "V2" ]; then
- cr_equal received_callbacks?id=ric-registration 8 120
- cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g1_2 ricsim_g1_3 ricsim_g1_4 ricsim_g1_5 ricsim_g1_6 ricsim_g1_7 ricsim_g1_8
+ cr_equal 0 received_callbacks?id=ric-registration 8 120
+ cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_1 ricsim_g1_2 ricsim_g1_3 ricsim_g1_4 ricsim_g1_5 ricsim_g1_6 ricsim_g1_7 ricsim_g1_8
fi
api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:NOTYPE:???? \
ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? "
if [ "$PMS_VERSION" == "V2" ]; then
- cr_equal received_callbacks?id=ric-registration 16 120
- cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g1_2 ricsim_g1_3 ricsim_g1_4 ricsim_g1_5 ricsim_g1_6 ricsim_g1_7 ricsim_g1_8
+ cr_equal 0 received_callbacks?id=ric-registration 16 120
+ cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_1 ricsim_g1_2 ricsim_g1_3 ricsim_g1_4 ricsim_g1_5 ricsim_g1_6 ricsim_g1_7 ricsim_g1_8
fi
#Load config with all rics
if [ $RUNMODE == "KUBE" ]; then
- agent_load_config ".consul_config_all.json"
+ if [[ "$PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
+ api_put_configuration 200 ".consul_config_all.json"
+ api_get_configuration 200 ".consul_config_all.json"
+ else
+ agent_load_config ".consul_config_all.json"
+ fi
else
- consul_config_app ".consul_config_all.json"
+ if [[ "$PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
+ api_put_configuration 200 ".consul_config_all.json"
+ api_get_configuration 200 ".consul_config_all.json"
+ else
+ consul_config_app ".consul_config_all.json"
+ fi
fi
api_equal json:rics 10 120
if [ "$PMS_VERSION" == "V2" ]; then
- cr_equal received_callbacks?id=ric-registration 18 120
- cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9 ricsim_g1_10
+ cr_equal 0 received_callbacks?id=ric-registration 18 120
+ cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_9 ricsim_g1_10
fi
sim_put_policy_type 201 ricsim_g1_9 5 testdata/OSC/sim_5.json
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
ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? "
if [ "$PMS_VERSION" == "V2" ]; then
- cr_equal received_callbacks?id=ric-registration 19 120
- cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9
+ cr_equal 0 received_callbacks?id=ric-registration 19 120
+ cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_9
fi
#No policy type in sim #10
api_equal json:policy_types 5
fi
- api_put_service 201 "serv1" 3600 "$CR_SERVICE_PATH/serv1"
+ api_put_service 201 "serv1" 3600 "$CR_SERVICE_APP_PATH_0/serv1"
if [ "$PMS_VERSION" == "V2" ]; then
- notificationurl=$CR_SERVICE_PATH"/test"
+ notificationurl=$CR_SERVICE_APP_PATH_0"/test"
else
notificationurl=""
fi
# Load config with reduced number of rics
if [ $RUNMODE == "KUBE" ]; then
- agent_load_config ".consul_config_initial.json"
+ if [[ "$PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
+ api_put_configuration 200 ".consul_config_initial.json"
+ api_get_configuration 200 ".consul_config_initial.json"
+ else
+ agent_load_config ".consul_config_initial.json"
+ fi
else
- consul_config_app ".consul_config_initial.json"
+ if [[ "$PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
+ api_put_configuration 200 ".consul_config_initial.json"
+ api_get_configuration 200 ".consul_config_initial.json"
+ else
+ consul_config_app ".consul_config_initial.json"
+ fi
fi
api_equal json:rics 8 120
if [ "$PMS_VERSION" == "V2" ]; then
- cr_equal received_callbacks?id=ric-registration 19 120
- cr_api_check_all_sync_events 200 ric-registration EMPTY
+ cr_equal 0 received_callbacks?id=ric-registration 19 120
+ cr_api_check_all_sync_events 200 0 ric-registration EMPTY
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
# Load config with all rics
if [ $RUNMODE == "KUBE" ]; then
- agent_load_config ".consul_config_all.json"
+ if [[ "$PMS_FEATURE_LEVEL" == *"INITIALCONFIGMAP"* ]]; then
+ api_put_configuration 200 ".consul_config_all.json"
+ api_get_configuration 200 ".consul_config_all.json"
+ else
+ agent_load_config ".consul_config_all.json"
+ fi
else
- consul_config_app ".consul_config_all.json"
+ if [[ "$PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
+ api_put_configuration 200 ".consul_config_all.json"
+ api_get_configuration 200 ".consul_config_all.json"
+ else
+ consul_config_app ".consul_config_all.json"
+ fi
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