X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fauto-test%2FFTC350.sh;h=c7222457f0327a427b32e94923e9f0856934197a;hb=542d2dbfd8df1fcb011fea3d69d539c5c5fe3667;hp=756ea7fecc7e3be8c792870607d1188961450a21;hpb=674793d94f09873d24edd85f9eb2da2582d21673;p=nonrtric.git diff --git a/test/auto-test/FTC350.sh b/test/auto-test/FTC350.sh index 756ea7fe..c7222457 100755 --- a/test/auto-test/FTC350.sh +++ b/test/auto-test/FTC350.sh @@ -20,28 +20,24 @@ 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 NGW" +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 KUBEPROXY NGW" +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 ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE" +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/kube_proxy_api_functions.sh -. ../common/gateway_api_functions.sh +. ../common/testcase_common.sh $@ setup_testenvironment @@ -69,20 +65,20 @@ for interface in $TESTED_VARIANTS ; do # Clean container and start all needed containers # clean_environment - if [ $RUNMODE == "KUBE" ]; then - start_kube_proxy - fi + 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 @@ -102,7 +98,11 @@ for interface in $TESTED_VARIANTS ; do prepare_consul_config NOSDNC ".consul_config_all.json" fi - start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/$POLICY_AGENT_CONFIG_FILE + 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 @@ -110,13 +110,23 @@ for interface in $TESTED_VARIANTS ; do # 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++)) @@ -128,8 +138,8 @@ for interface in $TESTED_VARIANTS ; do 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:???? \ @@ -207,28 +217,40 @@ for interface in $TESTED_VARIANTS ; do 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 @@ -242,6 +264,8 @@ for interface in $TESTED_VARIANTS ; do 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 @@ -267,8 +291,8 @@ for interface in $TESTED_VARIANTS ; do 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 @@ -279,10 +303,10 @@ for interface in $TESTED_VARIANTS ; do 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 @@ -291,19 +315,32 @@ for interface in $TESTED_VARIANTS ; do # 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 @@ -314,6 +351,9 @@ for interface in $TESTED_VARIANTS ; do 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 @@ -346,14 +386,27 @@ for interface in $TESTED_VARIANTS ; do # 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 @@ -366,6 +419,9 @@ for interface in $TESTED_VARIANTS ; do 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 @@ -409,6 +465,9 @@ for interface in $TESTED_VARIANTS ; do 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 @@ -420,6 +479,9 @@ for interface in $TESTED_VARIANTS ; do 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 @@ -446,8 +508,10 @@ for interface in $TESTED_VARIANTS ; do 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