Test FTC100 fails since A1-SIM update 30/12930/1 master
authorraviteja.karumuri <raviteja.karumuri@est.tech>
Mon, 27 May 2024 09:58:44 +0000 (10:58 +0100)
committerraviteja.karumuri <raviteja.karumuri@est.tech>
Mon, 27 May 2024 14:57:34 +0000 (15:57 +0100)
Issue-ID: NONRTRIC-1002
Change-Id: I40245a273b4af57599c91899166ea092b3ec4330
Signed-off-by: Raviteja Karumuri <raviteja.karumuri@est.tech>
20 files changed:
sample-services/ics-producer-consumer/helm-chart/ics-consumer/.helmignore [new file with mode: 0644]
sample-services/ics-producer-consumer/helm-chart/ics-consumer/Chart.yaml [new file with mode: 0644]
sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-deployment.yaml [new file with mode: 0644]
sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-service.yaml [new file with mode: 0644]
sample-services/ics-producer-consumer/helm-chart/ics-consumer/values.yaml [new file with mode: 0644]
sample-services/ics-producer-consumer/helm-chart/ics-producer/.helmignore [new file with mode: 0644]
sample-services/ics-producer-consumer/helm-chart/ics-producer/Chart.yaml [new file with mode: 0644]
sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-deployment.yaml [new file with mode: 0644]
sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-service.yaml [new file with mode: 0644]
sample-services/ics-producer-consumer/helm-chart/ics-producer/values.yaml [new file with mode: 0644]
test/auto-test/FTC100.sh
test/auto-test/FTC150.sh
test/auto-test/FTC2002.sh
test/auto-test/ONAP_UC.sh
test/auto-test/Suite-Verify-jobs.sh
test/auto-test/verify-jobs-nonrtric.sh
test/common/a1pms_api_functions.sh
test/common/sdnc_api_functions.sh
test/common/testcase_common.sh
test/common/testsuite_common.sh

diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-consumer/.helmignore b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/.helmignore
new file mode 100644 (file)
index 0000000..0e8a0eb
--- /dev/null
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-consumer/Chart.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/Chart.yaml
new file mode 100644 (file)
index 0000000..8b972e8
--- /dev/null
@@ -0,0 +1,6 @@
+apiVersion: v2
+name: ics-consumer
+description: A Helm chart for Kubernetes
+type: application
+version: 0.1.0
+appVersion: "1.16.0"
diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-deployment.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-deployment.yaml
new file mode 100644 (file)
index 0000000..9c107fe
--- /dev/null
@@ -0,0 +1,41 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#   ========================LICENSE_END===================================
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ .Values.consumer.name }}
+spec:
+  replicas: {{ .Values.consumer.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ .Values.consumer.name }}
+  template:
+    metadata:
+      labels:
+        app: {{ .Values.consumer.name }}
+    spec:
+      containers:
+      - name: {{ .Values.consumer.name }}
+        image: "{{ .Values.consumer.image.repository }}:{{ .Values.consumer.image.tag }}"
+        ports:
+        - containerPort: {{ .Values.consumer.service.port }}
+        env:
+        - name: KAFKA_SERVERS
+          value: "{{ .Values.kafka.host }}:{{ .Values.kafka.port }}"
diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-service.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-service.yaml
new file mode 100644 (file)
index 0000000..6b33838
--- /dev/null
@@ -0,0 +1,31 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#   ========================LICENSE_END===================================
+#
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ .Values.consumer.name }}
+spec:
+  type: NodePort
+  ports:
+    - port: {{ .Values.consumer.service.port }}
+      targetPort: {{ .Values.consumer.service.port }}
+      nodePort: {{ .Values.consumer.service.nodePort }}
+  selector:
+    app: {{ .Values.consumer.name }}
diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-consumer/values.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/values.yaml
new file mode 100644 (file)
index 0000000..5e6c5b0
--- /dev/null
@@ -0,0 +1,32 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#   ========================LICENSE_END===================================
+#
+consumer:
+  name: kafka-consumer
+  replicaCount: 1
+  image:
+    repository: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-sample-icsconsumer
+    tag: 0.0.1
+  service:
+    port: 8081
+    nodePort: 30081
+
+kafka:
+  host: kafka-service
+  port: 9092
diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-producer/.helmignore b/sample-services/ics-producer-consumer/helm-chart/ics-producer/.helmignore
new file mode 100644 (file)
index 0000000..0e8a0eb
--- /dev/null
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-producer/Chart.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-producer/Chart.yaml
new file mode 100644 (file)
index 0000000..e26165b
--- /dev/null
@@ -0,0 +1,6 @@
+apiVersion: v2
+name: ics-producer
+description: A Helm chart for Kubernetes
+type: application
+version: 0.1.0
+appVersion: "1.16.0"
diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-deployment.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-deployment.yaml
new file mode 100644 (file)
index 0000000..b7433fc
--- /dev/null
@@ -0,0 +1,41 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#   ========================LICENSE_END===================================
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ .Values.producer.name }}
+spec:
+  replicas: {{ .Values.producer.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ .Values.producer.name }}
+  template:
+    metadata:
+      labels:
+        app: {{ .Values.producer.name }}
+    spec:
+      containers:
+      - name: {{ .Values.producer.name }}
+        image: "{{ .Values.producer.image.repository }}:{{ .Values.producer.image.tag }}"
+        ports:
+        - containerPort: {{ .Values.producer.service.port }}
+        env:
+        - name: KAFKA_SERVERS
+          value: "{{ .Values.kafka.host }}:{{ .Values.kafka.port }}"
diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-service.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-service.yaml
new file mode 100644 (file)
index 0000000..8e17906
--- /dev/null
@@ -0,0 +1,31 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#   ========================LICENSE_END===================================
+#
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ .Values.producer.name }}
+spec:
+  type: NodePort
+  ports:
+    - port: {{ .Values.producer.service.port }}
+      targetPort: {{ .Values.producer.service.port }}
+      nodePort: {{ .Values.producer.service.nodePort }}
+  selector:
+    app: {{ .Values.producer.name }}
diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-producer/values.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-producer/values.yaml
new file mode 100644 (file)
index 0000000..9a71198
--- /dev/null
@@ -0,0 +1,32 @@
+#
+#   ========================LICENSE_START=================================
+#   O-RAN-SC
+#
+#   Copyright (C) 2024: OpenInfra Foundation Europe
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#   ========================LICENSE_END===================================
+#
+producer:
+  name: kafka-producer
+  replicaCount: 1
+  image:
+    repository: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-sample-icsproducer
+    tag: 0.0.1
+  service:
+    port: 8080
+    nodePort: 30080
+
+kafka:
+  host: kafka-service
+  port: 9092
index a473338..04ff8d2 100755 (executable)
@@ -492,10 +492,20 @@ for __httpx in $TESTED_PROTOCOLS ; do
 
         a1pms_api_get_policy_status 404 1
         a1pms_api_get_policy_status 404 2
-        VAL='NOT IN EFFECT'
-        a1pms_api_get_policy_status 200 5000 OSC "$VAL" "false"
+        if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then
+          VAL='NOT IN EFFECT'
+          VAL2="false"
+          VAL3=EMPTY
+          VAL4=EMPTY
+        else
+          VAL="NOT_ENFORCED"
+          VAL2="OTHER_REASON"
+          VAL3="NOT_ENFORCED"
+          VAL4="OTHER_REASON"
+        fi
+        a1pms_api_get_policy_status 200 5000 OSC "$VAL" "$VAL2"
         a1pms_api_get_policy_status 200 5100 STD "UNDEFINED"
-        a1pms_api_get_policy_status 200 5200 STD2 EMPTY EMPTY
+        a1pms_api_get_policy_status 200 5200 STD2 $VAL3 $VAL4
 
 
         deviation "TR10 - a1pms allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
index 0a53d59..103d74c 100755 (executable)
@@ -128,9 +128,14 @@ for __nb_httpx in $NB_TESTED_PROTOCOLS ; do
 
         controller_api_get_A1_policy_status 200 OSC ricsim_g1_1 1 4000
         controller_api_get_A1_policy_status 200 STD ricsim_g2_1 5000
