X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fauto-test%2FFTC810.sh;h=4cc00bd398feb5832f866e54b60c1cebc2d747ca;hb=refs%2Fchanges%2F75%2F4975%2F1;hp=2631a163a99b0506ac0a49ca93a151b673dd87c3;hpb=70e878f1b5a558baaaa5ab5885a039ed96c9f8d5;p=nonrtric.git diff --git a/test/auto-test/FTC810.sh b/test/auto-test/FTC810.sh index 2631a163..4cc00bd3 100755 --- a/test/auto-test/FTC810.sh +++ b/test/auto-test/FTC810.sh @@ -17,7 +17,10 @@ # ============LICENSE_END================================================= # -TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h. Via agent REST/DMAAP/DMAAP_BATCH and SDNC using http" +TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or configured number of days). Via agent REST/DMAAP/DMAAP_BATCH and SDNC using http or https" + +#App names to include in the test, space separated list +INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh @@ -25,17 +28,39 @@ TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h. Vi #### TEST BEGIN #### +generate_uuid + #Local vars in test script ########################## -# Path to callback receiver -CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks" + # Number of RICs per interface type (OSC and STD) NUM_RICS=30 # Number of policy instances per RIC NUM_INSTANCES=5 +DAYS=3 + clean_containers +# use HTTP or HTTPS for all apis +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 + use_simulator_https +fi + start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0 start_ric_simulators ricsim_g2 $NUM_RICS STD_1.1.3 @@ -55,7 +80,6 @@ start_control_panel start_policy_agent -use_agent_rest_http api_get_status 200 @@ -90,24 +114,38 @@ 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" api_put_service 201 "serv1" 0 "$CR_PATH/1" -TEST_DURATION=$((24*3600)) +TEST_DURATION=$((24*3600*$DAYS)) TEST_START=$SECONDS -AGENT_INTERFACES="REST DMAAP DMAAP-BATCH" +AGENT_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH" MR_MESSAGES=0 +if [ "$PMS_VERSION" == "V2" ]; then + notificationurl="http://localhost:80" +else + notificationurl="" +fi + while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do echo "" @@ -122,23 +160,36 @@ while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do echo "## Testing using agent interface: $interface ##" echo "############################################" - if [ $interface == "REST" ]; then - use_agent_rest_http + if [ $interface == "REST" ] || [ $interface == "REST_PARALLEL" ]; then + if [ $HTTPX == "HTTP" ]; then + use_agent_rest_http + else + use_agent_rest_https + fi else - use_agent_dmaap + if [ $HTTPX == "HTTPS" ]; then + echo "Using secure ports towards dmaap" + use_agent_dmaap_https + else + echo "Using non-secure ports towards dmaap" + use_agent_dmaap_http + fi fi echo "Create $NUM_INSTANCES instances in each OSC RIC" INSTANCE_ID=200000 INSTANCES=0 + if [ $interface == "REST_PARALLEL" ]; then + 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 testdata/OSC/pi1_template.json $NUM_INSTANCES - else - api_put_policy 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID 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 $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES fi - if [ $interface != "REST" ]; then + if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) fi sim_equal ricsim_g1_$i num_instances $NUM_INSTANCES @@ -146,17 +197,24 @@ 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 $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 testdata/STD/pi1_template.json $NUM_INSTANCES - else - api_put_policy 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID 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 $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES fi - if [ $interface != "REST" ]; then + if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) fi sim_equal ricsim_g2_$i num_instances $NUM_INSTANCES @@ -164,20 +222,27 @@ 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" INSTANCE_ID=200000 + if [ $interface == "REST_PARALLEL" ]; then + api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 + fi for ((i=1; i<=$NUM_RICS; i++)) do if [ $interface == "DMAAP-BATCH" ]; then api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES - else + elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES fi - if [ $interface != "REST" ]; then + if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) fi INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) @@ -185,18 +250,25 @@ 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" + if [ $interface == "REST_PARALLEL" ]; then + api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 + fi for ((i=1; i<=$NUM_RICS; i++)) do if [ $interface == "DMAAP-BATCH" ]; then api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES - else + elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES fi - if [ $interface != "REST" ]; then + if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) fi INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) @@ -204,7 +276,11 @@ while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) done - api_equal json:policy_ids 0 + if [ "$PMS_VERSION" == "V2" ]; then + api_equal json:policy_instances $INSTANCES + else + api_equal json:policy_ids $INSTANCES + fi cr_equal received_callbacks 0