X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fauto-test%2FFTC350.sh;h=d30b31411b95598272bea562d343278c642b566d;hb=e0b665e3ff544bb78411bdc7f6b3ba2818fdeed4;hp=4f2244c93379a4e188a5b4432845b79f2d42218f;hpb=4207b8389320d90274b12be78732304034bbc116;p=nonrtric.git diff --git a/test/auto-test/FTC350.sh b/test/auto-test/FTC350.sh index 4f2244c9..d30b3141 100755 --- a/test/auto-test/FTC350.sh +++ b/test/auto-test/FTC350.sh @@ -19,21 +19,32 @@ 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" + +#App names to include in the test when running kubernetes, space separated list +KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC" +#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 ORAN-CHERRY ORAN-DAWN" +#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 #### TEST BEGIN #### generate_uuid -#Local vars in test script -########################## -# Path to callback receiver -CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks" use_cr_http NUM_RICS=10 @@ -52,7 +63,7 @@ for interface in $TESTED_VARIANTS ; do # Clean container and start all needed containers # - clean_containers + clean_environment #Start simulators and prepare two configs @@ -62,18 +73,18 @@ for interface in $TESTED_VARIANTS ; do start_mr - start_consul_cbs + if [ $RUNMODE == "DOCKER" ]; then + start_consul_cbs + fi + # Create first config if [[ $interface = *"SDNC"* ]]; then start_sdnc - prepare_consul_config SDNC ".consul_config_2.json" + prepare_consul_config SDNC ".consul_config_initial.json" else - prepare_consul_config NOSDNC ".consul_config_2.json" + prepare_consul_config NOSDNC ".consul_config_initial.json" fi - consul_config_app ".consul_config_2.json" - - # Create 2nd config and save for later start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0 @@ -83,20 +94,35 @@ for interface in $TESTED_VARIANTS ; do prepare_consul_config NOSDNC ".consul_config_all.json" fi - start_policy_agent + start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml - set_agent_debug set_agent_trace api_get_status 200 + # 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" + + #Load first config + 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 sim_print ricsim_g1_$i interface 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 + 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 + fi api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:NOTYPE:???? \ ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:NOTYPE:???? \ @@ -136,7 +162,6 @@ for interface in $TESTED_VARIANTS ; do sim_put_policy_type 201 ricsim_g1_6 5 testdata/OSC/sim_5.json sim_put_policy_type 201 ricsim_g1_7 5 testdata/OSC/sim_5.json sim_put_policy_type 201 ricsim_g1_8 5 testdata/OSC/sim_5.json - 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 @@ -173,12 +198,27 @@ for interface in $TESTED_VARIANTS ; do ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \ 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 + 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 + cr_equal received_callbacks?id=ric-registration 18 120 + cr_api_check_all_sync_events 200 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 echo "Check the number of types in the agent for each ric" @@ -218,6 +258,10 @@ for interface in $TESTED_VARIANTS ; do ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \ 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 + fi #No policy type in sim #10 @@ -227,30 +271,30 @@ for interface in $TESTED_VARIANTS ; do api_equal json:policy_types 5 fi - api_put_service 201 "serv1" 3600 "$CR_PATH/serv1" + api_put_service 201 "serv1" 3600 "$CR_SERVICE_PATH/serv1" if [ "$PMS_VERSION" == "V2" ]; then - notificationurl="http://localhost:80" + notificationurl=$CR_SERVICE_PATH"/test" else notificationurl="" fi - api_put_policy 201 "serv1" ricsim_g1_9 5 2000 NOTRANSIENT $notificationurl testdata/OSC/pi5_template.json 1 + sleep_wait 120 - if [ "$PMS_VERSION" == "V2" ]; then - api_equal json:policy_instances 1 + # Load config with reduced number of rics + if [ $RUNMODE == "KUBE" ]; then + agent_load_config ".consul_config_initial.json" else - api_equal json:policy_ids 1 + consul_config_app ".consul_config_initial.json" fi - sim_equal ricsim_g1_9 num_instances 1 - - - # Load config with reduced number of rics - consul_config_app ".consul_config_2.json" - 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 + fi + if [ "$PMS_VERSION" == "V2" ]; then echo "Check the number of types in the agent for each ric" api_equal json:policy-types?ric_id=ricsim_g1_1 1 120 @@ -285,19 +329,19 @@ for interface in $TESTED_VARIANTS ; do sleep_wait 120 if [ "$PMS_VERSION" == "V2" ]; then - api_equal json:policy_instances 0 + api_equal json:policy-instances 0 else api_equal json:policy_ids 0 fi api_get_policy_types 404 ricsim_g1_9 - sim_equal ricsim_g1_9 num_instances 0 - - api_delete_policy 404 2000 - # 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 @@ -341,7 +385,7 @@ for interface in $TESTED_VARIANTS ; do sleep_wait 120 if [ "$PMS_VERSION" == "V2" ]; then - api_equal json:policy_instances 0 + api_equal json:policy-instances 0 else api_equal json:policy_ids 0 fi @@ -413,17 +457,18 @@ for interface in $TESTED_VARIANTS ; do check_policy_agent_logs + if [[ $interface = *"SDNC"* ]]; then + check_sdnc_logs + fi + store_logs ${interface} done - - - #### TEST COMPLETE #### print_result -auto_clean_containers \ No newline at end of file +auto_clean_environment \ No newline at end of file