-
-        VAL='NOT_ENFORCED'
-        controller_api_get_A1_policy_status 200 OSC ricsim_g1_1 1 4000 "$VAL" "OTHER_REASON"
+        if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then
+          VAL='NOT IN EFFECT'
+          VAL2="false"
+        else
+          VAL='NOT_ENFORCED'
+          VAL2="OTHER_REASON"
+        fi
+        controller_api_get_A1_policy_status 200 OSC ricsim_g1_1 1 4000 "$VAL" "$VAL2"
         controller_api_get_A1_policy_status 200 STD ricsim_g2_1 5000 "UNDEFINED"
 
         RESP=202
index 547492c..c8d3f6e 100755 (executable)
@@ -143,7 +143,13 @@ for __nb_httpx in $NB_TESTED_PROTOCOLS ; do
         controller_api_get_A1_policy_status 200 OSC ricsim_g1_1 1 4000
         controller_api_get_A1_policy_status 200 STD ricsim_g2_1 5000
 
-        VAL='NOT IN EFFECT'
+        if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H]$  || $TEST_ENV_PROFILE =~ ^ONAP-[A-L]$ ]]; then
+            VAL='NOT IN EFFECT'
+            VAL2="false"
+        else
+            VAL='NOT_ENFORCED'
+            VAL2="OTHER_REASON"
+        fi
         controller_api_get_A1_policy_status 200 OSC ricsim_g1_1 1 4000 "$VAL" "false"
         controller_api_get_A1_policy_status 200 STD ricsim_g2_1 5000 "UNDEFINED"
 
index 6c699d1..3dc724d 100755 (executable)
@@ -283,11 +283,17 @@ for interface in $TESTED_VARIANTS ; do
     done
 
     # Check status OSC
-    VAL='NOT IN EFFECT'
+    if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then
+      VAL='NOT IN EFFECT'
+      VAL2="false"
+    else
+      VAL='NOT_ENFORCED'
+      VAL2="OTHER_REASON"
+    fi
     for ((i=1; i<=$OSC_NUM_RICS; i++))
     do
-        a1pms_api_get_policy_status 200 $((3000+$i)) OSC "$VAL" "false"
-        a1pms_api_get_policy_status 200 $((4000+$i)) OSC "$VAL" "false"
+        a1pms_api_get_policy_status 200 $((3000+$i)) OSC "$VAL" "$VAL2"
+        a1pms_api_get_policy_status 200 $((4000+$i)) OSC "$VAL" "$VAL2"
     done
 
     # Note: Status callback is not tested since this callback (http POST) is made from the
index d53af8f..ef97938 100644 (file)
@@ -31,4 +31,6 @@ suite_setup
 
 ##########################################
 
-suite_complete
\ No newline at end of file
+suite_complete
+
+exit
index 7bee3fa..e93e1a7 100644 (file)
 TEST_DIRECTORY="test/auto-test"
 TEST_SCRIPT="./Suite-Verify-jobs.sh"
 DOCKER_COMPOSE_VERSION="v2.21.0"
+PULL_IMAGE_TYPE="remote-remove"
+RUN_MODE="docker"
+IMAGE_VERSION="release"
+ENV_FLAG="--env-file"
+ENV_FILE="../common/test_env-oran-h-release.sh"
 
 # Check if jq is installed, and install it if not
 if ! command -v jq &> /dev/null; then
@@ -50,7 +55,8 @@ fi
 
 cd "$TEST_DIRECTORY"
 sudo chmod 775 "$TEST_SCRIPT"
-"$TEST_SCRIPT" remote-remove docker release --env-file ../common/test_env-oran-h-release.sh
+"$TEST_SCRIPT" $PULL_IMAGE_TYPE $RUN_MODE $IMAGE_VERSION $ENV_FLAG $ENV_FILE
+exit_val=$?
 
 # Remove docker-compose after tests are done
 if command -v docker-compose &> /dev/null; then
@@ -62,3 +68,5 @@ if command -v jq &> /dev/null; then
     echo "Removing jq..."
     sudo apt-get remove -y jq
 fi
