Functional Test Updates for I Release
[nonrtric.git] / test / auto-test / FTC810.sh
index 5ce79c0..2d0430d 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/bash
 
 #  ============LICENSE_START===============================================
-#  Copyright (C) 2020 Nordix Foundation. All rights reserved.
+#  Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
+#  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
 #  ========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  ============LICENSE_END=================================================
 #
 
-TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or configured number of days). Via a1pms REST/DMAAP/DMAAP_BATCH and SDNC using http or https"
+TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or configured number of days). Via a1pms REST and with SDNC using http or https"
 
 #App names to include in the test when running docker, space separated list
 DOCKER_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC NGW KUBEPROXY"
 
 #App names to include in the test when running kubernetes, space separated list
 KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW"
-#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
+#Pre-started 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
@@ -33,7 +34,7 @@ KUBE_PRESTARTED_IMAGES=""
 CONDITIONALLY_IGNORED_IMAGES="NGW"
 
 #Supported test environment profiles
-SUPPORTED_PROFILES="ONAP-JAKARTA ONAP-KOHN ONAP-LONDON  ORAN-F-RELEASE ORAN-G-RELEASE ORAN-H-RELEASE"
+SUPPORTED_PROFILES="ONAP-KOHN ONAP-LONDON ONAP-MONTREAL  ORAN-G-RELEASE ORAN-H-RELEASE ORAN-I-RELEASE"
 #Supported run modes
 SUPPORTED_RUNMODES="DOCKER KUBE"
 
@@ -43,7 +44,7 @@ setup_testenvironment
 
 #### TEST BEGIN ####
 
-generate_policy_uuid
+sim_generate_policy_uuid
 
 #Local vars in test script
 ##########################
@@ -71,7 +72,12 @@ if [ $HTTPX == "HTTP" ]; then
 else
    use_cr_https
    use_a1pms_rest_https
-   use_sdnc_https
+   if [[ "$SDNC_FEATURE_LEVEL" == *"NO_NB_HTTPS"* ]]; then
+      deviation "SDNC does not support NB https"
+      use_sdnc_http
+   else
+      use_sdnc_https
+   fi
    use_simulator_https
 fi
 
@@ -81,7 +87,11 @@ start_ric_simulators ricsim_g2 $NUM_RICS STD_1.1.3
 
 start_ric_simulators ricsim_g3 $NUM_RICS  STD_2.0.0
 
-start_mr
+if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
+    :
+else
+    start_mr
+fi
 
 start_cr 1
 
@@ -105,8 +115,9 @@ else
 fi
 
 start_sdnc
+controller_api_wait_for_status_ok 200 ricsim_g1_1
 
-sleep_wait 120 "Let A1PMS cofiguration take effect"
+sleep_wait 120 "Let A1PMS configuration take effect"
 
 a1pms_api_get_status 200
 
@@ -172,9 +183,14 @@ echo "Register a service"
 a1pms_api_put_service 201 "serv1" 0 "$CR_SERVICE_APP_PATH_0/1"
 
 TEST_DURATION=$((24*3600*$DAYS))
+
 TEST_START=$SECONDS
 
-A1PMS_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH"
+if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
+    A1PMS_INTERFACES="REST REST_PARALLEL"
+else
+    A1PMS_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH"
+fi
 
 MR_MESSAGES=0
 
@@ -342,12 +358,16 @@ while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do
 
       a1pms_equal json:policy-instances $INSTANCES
 
-      mr_equal requests_submitted $MR_MESSAGES
-      mr_equal requests_fetched $MR_MESSAGES
-      mr_equal responses_submitted $MR_MESSAGES
-      mr_equal responses_fetched $MR_MESSAGES
-      mr_equal current_requests 0
-      mr_equal current_responses 0
+      if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
+         :
+      else
+         mr_equal requests_submitted $MR_MESSAGES
+         mr_equal requests_fetched $MR_MESSAGES
+         mr_equal responses_submitted $MR_MESSAGES
+         mr_equal responses_fetched $MR_MESSAGES
+         mr_equal current_requests 0
+         mr_equal current_responses 0
+      fi
 
 
       for ((i=1; i<=$NUM_RICS; i++))