X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fauto-test%2FFTC810.sh;h=911a1ebd6aa8850f83538877d2ba6c0db00f699d;hb=49f0e5ab01b51aee8713a17aed86cd6d229b40cc;hp=009efc04b1d272ac23ab0717f0bcbd8976a09603;hpb=f38e1e8cb3652e73ea1e76b5a1a77a4aeb108577;p=nonrtric.git diff --git a/test/auto-test/FTC810.sh b/test/auto-test/FTC810.sh index 009efc04..911a1ebd 100755 --- a/test/auto-test/FTC810.sh +++ b/test/auto-test/FTC810.sh @@ -22,9 +22,13 @@ TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or #App names to include in the test, space separated list INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" +#SUPPORTED TEST ENV FILE +SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN" + . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh . ../common/ricsimulator_api_functions.sh +. ../common/cr_api_functions.sh #### TEST BEGIN #### @@ -46,15 +50,11 @@ clean_containers HTTPX=HTTPS 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 @@ -114,12 +114,20 @@ do done echo "Wait for the agent to refresh types from the simulator" -api_equal json:policy_types 2 120 +if [ "$PMS_VERSION" == "V2" ]; then + api_equal json:policy-types 2 120 +else + api_equal json:policy_types 2 120 +fi echo "Check the number of types in the agent for each ric is 1" for ((i=1; i<=$NUM_RICS; i++)) do - api_equal json:policy_types?ric=ricsim_g1_$i 1 120 + if [ "$PMS_VERSION" == "V2" ]; then + api_equal json:policy-types?ric_id=ricsim_g1_$i 1 120 + else + api_equal json:policy_types?ric=ricsim_g1_$i 1 120 + fi done echo "Register a service" @@ -132,6 +140,12 @@ AGENT_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH" MR_MESSAGES=0 +if [ "$PMS_VERSION" == "V2" ]; then + notificationurl=$CR_PATH"/test" +else + notificationurl="" +fi + while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do echo "" @@ -166,14 +180,14 @@ while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do INSTANCE_ID=200000 INSTANCES=0 if [ $interface == "REST_PARALLEL" ]; then - api_put_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $INSTANCE_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_INSTANCES 3 + api_put_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES 3 fi for ((i=1; i<=$NUM_RICS; i++)) do if [ $interface == "DMAAP-BATCH" ]; then - api_put_policy_batch 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_INSTANCES + api_put_policy_batch 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then - api_put_policy 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_INSTANCES + api_put_policy 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES fi if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) @@ -183,18 +197,22 @@ while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) done - api_equal json:policy_ids $INSTANCES + if [ "$PMS_VERSION" == "V2" ]; then + api_equal json:policy-instances $INSTANCES + else + api_equal json:policy_ids $INSTANCES + fi echo "Create $NUM_INSTANCES instances in each STD RIC" if [ $interface == "REST_PARALLEL" ]; then - api_put_policy_parallel 201 "serv1" ricsim_g2_ $NUM_RICS NOTYPE $INSTANCE_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_INSTANCES 3 + api_put_policy_parallel 201 "serv1" ricsim_g2_ $NUM_RICS NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES 3 fi for ((i=1; i<=$NUM_RICS; i++)) do if [ $interface == "DMAAP-BATCH" ]; then - api_put_policy_batch 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_INSTANCES + api_put_policy_batch 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then - api_put_policy 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT testdata/STD/pi1_template.json $NUM_INSTANCES + api_put_policy 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES fi if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) @@ -204,7 +222,11 @@ while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) done - api_equal json:policy_ids $INSTANCES + if [ "$PMS_VERSION" == "V2" ]; then + api_equal json:policy-instances $INSTANCES + else + api_equal json:policy_ids $INSTANCES + fi echo "Delete all instances in each OSC RIC" @@ -228,7 +250,11 @@ while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) done - api_equal json:policy_ids $INSTANCES + if [ "$PMS_VERSION" == "V2" ]; then + api_equal json:policy-instances $INSTANCES + else + api_equal json:policy_ids $INSTANCES + fi echo "Delete all instances in each STD RIC" @@ -250,9 +276,11 @@ while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) done - api_equal json:policy_ids 0 - - cr_equal received_callbacks 0 + if [ "$PMS_VERSION" == "V2" ]; then + api_equal json:policy-instances $INSTANCES + else + api_equal json:policy_ids $INSTANCES + fi mr_equal requests_submitted $MR_MESSAGES mr_equal requests_fetched $MR_MESSAGES @@ -273,6 +301,7 @@ while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do done check_policy_agent_logs +check_sdnc_logs #### TEST COMPLETE ####