+
+exit $exit_val
index b80bb25..a0062ac 100644 (file)
@@ -1830,11 +1830,18 @@ a1pms_api_get_policy_status() {
                fi
                targetJson=$targetJson"}"
        elif [ "$3" == "OSC" ]; then
-               targetJson="{\"instance_status\":\"$4\""
-               if [ $# -eq 5 ]; then
-                       targetJson=$targetJson",\"has_been_deleted\":\"$5\""
-               fi
-               targetJson=$targetJson",\"created_at\":\"????\"}"
+         if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then
+      targetJson="{\"instance_status\":\"$4\""
+      if [ $# -eq 5 ]; then
+        targetJson=$targetJson",\"has_been_deleted\":\"$5\""
+      fi
+      targetJson=$targetJson",\"created_at\":\"????\"}"
+    else
+      targetJson="{\"enforceStatus\":\"$4\""
+      if [ $# -eq 5 ]; then
+        targetJson=$targetJson",\"enforceReason\":\"$5\"}"
+      fi
+    fi
        else
                __print_err "<response-code> (STD <enforce-status> [<reason>])|(OSC <instance-status> <has-been-deleted>)" $@
                return 1
index 4fd9de4..a18afe3 100644 (file)
@@ -588,8 +588,14 @@ controller_api_get_A1_policy_status() {
     if [ $# -ge 5 ] && [ $2 == "OSC" ]; then
         url="$ric_id/a1-p/policytypes/$4/policies/$UUID$5/status"
         if [ $# -gt 5 ]; then
-            targetJson="{\"enforceStatus\":\"$6\""
-            targetJson=$targetJson",\"enforceReason\":\"$7\"}"
+            if [[ $TEST_ENV_PROFILE =~ ^ORAN-[A-H] ]] || [[ $TEST_ENV_PROFILE =~ ^ONAP-[A-L] ]]; then
+              targetJson="{\"instance_status\":\"$6\""
+              targetJson=$targetJson",\"has_been_deleted\":\"$7\""
+              targetJson=$targetJson",\"created_at\":\"????\"}"
+            else
+              targetJson="{\"enforceStatus\":\"$6\""
+              targetJson=$targetJson",\"enforceReason\":\"$7\"}"
+            fi
         fi
                paramError=0
     elif [ $# -ge 4 ] && [ $2 == "STD" ]; then
index 3f5970c..21b67e9 100755 (executable)
@@ -3055,7 +3055,7 @@ __check_service_start() {
                                #If response is too long, truncate
                                result="...response text too long, omitted"
                        fi
-                       echo -ne " Waiting for {ENTITY} $BOLD${appname}$EBOLD service status on ${3}, result: $result${SAMELINE}"
+                       echo -ne " Waiting for ${ENTITY} $BOLD${appname}$EBOLD service status on ${url}, result: $result${SAMELINE}"
                        echo -ne " The ${ENTITY} $BOLD${appname}$EBOLD$GREEN is alive$EGREEN, responds to service status:$GREEN $result $EGREEN on ${url} after $(($SECONDS-$TSTART)) seconds"
                        a1pmsst=true
                        break
index 4117cdb..5728510 100644 (file)
@@ -94,8 +94,8 @@ suite_complete() {
 
     total=$((TCSUITE_PASS_CTR+TCSUITE_FAIL_CTR))
     if [ $TCSUITE_CTR -eq 0 ]; then
-               echo -e "\033[1mNo test cases seem to have executed. Check the script....\033[0m"
-       elif [ $total != $TCSUITE_CTR ]; then
+                   echo -e "\033[1mNo test cases seem to have executed. Check the script....\033[0m"
+         elif [ $total != $TCSUITE_CTR ]; then
         echo -e "\033[1mTotal number of test cases does not match the sum of passed and failed test cases. Check the script....\033[0m"
     fi
     echo "Number of test cases : " $TCSUITE_CTR
@@ -108,7 +108,13 @@ suite_complete() {
     echo "FAIL test cases"
     cat .tmp_tcsuite_fail
     echo ""
+    if [ $TCSUITE_FAIL_CTR -ne 0 ]; then
+      echo "###################################      Test suite completed with Tests FAIL     ##############################"
+      echo "#################################################################################################"
+    else
+      echo "###################################      Test suite completed      ##############################"
+      echo "#################################################################################################"
+    fi
 
-    echo "###################################      Test suite completed      ##############################"
-    echo "#################################################################################################"
+    exit $TCSUITE_FAIL_CTR
 }
\ No newline at end of file