--- /dev/null
+# 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/
--- /dev/null
+apiVersion: v2
+name: ics-consumer
+description: A Helm chart for Kubernetes
+type: application
+version: 0.1.0
+appVersion: "1.16.0"
--- /dev/null
+#
+# ========================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 }}"
--- /dev/null
+#
+# ========================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 }}
--- /dev/null
+#
+# ========================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
--- /dev/null
+# 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/
--- /dev/null
+apiVersion: v2
+name: ics-producer
+description: A Helm chart for Kubernetes
+type: application
+version: 0.1.0
+appVersion: "1.16.0"
--- /dev/null
+#
+# ========================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 }}"
--- /dev/null
+#
+# ========================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 }}
--- /dev/null
+#
+# ========================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
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"
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
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"
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
##########################################
-suite_complete
\ No newline at end of file
+suite_complete
+
+exit
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
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
echo "Removing jq..."
sudo apt-get remove -y jq
fi
+
+exit $exit_val
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
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
#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
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
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