From dd88f8e183d4463db48e1db2abb5d101e3dfb02a Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 3 Mar 2022 23:27:08 +0100 Subject: [PATCH] Add jenkins charts Add jenkins charts + flavors + scripts modifications related to that Issue-ID: NONRTRIC-669 Signed-off-by: sebdet Change-Id: Idd0a16e6e7306e557abdfc30ef0eb470c437443b --- .../{ => cnf}/network-simulators-override.yaml | 0 .../network-simulators-topology-override.yaml | 2 +- .../onap-override.yaml} | 0 .../helm-override/{ => cnf}/oran-override.yaml | 0 .../helm-override/default/cicd-override.yaml | 36 + .../helm-override/default/cicd-proxy-override.yaml | 71 + .../default}/network-simulators-override.yaml | 0 .../network-simulators-topology-override.yaml | 194 +- .../helm-override/{ => default}/onap-override.yaml | 9 +- .../helm-override/default/oran-override.yaml | 160 ++ .../pythonsdk-tests/onap-override.yaml | 411 ++++ .../pythonsdk-tests/oran-override.yaml | 160 ++ smo-install/jenkins/README.txt | 26 + .../jenkins/gerrit/automatic-verify-pipeline | 126 ++ smo-install/jenkins/gerrit/manual-start-pipeline | 70 + smo-install/jenkins/gerrit/manual-stop-pipeline | 57 + smo-install/jenkins/gerrit/manual-tests-pipeline | 77 + .../jenkins/github/automatic-verify-pipeline | 116 ++ smo-install/jenkins/github/manual-start-pipeline | 70 + smo-install/jenkins/github/manual-stop-pipeline | 57 + smo-install/jenkins/github/manual-tests-pipeline | 77 + smo-install/onap_oom | 2 +- smo-install/oran_oom/Makefile | 2 +- smo-install/oran_oom/a1simulator/.helmignore | 22 - .../oran_oom/controlpanel/resources/nginx.conf | 28 - smo-install/oran_oom/enrichmentservice/.helmignore | 22 - smo-install/oran_oom/enrichmentservice/Chart.yaml | 21 - .../oran_oom/enrichmentservice/requirements.yaml | 20 - .../resources/config/application.yaml | 54 - .../enrichmentservice/templates/configmap.yaml | 29 - .../enrichmentservice/templates/ingress.yaml | 45 - .../enrichmentservice/templates/service.yaml | 42 - .../enrichmentservice/templates/statefulset.yaml | 82 - smo-install/oran_oom/enrichmentservice/values.yaml | 45 - .../templates/_enrichmentservice.tpl | 24 - smo-install/oran_oom/nonrtric/templates/pv3.yaml | 2 +- .../scripts/layer-0/0-setup-charts-museum.sh | 1 - smo-install/scripts/layer-1/1-build-all-charts.sh | 1 + .../{2-install-oran-cnf.sh => 2-install-cicd.sh} | 16 +- .../scripts/layer-2/2-install-nonrtric-only.sh | 10 +- smo-install/scripts/layer-2/2-install-oran.sh | 13 +- .../scripts/layer-2/2-install-simulators.sh | 9 +- .../scripts/layer-2/2-upgrade-simulators.sh | 9 +- smo-install/scripts/sub-scripts/build-tests.sh | 33 + smo-install/scripts/sub-scripts/clean-up.sh | 2 +- smo-install/scripts/sub-scripts/install-cicd.sh | 28 + .../scripts/sub-scripts/install-nonrtric.sh | 2 +- smo-install/scripts/sub-scripts/install-onap.sh | 2 +- smo-install/scripts/sub-scripts/uninstall-cicd.sh | 27 + .../scripts/sub-scripts/uninstall-nonrtric.sh | 1 + smo-install/scripts/sub-scripts/uninstall-onap.sh | 1 + .../scripts/sub-scripts/uninstall-simulators.sh | 1 + smo-install/scripts/uninstall-all.sh | 1 + .../test/pythonsdk/src/oransdk/dmaap/oran_dmaap.py | 45 - .../test/pythonsdk/src/oransdk/policy/clamp.py | 170 ++ .../policy/templates/commission_apex.json.j2 | 2114 ++++++++++++++++++++ .../src/orantests/configuration/settings.py | 10 + .../test/pythonsdk/src/orantests/conftest.py | 25 +- .../src/orantests/disabled_test_cl_apex.py | 222 ++ .../test/pythonsdk/src/orantests/smo/onap.py | 4 +- .../test/pythonsdk/src/orantests/smo/smo.py | 2 +- .../test/pythonsdk/src/orantests/test_dmaap.py | 44 - smo-install/test/pythonsdk/test/test_dmaap.py | 38 - smo-install/test/pythonsdk/test/test_settings.py | 4 - smo-install/test/pythonsdk/tox.ini | 5 +- smo-install/tests_oom/Makefile | 124 ++ .../du-simulator/Chart.yaml | 0 .../du-simulator/resources/config/config.json | 0 .../config/o-ran-sc-du-hello-world-operational.xml | 0 .../config/o-ran-sc-du-hello-world-running.xml | 0 .../du-simulator/templates/configmap.yaml | 0 .../du-simulator/templates/configmapenv.yaml | 0 .../du-simulator/templates/deployment.yaml | 0 .../du-simulator/templates/service.yaml | 0 .../du-simulator/values.yaml | 2 +- smo-install/tests_oom/oran-tests-suite/Chart.yaml | 9 + .../tests_oom/oran-tests-suite/requirements.yaml | 23 + .../oran-tests-suite/templates/secret.yaml | 20 + smo-install/tests_oom/oran-tests-suite/values.yaml | 351 ++++ smo-install/tests_oom/oran-tests/Chart.yaml | 19 + .../oran-tests/templates/configmapenv.yaml | 24 + .../tests_oom/oran-tests/templates/job.yaml | 72 + .../tests_oom/oran-tests/templates/service.yaml | 31 + smo-install/tests_oom/oran-tests/values.yaml | 31 + .../ru-du-simulators/Chart.yaml | 0 .../ru-du-simulators/requirements.yaml | 0 .../ru-du-simulators/values.yaml | 0 .../ru-simulator/Chart.yaml | 0 .../ru-simulator/resources/config/config.json | 0 .../config/ietf-hardware-operational.json | 0 .../resources/config/ietf-hardware-running.json | 0 .../config/ietf-interfaces-operational.xml | 0 .../resources/config/ietf-interfaces-running.xml | 0 .../ru-simulator/templates/configmap.yaml | 0 .../ru-simulator/templates/configmapenv.yaml | 0 .../ru-simulator/templates/deployment.yaml | 0 .../ru-simulator/templates/service.yaml | 0 .../ru-simulator/values.yaml | 2 +- .../topology-server/Chart.yaml | 0 .../topology-server/resources/config/config.json | 0 .../resources/config/tapi-common-operational.xml | 0 .../resources/config/tapi-common-running.xml | 0 .../topology-server/templates/configmap.yaml | 0 .../topology-server/templates/configmapenv.yaml | 0 .../topology-server/templates/deployment.yaml | 0 .../topology-server/templates/service.yaml | 0 .../topology-server/values.yaml | 2 +- 107 files changed, 5048 insertions(+), 661 deletions(-) rename smo-install/helm-override/{ => cnf}/network-simulators-override.yaml (100%) rename smo-install/helm-override/{ => cnf}/network-simulators-topology-override.yaml (99%) rename smo-install/helm-override/{onap-override-cnf.yaml => cnf/onap-override.yaml} (100%) rename smo-install/helm-override/{ => cnf}/oran-override.yaml (100%) create mode 100644 smo-install/helm-override/default/cicd-override.yaml create mode 100644 smo-install/helm-override/default/cicd-proxy-override.yaml rename smo-install/{test/pythonsdk/src/orantests/resources => helm-override/default}/network-simulators-override.yaml (100%) rename smo-install/{test/pythonsdk/src/orantests/resources => helm-override/default}/network-simulators-topology-override.yaml (72%) rename smo-install/helm-override/{ => default}/onap-override.yaml (98%) create mode 100644 smo-install/helm-override/default/oran-override.yaml create mode 100644 smo-install/helm-override/pythonsdk-tests/onap-override.yaml create mode 100644 smo-install/helm-override/pythonsdk-tests/oran-override.yaml create mode 100644 smo-install/jenkins/README.txt create mode 100644 smo-install/jenkins/gerrit/automatic-verify-pipeline create mode 100644 smo-install/jenkins/gerrit/manual-start-pipeline create mode 100644 smo-install/jenkins/gerrit/manual-stop-pipeline create mode 100644 smo-install/jenkins/gerrit/manual-tests-pipeline create mode 100644 smo-install/jenkins/github/automatic-verify-pipeline create mode 100644 smo-install/jenkins/github/manual-start-pipeline create mode 100644 smo-install/jenkins/github/manual-stop-pipeline create mode 100644 smo-install/jenkins/github/manual-tests-pipeline delete mode 100644 smo-install/oran_oom/a1simulator/.helmignore delete mode 100644 smo-install/oran_oom/controlpanel/resources/nginx.conf delete mode 100644 smo-install/oran_oom/enrichmentservice/.helmignore delete mode 100644 smo-install/oran_oom/enrichmentservice/Chart.yaml delete mode 100644 smo-install/oran_oom/enrichmentservice/requirements.yaml delete mode 100644 smo-install/oran_oom/enrichmentservice/resources/config/application.yaml delete mode 100644 smo-install/oran_oom/enrichmentservice/templates/configmap.yaml delete mode 100644 smo-install/oran_oom/enrichmentservice/templates/ingress.yaml delete mode 100644 smo-install/oran_oom/enrichmentservice/templates/service.yaml delete mode 100644 smo-install/oran_oom/enrichmentservice/templates/statefulset.yaml delete mode 100644 smo-install/oran_oom/enrichmentservice/values.yaml delete mode 100644 smo-install/oran_oom/nonrtric-common/templates/_enrichmentservice.tpl rename smo-install/scripts/layer-2/{2-install-oran-cnf.sh => 2-install-cicd.sh} (81%) create mode 100755 smo-install/scripts/sub-scripts/build-tests.sh create mode 100755 smo-install/scripts/sub-scripts/install-cicd.sh create mode 100755 smo-install/scripts/sub-scripts/uninstall-cicd.sh delete mode 100644 smo-install/test/pythonsdk/src/oransdk/dmaap/oran_dmaap.py create mode 100644 smo-install/test/pythonsdk/src/oransdk/policy/clamp.py create mode 100644 smo-install/test/pythonsdk/src/oransdk/policy/templates/commission_apex.json.j2 create mode 100644 smo-install/test/pythonsdk/src/orantests/disabled_test_cl_apex.py delete mode 100644 smo-install/test/pythonsdk/src/orantests/test_dmaap.py delete mode 100644 smo-install/test/pythonsdk/test/test_dmaap.py delete mode 100644 smo-install/test/pythonsdk/test/test_settings.py create mode 100644 smo-install/tests_oom/Makefile rename smo-install/{oran_oom => tests_oom}/du-simulator/Chart.yaml (100%) rename smo-install/{oran_oom => tests_oom}/du-simulator/resources/config/config.json (100%) rename smo-install/{oran_oom => tests_oom}/du-simulator/resources/config/o-ran-sc-du-hello-world-operational.xml (100%) rename smo-install/{oran_oom => tests_oom}/du-simulator/resources/config/o-ran-sc-du-hello-world-running.xml (100%) rename smo-install/{oran_oom => tests_oom}/du-simulator/templates/configmap.yaml (100%) rename smo-install/{oran_oom => tests_oom}/du-simulator/templates/configmapenv.yaml (100%) rename smo-install/{oran_oom => tests_oom}/du-simulator/templates/deployment.yaml (100%) rename smo-install/{oran_oom => tests_oom}/du-simulator/templates/service.yaml (100%) rename smo-install/{oran_oom => tests_oom}/du-simulator/values.yaml (98%) create mode 100644 smo-install/tests_oom/oran-tests-suite/Chart.yaml create mode 100644 smo-install/tests_oom/oran-tests-suite/requirements.yaml create mode 100644 smo-install/tests_oom/oran-tests-suite/templates/secret.yaml create mode 100644 smo-install/tests_oom/oran-tests-suite/values.yaml create mode 100644 smo-install/tests_oom/oran-tests/Chart.yaml create mode 100644 smo-install/tests_oom/oran-tests/templates/configmapenv.yaml create mode 100644 smo-install/tests_oom/oran-tests/templates/job.yaml create mode 100644 smo-install/tests_oom/oran-tests/templates/service.yaml create mode 100644 smo-install/tests_oom/oran-tests/values.yaml rename smo-install/{oran_oom => tests_oom}/ru-du-simulators/Chart.yaml (100%) rename smo-install/{oran_oom => tests_oom}/ru-du-simulators/requirements.yaml (100%) rename smo-install/{oran_oom => tests_oom}/ru-du-simulators/values.yaml (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/Chart.yaml (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/resources/config/config.json (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/resources/config/ietf-hardware-operational.json (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/resources/config/ietf-hardware-running.json (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/resources/config/ietf-interfaces-operational.xml (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/resources/config/ietf-interfaces-running.xml (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/templates/configmap.yaml (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/templates/configmapenv.yaml (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/templates/deployment.yaml (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/templates/service.yaml (100%) rename smo-install/{oran_oom => tests_oom}/ru-simulator/values.yaml (98%) rename smo-install/{oran_oom => tests_oom}/topology-server/Chart.yaml (100%) rename smo-install/{oran_oom => tests_oom}/topology-server/resources/config/config.json (100%) rename smo-install/{oran_oom => tests_oom}/topology-server/resources/config/tapi-common-operational.xml (100%) rename smo-install/{oran_oom => tests_oom}/topology-server/resources/config/tapi-common-running.xml (100%) rename smo-install/{oran_oom => tests_oom}/topology-server/templates/configmap.yaml (100%) rename smo-install/{oran_oom => tests_oom}/topology-server/templates/configmapenv.yaml (100%) rename smo-install/{oran_oom => tests_oom}/topology-server/templates/deployment.yaml (100%) rename smo-install/{oran_oom => tests_oom}/topology-server/templates/service.yaml (100%) rename smo-install/{oran_oom => tests_oom}/topology-server/values.yaml (99%) diff --git a/smo-install/helm-override/network-simulators-override.yaml b/smo-install/helm-override/cnf/network-simulators-override.yaml similarity index 100% rename from smo-install/helm-override/network-simulators-override.yaml rename to smo-install/helm-override/cnf/network-simulators-override.yaml diff --git a/smo-install/helm-override/network-simulators-topology-override.yaml b/smo-install/helm-override/cnf/network-simulators-topology-override.yaml similarity index 99% rename from smo-install/helm-override/network-simulators-topology-override.yaml rename to smo-install/helm-override/cnf/network-simulators-topology-override.yaml index b9e9ee04..1dc1d359 100644 --- a/smo-install/helm-override/network-simulators-topology-override.yaml +++ b/smo-install/helm-override/cnf/network-simulators-topology-override.yaml @@ -287,7 +287,7 @@ du-simulator: administrativeState: locked operationalState: enabled running: - administrativeState: unlocked + administrativeState: locked simulatedFaults: - name: fault1 diff --git a/smo-install/helm-override/onap-override-cnf.yaml b/smo-install/helm-override/cnf/onap-override.yaml similarity index 100% rename from smo-install/helm-override/onap-override-cnf.yaml rename to smo-install/helm-override/cnf/onap-override.yaml diff --git a/smo-install/helm-override/oran-override.yaml b/smo-install/helm-override/cnf/oran-override.yaml similarity index 100% rename from smo-install/helm-override/oran-override.yaml rename to smo-install/helm-override/cnf/oran-override.yaml diff --git a/smo-install/helm-override/default/cicd-override.yaml b/smo-install/helm-override/default/cicd-override.yaml new file mode 100644 index 00000000..c1f02957 --- /dev/null +++ b/smo-install/helm-override/default/cicd-override.yaml @@ -0,0 +1,36 @@ +# Copyright © 2021-2022 AT&T Intellectual Property +# +# 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. + +# Static Defaults +testsSuite: + jenkins: true + tests: false + +oran-tests: + oranTests: + name: orantests1 + flag: true + commitId: 83be1833161166e663098ab09f56551fc83b84c0 + +github: + username: "username" + password: "token_api" + +gerrit: + username: "username" + password: "token_api" + +jenkins: + controller: + jenkinsUrl: "http://smo-jenkins:32080" diff --git a/smo-install/helm-override/default/cicd-proxy-override.yaml b/smo-install/helm-override/default/cicd-proxy-override.yaml new file mode 100644 index 00000000..71e65741 --- /dev/null +++ b/smo-install/helm-override/default/cicd-proxy-override.yaml @@ -0,0 +1,71 @@ +# Copyright © 2021-2022 AT&T Intellectual Property +# +# 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. + +# Static Defaults +testsSuite: + jenkins: false + tests: true + +oran-tests: + oranTests: + name: orantests1 + flag: true + commitId: 83be1833161166e663098ab09f56551fc83b84c0 + +github: + username: "username" + password: "token_api" + +gerrit: + username: "username" + password: "token_api" + +proxyAddress: &proxyAddress "your.proxy" +proxyPort: &proxyPort "8080" +noProxy: &noProxy ".svc.cluster.local,localhost,10.152.183.1,10.1.0.0/16,10.152.183.0/24,127.0.0.1,::1" +fullProxyAddress: &fullProxyAddress "http://your.proxy:8080" +javaOptions: &javaOptions "-Dhttp.proxyHost=your.proxy -Dhttp.proxyPort=8080 -Dhttps.proxyHost=your.proxy -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=svc.cluster.local,localhost,10.1.0.0/16,10.152.183.0/24,10.152.183.1,127.0.0.1,::1 -Dhttps.nonProxyHosts=svc.cluster.local,localhost,10.1.0.0/16,10.152.183.0/24,10.152.183.1,127.0.0.1,::1" + +jenkins: + controller: + jenkinsUrl: "http://smo-jenkins:32080" + JCasC: + configScripts: + proxy: | + jenkins: + proxy: + name: "your.proxy" + noProxyHost: ".svc.cluster.local,localhost,10.152.183.1,10.1.0.0/16,10.152.183.0/24,127.0.0.1,::1" + port: "8080" + initContainerEnv: + - name: http_proxy + value: *fullProxyAddress + - name: https_proxy + value: *fullProxyAddress + - name: no_proxy + value: *noProxy + - name: JDK_JAVA_OPTIONS + value: *javaOptions + + containerEnv: + - name: http_proxy + value: *fullProxyAddress + - name: https_proxy + value: *fullProxyAddress + - name: no_proxy + value: *noProxy + - name: JDK_JAVA_OPTIONS + value: *javaOptions + + javaOpts: *javaOptions diff --git a/smo-install/test/pythonsdk/src/orantests/resources/network-simulators-override.yaml b/smo-install/helm-override/default/network-simulators-override.yaml similarity index 100% rename from smo-install/test/pythonsdk/src/orantests/resources/network-simulators-override.yaml rename to smo-install/helm-override/default/network-simulators-override.yaml diff --git a/smo-install/test/pythonsdk/src/orantests/resources/network-simulators-topology-override.yaml b/smo-install/helm-override/default/network-simulators-topology-override.yaml similarity index 72% rename from smo-install/test/pythonsdk/src/orantests/resources/network-simulators-topology-override.yaml rename to smo-install/helm-override/default/network-simulators-topology-override.yaml index b500b269..1dc1d359 100644 --- a/smo-install/test/pythonsdk/src/orantests/resources/network-simulators-topology-override.yaml +++ b/smo-install/helm-override/default/network-simulators-topology-override.yaml @@ -188,88 +188,158 @@ ru-simulator: du-simulator: dus: - name: o-du-1121 - rus: - - name: o-ru-11211 - administrativeState: LOCKED - operationalState: ENABLED - status: disconnected + operational: + administrativeState: locked + operationalState: enabled + running: + administrativeState: unlocked + cell: + name: cell-1 + trafficState: active + localId: 1 + physicalCellId: 1 + operational: + administrativeState: locked + operationalState: enabled + running: + administrativeState: unlocked + radioResourcePolicy: + name: rrm-pol-1 + resourceType: prb + operational: + administrativeState: locked + operationalState: enabled + running: + administrativeState: unlocked simulatedFaults: - - name: o-ru-11211 - condition: "O-RU Port Down" - severity: CRITICAL - specificProblem: "O-RU Port Down" - faultSeverity: CRITICAL + - name: fault1 + condition: "CPRI Port Down" + severity: MAJOR + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR cleared: false - text: "O-RU Port Down" - - name: o-ru-11211 - condition: "O-RU Port Down" + text: "CPRI Port Down" + object: "Slot-0-Port-A" + - name: fault1-close + condition: "CPRI Port Down" severity: NORMAL - specificProblem: "O-RU Port Down" - faultSeverity: CRITICAL + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR + cleared: true + text: "CPRI Port Down" + object: "Slot-0-Port-A" + + - name: fault2 + condition: "CPRI Port Down" + severity: MAJOR + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR + cleared: false + text: "CPRI Port Down" + object: "Slot-0-Port-C" + - name: fault2-close + condition: "CPRI Port Down" + severity: NORMAL + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR + cleared: true + text: "CPRI Port Down" + object: "Slot-0-Port-C" + + - name: fault3 + condition: "CPRI Port Down" + severity: MAJOR + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR + cleared: false + text: "CPRI Port Down" + object: "Slot-2-Port-B" + - name: fault3-close + condition: "CPRI Port Down" + severity: NORMAL + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR cleared: true - text: "O-RU Port Down" + text: "CPRI Port Down" + object: "Slot-2-Port-B" - name: o-du-1122 - rus: - - name: o-ru-11221 - administrativeState: LOCKED - operationalState: ENABLED - status: disconnected - - name: o-ru-11222 - administrativeState: UNLOCKED - operationalState: ENABLED - status: connected - - name: o-ru-11223 - administrativeState: LOCKED - operationalState: DISABLED - status: unable-to-connect + operational: + administrativeState: locked + operationalState: enabled + running: + administrativeState: unlocked + cell: + name: cell-2 + trafficState: active + localId: 2 + physicalCellId: 2 + operational: + administrativeState: locked + operationalState: enabled + running: + administrativeState: unlocked + radioResourcePolicy: + name: rrm-pol-2 + resourceType: prb + operational: + administrativeState: locked + operationalState: enabled + running: + administrativeState: locked simulatedFaults: - - name: o-ru-11221 - condition: "O-RU Port Down" - severity: CRITICAL - specificProblem: "O-RU Port Down" - faultSeverity: CRITICAL + - name: fault1 + condition: "CPRI Port Down" + severity: MAJOR + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR cleared: false - text: "O-RU Port Down" - - name: o-ru-11221 - condition: "O-RU Port Down" + text: "CPRI Port Down" + object: "Slot-0-Port-A" + - name: fault1-close + condition: "CPRI Port Down" severity: NORMAL - specificProblem: "O-RU Port Down" - faultSeverity: CRITICAL + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR cleared: true - text: "O-RU Port Down" + text: "CPRI Port Down" + object: "Slot-0-Port-A" - - name: o-ru-11222 - condition: "O-RU Port Down" - severity: CRITICAL - specificProblem: "O-RU Port Down" - faultSeverity: CRITICAL + - name: fault2 + condition: "CPRI Port Down" + severity: MAJOR + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR cleared: false - text: "O-RU Port Down" - - name: o-ru-11222 - condition: "O-RU Port Down" + text: "CPRI Port Down" + object: "Slot-0-Port-C" + - name: fault2-close + condition: "CPRI Port Down" severity: NORMAL - specificProblem: "O-RU Port Down" - faultSeverity: CRITICAL + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR cleared: true - text: "O-RU Port Down" + text: "CPRI Port Down" + object: "Slot-0-Port-C" - - name: o-ru-11223 - condition: "O-RU Port Down" - severity: CRITICAL - specificProblem: "O-RU Port Down" - faultSeverity: CRITICAL + - name: fault3 + condition: "CPRI Port Down" + severity: MAJOR + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR cleared: false - text: "O-RU Port Down" - - name: o-ru-11223 - condition: "O-RU Port Down" + text: "CPRI Port Down" + object: "Slot-2-Port-B" + - name: fault3-close + condition: "CPRI Port Down" severity: NORMAL - specificProblem: "O-RU Port Down" - faultSeverity: CRITICAL + specificProblem: "CPRI Port Down" + faultSeverity: MAJOR cleared: true - text: "O-RU Port Down" + text: "CPRI Port Down" + object: "Slot-2-Port-B" topology-server: simulatedFaults: diff --git a/smo-install/helm-override/onap-override.yaml b/smo-install/helm-override/default/onap-override.yaml similarity index 98% rename from smo-install/helm-override/onap-override.yaml rename to smo-install/helm-override/default/onap-override.yaml index 950fd2d1..e4506aca 100644 --- a/smo-install/helm-override/onap-override.yaml +++ b/smo-install/helm-override/default/onap-override.yaml @@ -302,15 +302,16 @@ policy: policy-distribution: enabled: false policy-clamp-be: - enabled: false + enabled: true + image: onap/policy-clamp-backend:6.2-SNAPSHOT-latest policy-clamp-fe: - enabled: false + enabled: true policy-clamp-cl-runtime: enabled: true policy-clamp-cl-k8s-ppnt: enabled: true policy-gui: - enabled: false + enabled: true policy-nexus: enabled: false policy-clamp-cl-pf-ppnt: @@ -392,7 +393,7 @@ sdnc: sniro-emulator: enabled: false so: - enabled: false + enabled: false so-catalog-db-adapter: config: openStackUserName: "the username" diff --git a/smo-install/helm-override/default/oran-override.yaml b/smo-install/helm-override/default/oran-override.yaml new file mode 100644 index 00000000..c2ccb22c --- /dev/null +++ b/smo-install/helm-override/default/oran-override.yaml @@ -0,0 +1,160 @@ +# Copyright © 2017 Amdocs, Bell Canada +# Mofification Copyright © 2021 AT&T +# +# 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. + +################################################################# +# Global configuration overrides. +# +# These overrides will affect all helm charts (ie. applications) +# that are listed below and are 'enabled'. +################################################################# + +##### ORAN ##### + +######### NONRTRIC ######### + +nonrtric: + installPms: false + installA1controller: false + installA1simulator: true + installControlpanel: true + installInformationservice: true + installRappcatalogueservice: true + installNonrtricgateway: true + installKong: true + installORUApp: true + installTopology: true + installDmaapadapterservice: true + installDmaapmediatorservice: true + installHelmmanager: true + # override default mount path root directory + # referenced by persistent volumes and log files + persistence: + mountPath: /dockerdata-nfs + volume1: + # Set the size to 0 if you do not need the volume (if you are using Dynamic Volume Provisioning) + size: 2Gi + storageClassName: pms-storage + volume2: + # Set the size to 0 if you do not need the volume (if you are using Dynamic Volume Provisioning) + size: 2Gi + storageClassName: ics-storage + volume3: + size: 1Gi + storageClassName: helmmanager-storage + +common: + releasePrefix: r3-dev-nonrtric + ingressClassName: kong + +informationservice: + informationservice: + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be for instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) + size: 2Gi + storageClassName: ics-storage + ingress: + enabled: true + + +# Need to check the external port Availability +policymanagementservice: + policymanagementservice: + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be fon instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) + size: 2Gi + storageClassName: pms-storage + ingress: + enabled: true + +kong: + ingressController: + installCRDs: false + admin: + enabled: true + +helmmanager: + helmmanager: + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed si> + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be f> + storageClassName: helmmanager-storage + +controlpanel: + controlpanel: + ingress: + enabled: false + +oru-app: + simulators: + - simRu: o-ru-11221 + simDu: o-du-1122 + - simRu: o-ru-11222 + simDu: o-du-1122 + - simRu: o-ru-11223 + simDu: o-du-1122 + - simRu: o-ru-11211 + simDu: o-du-1121 + +a1simulator: + a1Sims: + - name: a1-sim-osc-0 + a1Version: OSC_2.1.0 + allowHttp: true + - name: a1-sim-osc-1 + a1Version: OSC_2.1.0 + allowHttp: true + - name: a1-sim-std-0 + a1Version: STD_1.1.3 + allowHttp: true + - name: a1-sim-std-1 + a1Version: STD_1.1.3 + allowHttp: true + - name: a1-sim-std2-0 + a1Version: STD_2.0.0 + allowHttp: true + - name: a1-sim-std2-1 + a1Version: STD_2.0.0 + allowHttp: true + + +######### RIC_AUX ######### +dashboard: + cipher: + enc: + key: AGLDdG4D04BKm2IxIWEr8o== + portalapi: + security: false + appname: RIC-Dashboard + username: Default + password: password + ecomp_redirect_url: https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm + ecomp_rest_url: http://portal-app:8989/ONAPPORTAL/auxapi + ueb_app_key: uebkey + # instances are passed as string and reformatted into YAML + ricinstances: | + regions: + - + name: Region PIZ-R4 + instances: + - + key: i1 + name: RIC + appUrlPrefix: http://ric-entry + caasUrlPrefix: http://caas-ingress-is-REC-only + pltUrlPrefix: http://ric-entry + + diff --git a/smo-install/helm-override/pythonsdk-tests/onap-override.yaml b/smo-install/helm-override/pythonsdk-tests/onap-override.yaml new file mode 100644 index 00000000..e4506aca --- /dev/null +++ b/smo-install/helm-override/pythonsdk-tests/onap-override.yaml @@ -0,0 +1,411 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Modifications Copyright © 2021 AT&T +# +# 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. + +################################################################# +# Global configuration overrides. +# +# These overrides will affect all helm charts (ie. applications) +# that are listed below and are 'enabled'. +################################################################# +global: + # Change to an unused port prefix range to prevent port conflicts + # with other instances running within the same k8s cluster + repository: nexus3.onap.org:10001 #__docker_proxy__ + nodePortPrefix: 302 + nodePortPrefixExt: 304 + masterPassword: secretpassword + addTestingComponents: true + cmpv2Enabled: false + flavor: unlimited + # ONAP Repository + # Uncomment the following to enable the use of a single docker + # repository but ONLY if your repository mirrors all ONAP + # docker images. This includes all images from dockerhub and + # any other repository that hosts images for ONAP components. + #repository: nexus3.onap.org:10001 + + # readiness check - temporary repo until images migrated to nexus3 + readinessRepository: oomk8s + # logging agent - temporary repo until images migrated to nexus3 + loggingRepository: docker.elastic.co + + # image pull policy + pullPolicy: IfNotPresent + + # override default mount path root directory + # referenced by persistent volumes and log files + persistence: + mountPath: /dockerdata-nfs + + # flag to enable debugging - application support required + debugEnabled: false + +################################################################# +# Enable/disable and configure helm charts (ie. applications) +# to customize the ONAP deployment. +################################################################# +a1policymanagement: + enabled: true + rics: + - name: ric1 + link: http://a1-sim-osc-0.nonrtric:8085 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + - name: ric2 + link: http://a1-sim-osc-1.nonrtric:8085 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + - name: ric3 + link: http://a1-sim-std-0.nonrtric:8085 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + - name: ric4 + link: http://a1-sim-std-1.nonrtric:8085 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + - name: ric5 + link: http://a1-sim-std2-0.nonrtric:8085 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 + - name: ric6 + link: http://a1-sim-std2-1.nonrtric:8085 + controller: controller1 + managedElementIds: + - kista_1 + - kista_2 +aaf: + enabled: true + aaf-service: + readiness: + initialDelaySeconds: 150 +aai: + enabled: false + flavorOverride: unlimited + global: + flavorOverride: unlimited + cassandra: + replicas: 3 + aai-cassandra: + flavorOverride: unlimited + replicaCount: 3 + aai-babel: + flavorOverride: unlimited + aai-data-router: + flavorOverride: unlimited + aai-elasticsearch: + flavorOverride: unlimited + aai-graphadmin: + flavorOverride: unlimited + aai-modelloader: + flavorOverride: unlimited + aai-resources: + flavorOverride: unlimited + aai-schema-service: + flavorOverride: unlimited + aai-search-data: + flavorOverride: unlimited + aai-sparky-be: + flavorOverride: unlimited + readiness: + initialDelaySeconds: 150 + periodSeconds: 20 + timeoutSeconds: 10 + aai-traversal: + flavorOverride: unlimited +appc: + enabled: false +cassandra: + enabled: false + replicaCount: 3 + config: + cluster_domain: cluster.local + heap: + max: 1G + min: 256M + liveness: + initialDelaySeconds: 60 + periodSeconds: 20 + timeoutSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + + readiness: + initialDelaySeconds: 120 + periodSeconds: 20 + timeoutSeconds: 10 + successThreshold: 1 + failureThreshold: 3 +cds: + enabled: false +cli: + enabled: false +contrib: + enabled: true + awx: + enabled: false + netbox: + enabled: false +consul: + enabled: true + consul-server: + replicaCount: 1 +cps: + enabled: false +dcaegen2: + enabled: true + dcae-bootstrap: + enabled: false + dcae-cloudify-manager: + enabled: true + dcae-config-binding-service: + enabled: true + dcae-dashboard: + enabled: false + dcae-deployment-handler: + enabled: false + dcae-healthcheck: + enabled: true + dcae-inventory-api: + enabled: false + dcae-policy-handler: + enabled: false + dcae-servicechange-handler: + enabled: false + dcae-ves-openapi-manager: + enabled: false +dcaegen2-services: + enabled: true + dcae-bbs-eventprocessor-ms: + enabled: false + dcae-datafile-collector: + enabled: false + dcae-datalake-admin-ui: + enabled: false + dcae-datalake-des: + enabled: false + dcae-datalake-feeder: + enabled: false + dcae-heartbeat: + enabled: false + dcae-hv-ves-collector: + enabled: false + dcae-kpi-ms: + enabled: false + dcae-ms-healthcheck: + enabled: false + dcae-pm-mapper: + enabled: false + dcae-pmsh: + enabled: false + dcae-prh: + enabled: false + dcae-restconf-collector: + enabled: false + dcae-slice-analysis-ms: + enabled: false + dcae-snmptrap-collector: + enabled: false + dcae-son-handler: + enabled: false + dcae-tcagen2: + enabled: false + dcae-ves-collector: + enabled: true + dcae-ves-mapper: + enabled: false +dcaemod: + enabled: false +holmes: + enabled: false +dmaap: + enabled: true + message-router: + message-router-zookeeper: + replicaCount: 1 + zookeeperServers: 1 + message-router-kafka: + zookeeper: + replicaCount: 1 + replicaCount: 1 + defaultpartitions: 1 + configurationOverrides: + "offsets.topic.replication.factor": "1" + "log.dirs": "/var/lib/kafka/data" + "log.retention.hours": "168" + "num.partitions": "1" + "transaction.state.log.replication.factor": "1" + "transaction.state.log.min.isr": "1" + "num.recovery.threads.per.data.dir": "5" + "zookeeper.connection.timeout.ms": "6000" + "default.replication.factor": "1" + "zookeeper.set.acl": "true" + +esr: + enabled: false +log: + enabled: false + log-logstash: + replicaCount: 1 +mariadb-galera: + enabled: true + replicaCount: 1 +modeling: + enabled: false +msb: + enabled: false +multicloud: + enabled: false +nbi: + enabled: false +oof: + enabled: false +platform: + enabled: true +policy: + enabled: true + policy-api: + enabled: true + policy-pap: + enabled: true + policy-xacml-pdp: + enabled: false + policy-apex-pdp: + enabled: true + policy-drools-pdp: + enabled: false + policy-distribution: + enabled: false + policy-clamp-be: + enabled: true + image: onap/policy-clamp-backend:6.2-SNAPSHOT-latest + policy-clamp-fe: + enabled: true + policy-clamp-cl-runtime: + enabled: true + policy-clamp-cl-k8s-ppnt: + enabled: true + policy-gui: + enabled: true + policy-nexus: + enabled: false + policy-clamp-cl-pf-ppnt: + enabled: true + policy-clamp-cl-http-ppnt: + enabled: true + +pomba: + enabled: false +portal: + enabled: false +robot: + enabled: false +sdc: + enabled: false + sdc-be: + config: + javaOptions: "-Xmx1g -Xms512m" + liveness: + periodSeconds: 300 + timeoutSeconds: 180 + readiness: + periodSeconds: 300 + timeoutSeconds: 240 + sdc-fe: + resources: + small: + limits: + cpu: 1 + memory: 2Gi + requests: + cpu: 100m + memory: 500Mi + +sdnc: + enabled: true + replicaCount: 1 + elasticsearch: + master: + replicaCount: 1 + mysql: + replicaCount: 1 + ueb-listener: + enabled: false + sdnc-ansible-server: + enabled: true + dgbuilder: + enabled: true + cds: + enabled: false + sdnc-web: + config: + topologyserver: + enabled: true + topologyserverUrl: http://topology.nonrtric:3001 + config: + sdnr: + enabled: true + # mode: web - SDNC contains device manager only plus dedicated webserver service for ODLUX (default), + # mode: dm - SDNC contains sdnr device manager + ODLUX components + mode: dm + # sdnronly: true starts sdnc container with odl and sdnrwt features only + sdnronly: false + sdnrdbTrustAllCerts: true + mountpointRegistrarEnabled: true + mountpointStateProviderEnabled: true + netconfCallHome: + enabled: true + vesCollector: + enabled: true + tls: + enabled: true + trustAllCertificates: true + username: sample1 + password: sample1 + address: dcae-ves-collector.onap + port: 8443 + eventLogMsgDetail: LONG +sniro-emulator: + enabled: false +so: + enabled: false + so-catalog-db-adapter: + config: + openStackUserName: "the username" + openStackKeyStoneUrl: "http://10.12.25.2:5000/v3" + openStackEncryptedPasswordHere: "1DD1B3B4477FBAFAFEA617C575639C6F09E95446B5AE1F46C72B8FD960219ABB0DBA997790FCBB12" + openStackKeystoneVersion: "KEYSTONE_V3" +uui: + enabled: false +vfc: + enabled: false +vid: + enabled: false +vnfsdk: + enabled: false + diff --git a/smo-install/helm-override/pythonsdk-tests/oran-override.yaml b/smo-install/helm-override/pythonsdk-tests/oran-override.yaml new file mode 100644 index 00000000..c2ccb22c --- /dev/null +++ b/smo-install/helm-override/pythonsdk-tests/oran-override.yaml @@ -0,0 +1,160 @@ +# Copyright © 2017 Amdocs, Bell Canada +# Mofification Copyright © 2021 AT&T +# +# 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. + +################################################################# +# Global configuration overrides. +# +# These overrides will affect all helm charts (ie. applications) +# that are listed below and are 'enabled'. +################################################################# + +##### ORAN ##### + +######### NONRTRIC ######### + +nonrtric: + installPms: false + installA1controller: false + installA1simulator: true + installControlpanel: true + installInformationservice: true + installRappcatalogueservice: true + installNonrtricgateway: true + installKong: true + installORUApp: true + installTopology: true + installDmaapadapterservice: true + installDmaapmediatorservice: true + installHelmmanager: true + # override default mount path root directory + # referenced by persistent volumes and log files + persistence: + mountPath: /dockerdata-nfs + volume1: + # Set the size to 0 if you do not need the volume (if you are using Dynamic Volume Provisioning) + size: 2Gi + storageClassName: pms-storage + volume2: + # Set the size to 0 if you do not need the volume (if you are using Dynamic Volume Provisioning) + size: 2Gi + storageClassName: ics-storage + volume3: + size: 1Gi + storageClassName: helmmanager-storage + +common: + releasePrefix: r3-dev-nonrtric + ingressClassName: kong + +informationservice: + informationservice: + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be for instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) + size: 2Gi + storageClassName: ics-storage + ingress: + enabled: true + + +# Need to check the external port Availability +policymanagementservice: + policymanagementservice: + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be fon instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) + size: 2Gi + storageClassName: pms-storage + ingress: + enabled: true + +kong: + ingressController: + installCRDs: false + admin: + enabled: true + +helmmanager: + helmmanager: + persistence: + # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed si> + # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be f> + storageClassName: helmmanager-storage + +controlpanel: + controlpanel: + ingress: + enabled: false + +oru-app: + simulators: + - simRu: o-ru-11221 + simDu: o-du-1122 + - simRu: o-ru-11222 + simDu: o-du-1122 + - simRu: o-ru-11223 + simDu: o-du-1122 + - simRu: o-ru-11211 + simDu: o-du-1121 + +a1simulator: + a1Sims: + - name: a1-sim-osc-0 + a1Version: OSC_2.1.0 + allowHttp: true + - name: a1-sim-osc-1 + a1Version: OSC_2.1.0 + allowHttp: true + - name: a1-sim-std-0 + a1Version: STD_1.1.3 + allowHttp: true + - name: a1-sim-std-1 + a1Version: STD_1.1.3 + allowHttp: true + - name: a1-sim-std2-0 + a1Version: STD_2.0.0 + allowHttp: true + - name: a1-sim-std2-1 + a1Version: STD_2.0.0 + allowHttp: true + + +######### RIC_AUX ######### +dashboard: + cipher: + enc: + key: AGLDdG4D04BKm2IxIWEr8o== + portalapi: + security: false + appname: RIC-Dashboard + username: Default + password: password + ecomp_redirect_url: https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm + ecomp_rest_url: http://portal-app:8989/ONAPPORTAL/auxapi + ueb_app_key: uebkey + # instances are passed as string and reformatted into YAML + ricinstances: | + regions: + - + name: Region PIZ-R4 + instances: + - + key: i1 + name: RIC + appUrlPrefix: http://ric-entry + caasUrlPrefix: http://caas-ingress-is-REC-only + pltUrlPrefix: http://ric-entry + + diff --git a/smo-install/jenkins/README.txt b/smo-install/jenkins/README.txt new file mode 100644 index 00000000..9140eba0 --- /dev/null +++ b/smo-install/jenkins/README.txt @@ -0,0 +1,26 @@ +The ORAN SMO CI/CD is structured like this: +--> Helm chart deploys Jenkins. + --> Contains Jobs, jenkins config in JCasC + --> Jobs defined in Job DSL in JCasC + --> They refer to github Pipelines written in Groovy Script. + + +Doc for jenkins: +---------------- + +Jenkins helm charts: +https://github.com/jenkinsci/helm-charts + +Possible values for charts: +https://github.com/jenkinsci/helm-charts/blob/main/charts/jenkins/values.yaml +https://github.com/jenkinsci/helm-charts/blob/main/charts/jenkins/VALUES_SUMMARY.md + +--> controller.JCasC.configScripts defines the advanced JCasC config (the one that can be exported in jenkins) + Each yaml key will create a config file with the content specified below that key + +JCasc config thruth (local): +https://192.168.1.46:32080/configuration-as-code + +Job DSL schema thruth (local) +http://192.168.1.46:32080/plugin/job-dsl/api-viewer/index.html + diff --git a/smo-install/jenkins/gerrit/automatic-verify-pipeline b/smo-install/jenkins/gerrit/automatic-verify-pipeline new file mode 100644 index 00000000..30fa5a81 --- /dev/null +++ b/smo-install/jenkins/gerrit/automatic-verify-pipeline @@ -0,0 +1,126 @@ +lock('smo') { +podTemplate(yaml: ''' + apiVersion: v1 + kind: Pod + spec: + containers: + - name: jenkins-ubuntu + image: ubuntu:20.04 + command: + - sleep + args: + - 99d +''') { + node(POD_LABEL) { + + def proxies='' + def toxLog='' + sh 'printenv' + stage('Checkout') { + script { + if (env.GERRIT_REFNAME.startsWith('refs/changes/')) { + echo 'PULL REQUEST case detected' + gitInfo = checkout([$class: 'GitSCM', branches: [[name: 'changes/'+env.BRANCH_NAME]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: [[credentialsId: 'gerrit_username_pass', name: 'origin', refspec: '+refs/changes/*:refs/remotes/origin/changes/*', url: 'https://gerrit.o-ran-sc.org/r/a/it/dep']]]) + + } else { + echo 'BRANCH case detected' + gitInfo = checkout([$class: 'GitSCM', branches: [[name: env.BRANCH_NAME]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: [[credentialsId: 'gerrit_username_pass', name: 'origin', refspec: '+refs/heads/*:refs/remotes/origin/*', url: 'https://gerrit.o-ran-sc.org/r/a/it/dep']]]) + } + } + echo "Git: "+ gitInfo + gerritReview labels: [Verified: 0], message: env.HUDSON_URL+': Validating the SMO package ' + env.BUILD_URL + } + container('jenkins-ubuntu') { + stage ('Proxy settings') { + echo 'Proxy check' + script { + if (env.http_proxy) { + sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc' + sh 'cat ~/.wgetrc' + + sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc' + sh 'cat ~/.wgetrc' + + proxies='HTTPS_PROXY='+env.http_proxy+' ' + } + } + sh 'printenv' + + } + stage('Setup tools') { + echo 'Setup container' + sh 'printenv' + + sh 'apt-get update -y' + sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata' + sh 'apt-get install git wget sudo -y' + + sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl' + sh 'mv kubectl /usr/bin' + sh 'chmod a+x /usr/bin/kubectl' + + sh proxies+' ./smo-install/scripts/layer-0/0-setup-tests-env.sh' + sh proxies+' ./smo-install/scripts/layer-0/0-setup-charts-museum.sh' + sh proxies+' ./smo-install/scripts/layer-0/0-setup-helm3.sh' + sh 'kubectl version' + } + stage('Build ONAP charts') { + sh proxies+' ./smo-install/scripts/sub-scripts/build-onap.sh' + } + stage('Build ORAN charts') { + sh proxies+' ./smo-install/scripts/sub-scripts/build-oran.sh' + } + stage('Build TESTS charts') { + sh proxies+' ./smo-install/scripts/sub-scripts/build-tests.sh' + } + stage('Start SMO') { + sh './smo-install/scripts/layer-2/2-install-oran.sh pythonsdk-tests' + } + stage('Test ORAN') { + dir("smo-install/test/pythonsdk") { + echo 'Executing TOX tests' + try { + if (env.http_proxy) { + sh script: proxies+' NO_PROXY='+env.no_proxy+' tox > tox.log' + } else { + sh script: 'tox > tox.log' + } + echo 'TOX tests SUCCESS' + toxLog = readFile 'tox.log' + echo toxLog + toxLog = sh script: 'tail -40 tox.log',returnStdout: true + + gerritReview labels: [Verified: 0], message:env.HUDSON_URL+': SMO Build SUCCESSFUL ('+env.BUILD_URL+')\r\n\r\n'+toxLog + //gerritCheck checks: ['SMO:checker': 'SUCCESSFUL'] + currentBuild.result = 'SUCCESS' + } + catch(exec) { + echo 'TOX tests FAILURE' + toxLog = readFile 'tox.log' + echo toxLog + toxLog = sh script: 'tail -40 tox.log',returnStdout: true + + gerritReview labels: [Verified: 0], message:env.HUDSON_URL+': SMO Build FAILED, TOX tests have crashed ('+env.BUILD_URL+')\r\n\r\n'+toxLog + //gerritCheck checks: ['SMO:checker': 'FAILED'] + currentBuild.result = 'FAILURE' + } + } + } + stage('Stop SMO') { + sh './smo-install/scripts/sub-scripts/uninstall-nonrtric.sh' + sh './smo-install/scripts/sub-scripts/uninstall-onap.sh' + } + stage('Get Results') { + archiveArtifacts artifacts: 'smo-install/test/pythonsdk/src/orantests/pythonsdk.debug.log, **/reports/junit/*.xml', fingerprint: true + junit '**/reports/junit/*.xml' + + } + } + + } +} +} diff --git a/smo-install/jenkins/gerrit/manual-start-pipeline b/smo-install/jenkins/gerrit/manual-start-pipeline new file mode 100644 index 00000000..b0ca3157 --- /dev/null +++ b/smo-install/jenkins/gerrit/manual-start-pipeline @@ -0,0 +1,70 @@ +lock('smo') { +podTemplate(yaml: ''' + apiVersion: v1 + kind: Pod + spec: + containers: + - name: jenkins-ubuntu + image: ubuntu:20.04 + command: + - sleep + args: + - 99d +''') { + + node(POD_LABEL) { + def proxies='' + stage('Checkout') { + echo 'printenv' + checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: 'https://gerrit.o-ran-sc.org/r/it/dep']], branches: [[name: env.BRANCH]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]]], poll: false + } + container('jenkins-ubuntu') { + stage ('Proxy settings') { + echo 'Proxy check' + script { + if (env.http_proxy) { + sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc' + sh 'cat ~/.wgetrc' + + sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc' + sh 'cat ~/.wgetrc' + + proxies='HTTPS_PROXY='+env.http_proxy+' ' + } + } + sh 'printenv' + } + + stage('Setup tools') { + sh 'apt-get update -y' + sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata' + sh 'apt-get install git wget sudo -y' + sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl' + sh 'mv kubectl /usr/bin' + sh 'chmod a+x /usr/bin/kubectl' + sh 'kubectl version' + sh proxies+' ./smo-install/scripts/layer-0/0-setup-tests-env.sh' + sh proxies+' ./smo-install/scripts/layer-0/0-setup-charts-museum.sh' + sh proxies+' ./smo-install/scripts/layer-0/0-setup-helm3.sh' + } + stage('Build ONAP charts') { + sh proxies+' ./smo-install/scripts/sub-scripts/build-onap.sh' + } + stage('Build ORAN charts') { + sh proxies+' ./smo-install/scripts/sub-scripts/build-oran.sh' + } + stage('Build ONAP charts') { + sh proxies+' ./smo-install/scripts/sub-scripts/build-tests.sh' + } + stage('Start SMO') { + sh './smo-install/scripts/layer-2/2-install-oran.sh ' + env.FLAVOR + } + } + + } +} +} diff --git a/smo-install/jenkins/gerrit/manual-stop-pipeline b/smo-install/jenkins/gerrit/manual-stop-pipeline new file mode 100644 index 00000000..9e3fbc21 --- /dev/null +++ b/smo-install/jenkins/gerrit/manual-stop-pipeline @@ -0,0 +1,57 @@ +podTemplate(yaml: ''' + apiVersion: v1 + kind: Pod + spec: + containers: + - name: jenkins-ubuntu + image: ubuntu:20.04 + command: + - sleep + args: + - 99d +''') { + + node(POD_LABEL) { + def proxies='' + stage('Checkout') { + checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: 'https://gerrit.o-ran-sc.org/r/it/dep']], branches: [[name: env.BRANCH]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]]], poll: false + } + container('jenkins-ubuntu') { + stage ('Proxy settings') { + echo 'Proxy check' + script { + if (env.http_proxy) { + sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc' + sh 'cat ~/.wgetrc' + + sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc' + sh 'cat ~/.wgetrc' + + proxies='HTTPS_PROXY='+env.http_proxy+' ' + } + } + sh 'printenv' + } + + stage('Setup tools') { + sh 'apt-get update -y' + sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata' + sh 'apt-get install git wget sudo -y' + sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl' + sh 'mv kubectl /usr/bin' + sh 'chmod a+x /usr/bin/kubectl' + sh 'kubectl version' + } + stage('Stop SMO') { + sh './smo-install/scripts/sub-scripts/uninstall-nonrtric.sh' + sh './smo-install/scripts/sub-scripts/uninstall-onap.sh' + } + + } + + } +} diff --git a/smo-install/jenkins/gerrit/manual-tests-pipeline b/smo-install/jenkins/gerrit/manual-tests-pipeline new file mode 100644 index 00000000..ce742460 --- /dev/null +++ b/smo-install/jenkins/gerrit/manual-tests-pipeline @@ -0,0 +1,77 @@ +podTemplate(yaml: ''' + apiVersion: v1 + kind: Pod + spec: + containers: + - name: jenkins-ubuntu + image: ubuntu:20.04 + command: + - sleep + args: + - 99d +''') { + node(POD_LABEL) { + def proxies='' + stage('Checkout') { + sh 'printenv' + git branch: env.BRANCH, url:'https://gerrit.o-ran-sc.org/r/it/dep' + } + container('jenkins-ubuntu') { + stage ('Proxy settings') { + echo 'Proxy check' + script { + if (env.http_proxy) { + sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc' + sh 'cat ~/.wgetrc' + + sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc' + sh 'cat ~/.wgetrc' + + proxies='HTTPS_PROXY='+env.http_proxy+' ' + } + } + sh 'printenv' + } + + stage('Setup tools') { + sh 'apt-get update -y' + sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata' + sh 'apt-get install git wget sudo -y' + sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl' + sh 'mv kubectl /usr/bin' + sh 'chmod a+x /usr/bin/kubectl' + sh 'kubectl version' + sh proxies+' ./smo-install/scripts/layer-0/0-setup-tests-env.sh' + sh proxies+' ./smo-install/scripts/layer-0/0-setup-charts-museum.sh' + sh proxies+' ./smo-install/scripts/layer-0/0-setup-helm3.sh' + + } + stage('Build TESTS charts') { + sh proxies+' ./smo-install/scripts/sub-scripts/build-tests.sh' + } + stage('Test ORAN') { + dir("smo-install/test/pythonsdk") { + try { + if (env.http_proxy) { + sh proxies+' NO_PROXY='+env.no_proxy+' tox' + } else { + sh 'tox' + } + } + catch(exec) { + echo 'TOX tests crashed' + } + } + } + stage('Get Results') { + archiveArtifacts artifacts: 'smo-install/test/pythonsdk/src/orantests/pythonsdk.debug.log, **/reports/junit/*.xml', fingerprint: true + junit '**/reports/junit/*.xml' + } + } + + } +} diff --git a/smo-install/jenkins/github/automatic-verify-pipeline b/smo-install/jenkins/github/automatic-verify-pipeline new file mode 100644 index 00000000..2f25d17e --- /dev/null +++ b/smo-install/jenkins/github/automatic-verify-pipeline @@ -0,0 +1,116 @@ +lock('smo') { +podTemplate(yaml: ''' + apiVersion: v1 + kind: Pod + spec: + containers: + - name: jenkins-ubuntu + image: ubuntu:20.04 + command: + - sleep + args: + - 99d +''') { + node(POD_LABEL) { + + def proxies='' + sh 'printenv' + stage('Checkout') { + script { + if (env.BRANCH_NAME.startsWith('PR-')) { + echo 'PULL REQUEST case detected' + gitInfo = checkout([$class: 'GitSCM', branches: [[name: 'pr/'+env.CHANGE_ID]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: [[credentialsId: 'github_username_pass', name: 'origin', refspec: '+refs/pull/*/head:refs/remotes/origin/pr/*', url: 'https://github.com/sebdet/oran-deployment.git']]]) + + } else { + echo 'BRANCH case detected' + gitInfo = checkout([$class: 'GitSCM', branches: [[name: env.BRANCH_NAME]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: [[credentialsId: 'github_username_pass', name: 'origin', refspec: '+refs/heads/*:refs/remotes/origin/*', url: 'https://github.com/sebdet/oran-deployment.git']]]) + } + } + echo "Test: "+ gitInfo + githubNotify context:env.HUDSON_URL, description:'Validating SMO package', repo:'oran-deployment', account: 'sebdet', status:'PENDING', sha:gitInfo.GIT_COMMIT, credentialsId:'github_username_pass' + + } + container('jenkins-ubuntu') { + stage ('Proxy settings') { + echo 'Proxy check' + script { + if (env.http_proxy) { + sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc' + sh 'cat ~/.wgetrc' + + sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc' + sh 'cat ~/.wgetrc' + + proxies='HTTPS_PROXY='+env.http_proxy+' ' + } + } + sh 'printenv' + + } + stage('Setup tools') { + echo 'Setup container' + sh 'printenv' + + sh 'apt-get update -y' + sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata' + sh 'apt-get install git wget sudo -y' + + sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl' + sh 'mv kubectl /usr/bin' + sh 'chmod a+x /usr/bin/kubectl' + + sh proxies+' ./scripts/layer-0/0-setup-tests-env.sh' + sh proxies+' ./scripts/layer-0/0-setup-charts-museum.sh' + sh proxies+' ./scripts/layer-0/0-setup-helm3.sh' + sh 'kubectl version' + } + stage('Build ONAP charts') { + sh proxies+' ./scripts/sub-scripts/build-onap.sh' + } + stage('Build ORAN charts') { + sh proxies+' ./scripts/sub-scripts/build-oran.sh' + } + stage('Build TESTS charts') { + sh proxies+' ./scripts/sub-scripts/build-tests.sh' + } + stage('Start SMO') { + sh './scripts/layer-2/2-install-oran.sh pythonsdk-tests' + } + stage('Test ORAN') { + dir("test/pythonsdk") { + try { + if (env.http_proxy) { + sh proxies+' NO_PROXY='+env.no_proxy+' tox' + } else { + sh 'tox' + } + githubNotify context:env.HUDSON_URL, description:'SMO Package build SUCCESSFUL', repo:'oran-deployment', account: 'sebdet', status:'SUCCESS', sha:gitInfo.GIT_COMMIT, credentialsId:'github_username_pass' + currentBuild.result = 'SUCCESS' + } + catch(exec) { + echo 'TOX tests crashed' + githubNotify context:env.HUDSON_URL, description:'SMO Package build FAILED, TOX tests crashed', repo:'oran-deployment', account: 'sebdet', status:'FAILURE', sha:gitInfo.GIT_COMMIT, credentialsId:'github_username_pass' + currentBuild.result = 'FAILURE' + } + } + } + stage('Stop SMO') { + sh './scripts/sub-scripts/uninstall-nonrtric.sh' + sh './scripts/sub-scripts/uninstall-onap.sh' + } + stage('Get Results') { + archiveArtifacts artifacts: 'test/pythonsdk/src/orantests/pythonsdk.debug.log, **/reports/junit/*.xml', fingerprint: true + junit '**/reports/junit/*.xml' + + } + } + + } +} +} + + diff --git a/smo-install/jenkins/github/manual-start-pipeline b/smo-install/jenkins/github/manual-start-pipeline new file mode 100644 index 00000000..b36d65ff --- /dev/null +++ b/smo-install/jenkins/github/manual-start-pipeline @@ -0,0 +1,70 @@ +lock('smo') { +podTemplate(yaml: ''' + apiVersion: v1 + kind: Pod + spec: + containers: + - name: jenkins-ubuntu + image: ubuntu:20.04 + command: + - sleep + args: + - 99d +''') { + + node(POD_LABEL) { + def proxies='' + stage('Checkout') { + echo 'printenv' + checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: 'https://github.com/sebdet/oran-deployment.git']], branches: [[name: env.BRANCH]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]]], poll: false + } + container('jenkins-ubuntu') { + stage ('Proxy settings') { + echo 'Proxy check' + script { + if (env.http_proxy) { + sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc' + sh 'cat ~/.wgetrc' + + sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc' + sh 'cat ~/.wgetrc' + + proxies='HTTPS_PROXY='+env.http_proxy+' ' + } + } + sh 'printenv' + } + + stage('Setup tools') { + sh 'apt-get update -y' + sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata' + sh 'apt-get install git wget sudo -y' + sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl' + sh 'mv kubectl /usr/bin' + sh 'chmod a+x /usr/bin/kubectl' + sh 'kubectl version' + sh proxies+' ./scripts/layer-0/0-setup-tests-env.sh' + sh proxies+' ./scripts/layer-0/0-setup-charts-museum.sh' + sh proxies+' ./scripts/layer-0/0-setup-helm3.sh' + } + stage('Build ONAP charts') { + sh proxies+' ./scripts/sub-scripts/build-onap.sh' + } + stage('Build ORAN charts') { + sh proxies+' ./scripts/sub-scripts/build-oran.sh' + } + stage('Build ONAP charts') { + sh proxies+' ./scripts/sub-scripts/build-tests.sh' + } + stage('Start SMO') { + sh './scripts/layer-2/2-install-oran.sh ' + env.FLAVOR + } + } + + } +} +} diff --git a/smo-install/jenkins/github/manual-stop-pipeline b/smo-install/jenkins/github/manual-stop-pipeline new file mode 100644 index 00000000..a7032bda --- /dev/null +++ b/smo-install/jenkins/github/manual-stop-pipeline @@ -0,0 +1,57 @@ +podTemplate(yaml: ''' + apiVersion: v1 + kind: Pod + spec: + containers: + - name: jenkins-ubuntu + image: ubuntu:20.04 + command: + - sleep + args: + - 99d +''') { + + node(POD_LABEL) { + def proxies='' + stage('Checkout') { + checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: 'https://github.com/sebdet/oran-deployment.git']], branches: [[name: env.BRANCH]], extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]]], poll: false + } + container('jenkins-ubuntu') { + stage ('Proxy settings') { + echo 'Proxy check' + script { + if (env.http_proxy) { + sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc' + sh 'cat ~/.wgetrc' + + sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc' + sh 'cat ~/.wgetrc' + + proxies='HTTPS_PROXY='+env.http_proxy+' ' + } + } + sh 'printenv' + } + + stage('Setup tools') { + sh 'apt-get update -y' + sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata' + sh 'apt-get install git wget sudo -y' + sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl' + sh 'mv kubectl /usr/bin' + sh 'chmod a+x /usr/bin/kubectl' + sh 'kubectl version' + } + stage('Stop SMO') { + sh './scripts/sub-scripts/uninstall-nonrtric.sh' + sh './scripts/sub-scripts/uninstall-onap.sh' + } + + } + + } +} diff --git a/smo-install/jenkins/github/manual-tests-pipeline b/smo-install/jenkins/github/manual-tests-pipeline new file mode 100644 index 00000000..77524183 --- /dev/null +++ b/smo-install/jenkins/github/manual-tests-pipeline @@ -0,0 +1,77 @@ +podTemplate(yaml: ''' + apiVersion: v1 + kind: Pod + spec: + containers: + - name: jenkins-ubuntu + image: ubuntu:20.04 + command: + - sleep + args: + - 99d +''') { + node(POD_LABEL) { + def proxies='' + stage('Checkout') { + sh 'printenv' + git branch: env.BRANCH, url:'https://github.com/sebdet/oran-deployment.git' + } + container('jenkins-ubuntu') { + stage ('Proxy settings') { + echo 'Proxy check' + script { + if (env.http_proxy) { + sh 'echo \'Acquire::http::Proxy "' + env.http_proxy + '";\' > /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "http_proxy = "'+env.http_proxy+' > ~/.wgetrc' + sh 'cat ~/.wgetrc' + + sh 'echo \'Acquire::https::Proxy "' + env.http_proxy + '";\' >> /etc/apt/apt.conf.d/proxy.conf' + sh 'cat /etc/apt/apt.conf.d/proxy.conf' + sh 'echo "https_proxy = "'+env.http_proxy+' >> ~/.wgetrc' + sh 'cat ~/.wgetrc' + + proxies='HTTPS_PROXY='+env.http_proxy+' ' + } + } + sh 'printenv' + } + + stage('Setup tools') { + sh 'apt-get update -y' + sh 'DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata' + sh 'apt-get install git wget sudo -y' + sh 'wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl' + sh 'mv kubectl /usr/bin' + sh 'chmod a+x /usr/bin/kubectl' + sh 'kubectl version' + sh proxies+' ./scripts/layer-0/0-setup-tests-env.sh' + sh proxies+' ./scripts/layer-0/0-setup-charts-museum.sh' + sh proxies+' ./scripts/layer-0/0-setup-helm3.sh' + + } + stage('Build TESTS charts') { + sh proxies+' ./scripts/sub-scripts/build-tests.sh' + } + stage('Test ORAN') { + dir("test/pythonsdk") { + try { + if (env.http_proxy) { + sh proxies+' NO_PROXY='+env.no_proxy+' tox' + } else { + sh 'tox' + } + } + catch(exec) { + echo 'TOX tests crashed' + } + } + } + stage('Get Results') { + archiveArtifacts artifacts: 'test/pythonsdk/src/orantests/pythonsdk.debug.log, **/reports/junit/*.xml', fingerprint: true + junit '**/reports/junit/*.xml' + } + } + + } +} diff --git a/smo-install/onap_oom b/smo-install/onap_oom index c578bf3a..e1661bdc 160000 --- a/smo-install/onap_oom +++ b/smo-install/onap_oom @@ -1 +1 @@ -Subproject commit c578bf3a8efc1adfa88369eafe358795eb4086ae +Subproject commit e1661bdc0f82fe98a11a723de54e9b6b13418b43 diff --git a/smo-install/oran_oom/Makefile b/smo-install/oran_oom/Makefile index 40a4e240..50c1e11d 100644 --- a/smo-install/oran_oom/Makefile +++ b/smo-install/oran_oom/Makefile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -PARENT_CHART := nonrtric ru-du-simulators +PARENT_CHART := nonrtric COMMON_CHARTS_DIR := nonrtric-common aux-common ric-common # FIXME OOM-765 ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) diff --git a/smo-install/oran_oom/a1simulator/.helmignore b/smo-install/oran_oom/a1simulator/.helmignore deleted file mode 100644 index 50af0317..00000000 --- a/smo-install/oran_oom/a1simulator/.helmignore +++ /dev/null @@ -1,22 +0,0 @@ -# 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 -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/smo-install/oran_oom/controlpanel/resources/nginx.conf b/smo-install/oran_oom/controlpanel/resources/nginx.conf deleted file mode 100644 index 46f87d09..00000000 --- a/smo-install/oran_oom/controlpanel/resources/nginx.conf +++ /dev/null @@ -1,28 +0,0 @@ -events{} - -http { - include /etc/nginx/mime.types; - - upstream backend { - server nonrtricgateway:9090; - } - - server { - listen 8080; - server_name localhost; - root /usr/share/nginx/html; - index index.html; - location /a1-policy/ { - proxy_pass http://backend; - } - location /data-producer/ { - proxy_pass http://backend; - } - location /data-consumer/ { - proxy_pass http://backend; - } - location / { - try_files $uri $uri/ /index.html; - } - } -} \ No newline at end of file diff --git a/smo-install/oran_oom/enrichmentservice/.helmignore b/smo-install/oran_oom/enrichmentservice/.helmignore deleted file mode 100644 index 50af0317..00000000 --- a/smo-install/oran_oom/enrichmentservice/.helmignore +++ /dev/null @@ -1,22 +0,0 @@ -# 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 -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/smo-install/oran_oom/enrichmentservice/Chart.yaml b/smo-install/oran_oom/enrichmentservice/Chart.yaml deleted file mode 100644 index de02e98b..00000000 --- a/smo-install/oran_oom/enrichmentservice/Chart.yaml +++ /dev/null @@ -1,21 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -apiVersion: v1 -appVersion: "1.0.0" -description: A Helm chart for Enrichment Coordinator Service -name: enrichmentservice -version: 1.0.0 diff --git a/smo-install/oran_oom/enrichmentservice/requirements.yaml b/smo-install/oran_oom/enrichmentservice/requirements.yaml deleted file mode 100644 index f3b3ecd4..00000000 --- a/smo-install/oran_oom/enrichmentservice/requirements.yaml +++ /dev/null @@ -1,20 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -dependencies: - - name: nonrtric-common - version: ^2.0.0 - repository: "@local" diff --git a/smo-install/oran_oom/enrichmentservice/resources/config/application.yaml b/smo-install/oran_oom/enrichmentservice/resources/config/application.yaml deleted file mode 100644 index 75b11ad8..00000000 --- a/smo-install/oran_oom/enrichmentservice/resources/config/application.yaml +++ /dev/null @@ -1,54 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -spring: - profiles: - active: prod - main: - allow-bean-definition-overriding: true - aop: - auto: false -management: - endpoints: - web: - exposure: - include: "loggers,logfile,health,info,metrics,threaddump,heapdump" - -logging: - level: - ROOT: ERROR - org.springframework: ERROR - org.springframework.data: ERROR - org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR - org.oransc.enrichment: INFO - file: - name: /var/log/enrichment-coordinator-service/application.log -server: - port : 8434 - http-port: 8083 - ssl: - key-store-type: JKS - key-store-password: policy_agent - key-store: /opt/app/enrichment-coordinator-service/etc/cert/keystore.jks - key-password: policy_agent - key-alias: policy_agent -app: - filepath: /opt/app/enrichment-coordinator-service/data/application_configuration.json - webclient: - trust-store-used: false - trust-store-password: policy_agent - trust-store: /opt/app/enrichment-coordinator-service/etc/cert/truststore.jks - vardata-directory: /var/enrichment-coordinator-service \ No newline at end of file diff --git a/smo-install/oran_oom/enrichmentservice/templates/configmap.yaml b/smo-install/oran_oom/enrichmentservice/templates/configmap.yaml deleted file mode 100644 index d8e4f895..00000000 --- a/smo-install/oran_oom/enrichmentservice/templates/configmap.yaml +++ /dev/null @@ -1,29 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "common.name.enrichmentservice" . }}-configmap - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.enrichmentservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} \ No newline at end of file diff --git a/smo-install/oran_oom/enrichmentservice/templates/ingress.yaml b/smo-install/oran_oom/enrichmentservice/templates/ingress.yaml deleted file mode 100644 index f7520221..00000000 --- a/smo-install/oran_oom/enrichmentservice/templates/ingress.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{/* -################################################################################ -# Copyright (c) 2021 Nordix Foundation. # -# # -# 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. # -################################################################################ -*/}} - -{{- if .Values.enrichmentservice.ingress.enabled -}} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ include "common.name.enrichmentservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - -spec: - ingressClassName: {{ include "common.ingressClassName" . }} - rules: - - http: - paths: - - path: "/data-producer" - backend: - service: - name: {{ include "common.name.enrichmentservice" . }} - port: - number: {{ .Values.enrichmentservice.service.internalPort1 }} - pathType: Prefix - path: "/data-consumer" - backend: - service: - name: {{ include "common.name.enrichmentservice" . }} - port: - number: {{ .Values.enrichmentservice.service.internalPort1 }} - pathType: Prefix -{{- end -}} \ No newline at end of file diff --git a/smo-install/oran_oom/enrichmentservice/templates/service.yaml b/smo-install/oran_oom/enrichmentservice/templates/service.yaml deleted file mode 100644 index 0b2a110c..00000000 --- a/smo-install/oran_oom/enrichmentservice/templates/service.yaml +++ /dev/null @@ -1,42 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -kind: Service -apiVersion: v1 -metadata: - name: {{ include "common.name.enrichmentservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.enrichmentservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - ports: - {{if eq .Values.enrichmentservice.service.allowHttp true -}} - - name: {{ index .Values.enrichmentservice.service.httpName }} - port: {{ .Values.enrichmentservice.service.internalPort1 }} - targetPort: {{ .Values.enrichmentservice.service.targetPort1 }} - protocol: TCP - {{- end }} - - name: {{ index .Values.enrichmentservice.service.httpsName }} - port: {{ .Values.enrichmentservice.service.internalPort2 }} - targetPort: {{ .Values.enrichmentservice.service.targetPort2 }} - protocol: TCP - selector: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.enrichmentservice" . }} - release: {{ .Release.Name }} - type: ClusterIP diff --git a/smo-install/oran_oom/enrichmentservice/templates/statefulset.yaml b/smo-install/oran_oom/enrichmentservice/templates/statefulset.yaml deleted file mode 100644 index 678e8b15..00000000 --- a/smo-install/oran_oom/enrichmentservice/templates/statefulset.yaml +++ /dev/null @@ -1,82 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -kind: StatefulSet -apiVersion: apps/v1 -metadata: - name: {{ include "common.name.enrichmentservice" . }} - namespace: {{ include "common.namespace.nonrtric" . }} - generation: 1 - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.enrichmentservice" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - annotations: - deployment.kubernetes.io/revision: '1' -spec: - serviceName: {{ include "common.name.enrichmentservice" . }} - replicas: 1 - selector: - matchLabels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.enrichmentservice" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.enrichmentservice" . }} - release: {{ .Release.Name }} - spec: - hostname: {{ include "common.name.enrichmentservice" . }} - containers: - - name: {{ include "common.container.enrichmentservice" . }} - image: {{ .Values.enrichmentservice.image.registry }}/{{ .Values.enrichmentservice.image.name }}:{{ .Values.enrichmentservice.image.tag }} - imagePullPolicy: {{ .Values.enrichmentservice.imagePullPolicy }} - ports: - - containerPort: {{ .Values.enrichmentservice.service.targetPort1 }} - protocol: TCP - - containerPort: {{ .Values.enrichmentservice.service.targetPort2 }} - protocol: TCP - readinessProbe: - tcpSocket: - port: {{ .Values.enrichmentservice.service.targetPort1 }} - initialDelaySeconds: {{ .Values.enrichmentservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.enrichmentservice.liveness.periodSeconds }} - livenessProbe: - httpGet: - path: /status - port: {{ .Values.enrichmentservice.service.targetPort1 }} - initialDelaySeconds: {{ .Values.enrichmentservice.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.enrichmentservice.liveness.periodSeconds }} - volumeMounts: - - name: {{ include "common.name.enrichmentservice" . }}-enrichment-config - mountPath: /opt/app/enrichment-coordinator-service/config - - name: {{ include "common.name.enrichmentservice" . }}-vardata - mountPath: /var/enrichment-coordinator-service - volumes: - - name: {{ include "common.name.enrichmentservice" . }}-enrichment-config - configMap: - name: {{ include "common.name.enrichmentservice" . }}-configmap - - volumeClaimTemplates: - - metadata: - name: {{ include "common.name.enrichmentservice" . }}-vardata - spec: - accessModes: [ ReadWriteOnce ] - storageClassName: "{{ .Values.enrichmentservice.persistence.storageClassName }}" - resources: - requests: - storage: "{{ .Values.enrichmentservice.persistence.size }}" diff --git a/smo-install/oran_oom/enrichmentservice/values.yaml b/smo-install/oran_oom/enrichmentservice/values.yaml deleted file mode 100644 index f780305e..00000000 --- a/smo-install/oran_oom/enrichmentservice/values.yaml +++ /dev/null @@ -1,45 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -# Default values for Enrichment Coordinate Service. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -enrichmentservice: - imagePullPolicy: IfNotPresent - image: - registry: "nexus3.o-ran-sc.org:10004/o-ran-sc" - name: "nonrtric-enrichment-coordinator-service" - tag: 1.2.0 - service: - allowHttp: true - httpName: http - internalPort1: 8083 - targetPort1: 8083 - httpsName: https - internalPort2: 8434 - targetPort2: 8434 - liveness: - initialDelaySeconds: 20 - periodSeconds: 10 - readiness: - initialDelaySeconds: 20 - periodSeconds: 10 - persistence: - size: 2Gi - storageClassName: standard - ingress: - enabled: false diff --git a/smo-install/oran_oom/nonrtric-common/templates/_enrichmentservice.tpl b/smo-install/oran_oom/nonrtric-common/templates/_enrichmentservice.tpl deleted file mode 100644 index c80cf2e5..00000000 --- a/smo-install/oran_oom/nonrtric-common/templates/_enrichmentservice.tpl +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# 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. # -################################################################################ - -{{- define "common.name.enrichmentservice" -}} - {{- printf "enrichmentservice" -}} -{{- end -}} - -{{- define "common.container.enrichmentservice" -}} - {{- $name := ( include "common.name.enrichmentservice" . ) -}} - {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/smo-install/oran_oom/nonrtric/templates/pv3.yaml b/smo-install/oran_oom/nonrtric/templates/pv3.yaml index c0382f0b..90ed1aa9 100644 --- a/smo-install/oran_oom/nonrtric/templates/pv3.yaml +++ b/smo-install/oran_oom/nonrtric/templates/pv3.yaml @@ -29,7 +29,7 @@ spec: - ReadWriteMany persistentVolumeReclaimPolicy: Retain hostPath: - path: /dockerdata-nfs/nonrtric/volume3 + path: {{ .Values.nonrtric.persistence.mountPath }}/nonrtric/volume3 storageClassName: {{ .Values.nonrtric.volume3.storageClassName }} {{- end }} diff --git a/smo-install/scripts/layer-0/0-setup-charts-museum.sh b/smo-install/scripts/layer-0/0-setup-charts-museum.sh index 8377dd48..8a9fda15 100755 --- a/smo-install/scripts/layer-0/0-setup-charts-museum.sh +++ b/smo-install/scripts/layer-0/0-setup-charts-museum.sh @@ -27,7 +27,6 @@ SCRIPT=$(readlink -f "$0") SCRIPT_PATH=$(dirname "$SCRIPT") cd $SCRIPT_PATH -#curl https://raw.githubusercontent.com/helm/chartmuseum/main/scripts/get-chartmuseum | bash cd /tmp wget https://get.helm.sh/chartmuseum-v0.13.1-linux-amd64.tar.gz tar xvfz chartmuseum-v0.13.1-linux-amd64.tar.gz diff --git a/smo-install/scripts/layer-1/1-build-all-charts.sh b/smo-install/scripts/layer-1/1-build-all-charts.sh index 4bea2c11..03ae535c 100755 --- a/smo-install/scripts/layer-1/1-build-all-charts.sh +++ b/smo-install/scripts/layer-1/1-build-all-charts.sh @@ -29,3 +29,4 @@ cd $SCRIPT_PATH ../sub-scripts/build-onap.sh ../sub-scripts/build-oran.sh +../sub-scripts/build-tests.sh diff --git a/smo-install/scripts/layer-2/2-install-oran-cnf.sh b/smo-install/scripts/layer-2/2-install-cicd.sh similarity index 81% rename from smo-install/scripts/layer-2/2-install-oran-cnf.sh rename to smo-install/scripts/layer-2/2-install-cicd.sh index da5ec653..a1091b4c 100755 --- a/smo-install/scripts/layer-2/2-install-oran-cnf.sh +++ b/smo-install/scripts/layer-2/2-install-cicd.sh @@ -27,11 +27,17 @@ SCRIPT=$(readlink -f "$0") SCRIPT_PATH=$(dirname "$SCRIPT") cd $SCRIPT_PATH -echo "Starting ONAP CNF & NONRTRIC namespaces..." +FLAVOUR=$1 +if [ -z "$1" ] + then + echo "No helm override flavour supplied, going to default" + FLAVOUR="default" +fi -../sub-scripts/install-onap.sh ../../helm-override/onap-override-cnf.yaml -../sub-scripts/install-nonrtric.sh ../../helm-override/oran-override.yaml -kubectl get pods -n onap -kubectl get pods -n nonrtric +echo "Starting CICD in 'tests' namespace..." + +../sub-scripts/install-cicd.sh ../../helm-override/$FLAVOUR/cicd-override.yaml + +kubectl get pods -n tests kubectl get namespaces diff --git a/smo-install/scripts/layer-2/2-install-nonrtric-only.sh b/smo-install/scripts/layer-2/2-install-nonrtric-only.sh index 5ad6b1e1..77ff1e44 100755 --- a/smo-install/scripts/layer-2/2-install-nonrtric-only.sh +++ b/smo-install/scripts/layer-2/2-install-nonrtric-only.sh @@ -27,9 +27,17 @@ SCRIPT=$(readlink -f "$0") SCRIPT_PATH=$(dirname "$SCRIPT") cd $SCRIPT_PATH +FLAVOUR=$1 +if [ -z "$1" ] + then + echo "No helm override flavour supplied, going to default" + FLAVOUR="default" +fi +timestamp=$(date +%s) + echo "Starting NONRTRIC namespace..." -../sub-scripts/install-nonrtric.sh ../../helm-override/oran-override.yaml +../sub-scripts/install-nonrtric.sh ../../helm-override/$FLAVOUR/oran-override.yaml $timestamp kubectl get pods -n nonrtric kubectl get namespaces diff --git a/smo-install/scripts/layer-2/2-install-oran.sh b/smo-install/scripts/layer-2/2-install-oran.sh index 8e432ceb..687c45ef 100755 --- a/smo-install/scripts/layer-2/2-install-oran.sh +++ b/smo-install/scripts/layer-2/2-install-oran.sh @@ -27,9 +27,18 @@ SCRIPT=$(readlink -f "$0") SCRIPT_PATH=$(dirname "$SCRIPT") cd $SCRIPT_PATH +FLAVOUR=$1 +if [ -z "$1" ] + then + echo "No helm override flavour supplied, going to default" + FLAVOUR="default" +fi + +timestamp=$(date +%s) + echo "Starting ONAP & NONRTRIC namespaces ..." -../sub-scripts/install-onap.sh ../../helm-override/onap-override.yaml -../sub-scripts/install-nonrtric.sh ../../helm-override/oran-override.yaml +../sub-scripts/install-onap.sh ../../helm-override/$FLAVOUR/onap-override.yaml $timestamp +../sub-scripts/install-nonrtric.sh ../../helm-override/$FLAVOUR/oran-override.yaml $timestamp kubectl get pods -n onap kubectl get pods -n nonrtric diff --git a/smo-install/scripts/layer-2/2-install-simulators.sh b/smo-install/scripts/layer-2/2-install-simulators.sh index f9d6fdeb..dca6c9a1 100755 --- a/smo-install/scripts/layer-2/2-install-simulators.sh +++ b/smo-install/scripts/layer-2/2-install-simulators.sh @@ -27,8 +27,15 @@ SCRIPT=$(readlink -f "$0") SCRIPT_PATH=$(dirname "$SCRIPT") cd $SCRIPT_PATH +FLAVOUR=$1 +if [ -z "$1" ] + then + echo "No helm override flavour supplied, going to default" + FLAVOUR="default" +fi + echo "Starting Network Simulators namespace ..." -../sub-scripts/install-simulators.sh ../../helm-override/network-simulators-override.yaml ../../helm-override/network-simulators-topology-override.yaml +../sub-scripts/install-simulators.sh ../../helm-override/$FLAVOUR/network-simulators-override.yaml ../../helm-override/$FLAVOUR/network-simulators-topology-override.yaml kubectl get pods -n network kubectl get namespaces diff --git a/smo-install/scripts/layer-2/2-upgrade-simulators.sh b/smo-install/scripts/layer-2/2-upgrade-simulators.sh index ce31ded5..35891dc1 100755 --- a/smo-install/scripts/layer-2/2-upgrade-simulators.sh +++ b/smo-install/scripts/layer-2/2-upgrade-simulators.sh @@ -27,8 +27,15 @@ SCRIPT=$(readlink -f "$0") SCRIPT_PATH=$(dirname "$SCRIPT") cd $SCRIPT_PATH +FLAVOUR=$1 +if [ -z "$1" ] + then + echo "No helm override flavour supplied, going to default" + FLAVOUR="default" +fi + echo "Starting Network Simulators namespace ..." -../sub-scripts/upgrade-simulators.sh ../../helm-override/network-simulators-override.yaml ../../helm-override/network-simulators-topology-override.yaml +../sub-scripts/upgrade-simulators.sh ../../helm-override/$FLAVOUR/network-simulators-override.yaml ../../helm-override/$FLAVOUR/network-simulators-topology-override.yaml kubectl get pods -n network kubectl get namespaces diff --git a/smo-install/scripts/sub-scripts/build-tests.sh b/smo-install/scripts/sub-scripts/build-tests.sh new file mode 100755 index 00000000..d5267b49 --- /dev/null +++ b/smo-install/scripts/sub-scripts/build-tests.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# ORAN SMO Package +# ================================================================================ +# Copyright (C) 2021 AT&T Intellectual Property. 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. +# 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============================================ +# =================================================================== +# +### + +SCRIPT=$(readlink -f "$0") +SCRIPT_PATH=$(dirname "$SCRIPT") +cd $SCRIPT_PATH + +apt-get install make -y + +echo '### Building ORAN tests part ###' +(cd ../../tests_oom && make all) diff --git a/smo-install/scripts/sub-scripts/clean-up.sh b/smo-install/scripts/sub-scripts/clean-up.sh index a5adb13a..0fc5a7f1 100755 --- a/smo-install/scripts/sub-scripts/clean-up.sh +++ b/smo-install/scripts/sub-scripts/clean-up.sh @@ -24,4 +24,4 @@ ### kubectl delete pv --all -sudo rm -rf /dockerdata-nfs +sudo rm -rf /dockerdata-nfs/* diff --git a/smo-install/scripts/sub-scripts/install-cicd.sh b/smo-install/scripts/sub-scripts/install-cicd.sh new file mode 100755 index 00000000..a5859662 --- /dev/null +++ b/smo-install/scripts/sub-scripts/install-cicd.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# ORAN SMO Package +# ================================================================================ +# Copyright (C) 2021 AT&T Intellectual Property. 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. +# 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============================================ +# =================================================================== +# +### + +kubectl create namespace tests +echo '### Installing ORAN Tests part ###' +helm install --debug oran-tests-suite local/oran-tests-suite --namespace tests -f $1 diff --git a/smo-install/scripts/sub-scripts/install-nonrtric.sh b/smo-install/scripts/sub-scripts/install-nonrtric.sh index d8b60001..2926b407 100755 --- a/smo-install/scripts/sub-scripts/install-nonrtric.sh +++ b/smo-install/scripts/sub-scripts/install-nonrtric.sh @@ -25,4 +25,4 @@ kubectl create namespace nonrtric echo '### Installing ORAN NONRTRIC part ###' -helm install --debug oran-nonrtric local/nonrtric --namespace nonrtric -f $1 +helm install --debug oran-nonrtric local/nonrtric --namespace nonrtric -f $1 --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$2" diff --git a/smo-install/scripts/sub-scripts/install-onap.sh b/smo-install/scripts/sub-scripts/install-onap.sh index 652b8a95..69097b57 100755 --- a/smo-install/scripts/sub-scripts/install-onap.sh +++ b/smo-install/scripts/sub-scripts/install-onap.sh @@ -25,4 +25,4 @@ kubectl create namespace onap echo '### Installing ONAP part ###' -helm deploy --debug onap local/onap --namespace onap -f $1 +helm deploy --debug onap local/onap --namespace onap -f $1 --set global.persistence.mountPath="/dockerdata-nfs/deployment-$2" --set dmaap.message-router.message-router-zookeeper.persistence.mountPath="/dockerdata-nfs/deployment-$2" --set dmaap.message-router.message-router-kafka.persistence.mountPath="/dockerdata-nfs/deployment-$2" diff --git a/smo-install/scripts/sub-scripts/uninstall-cicd.sh b/smo-install/scripts/sub-scripts/uninstall-cicd.sh new file mode 100755 index 00000000..cf7791fb --- /dev/null +++ b/smo-install/scripts/sub-scripts/uninstall-cicd.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# ORAN SMO Package +# ================================================================================ +# Copyright (C) 2021 AT&T Intellectual Property. 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. +# 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============================================ +# =================================================================== +# +### + +kubectl delete namespace tests +kubectl get pv | grep Released | awk '$1 {print$1}' | while read vol; do kubectl delete pv/${vol}; done diff --git a/smo-install/scripts/sub-scripts/uninstall-nonrtric.sh b/smo-install/scripts/sub-scripts/uninstall-nonrtric.sh index 5835382d..6c528e3f 100755 --- a/smo-install/scripts/sub-scripts/uninstall-nonrtric.sh +++ b/smo-install/scripts/sub-scripts/uninstall-nonrtric.sh @@ -27,3 +27,4 @@ kubectl delete namespace nonrtric kubectl delete pv nonrtric-pv2 kubectl delete pv nonrtric-pv1 kubectl delete pv nonrtric-pv3 +kubectl get pv | grep Released | awk '$1 {print$1}' | while read vol; do kubectl delete pv/${vol}; done diff --git a/smo-install/scripts/sub-scripts/uninstall-onap.sh b/smo-install/scripts/sub-scripts/uninstall-onap.sh index 96888e75..b088cff0 100755 --- a/smo-install/scripts/sub-scripts/uninstall-onap.sh +++ b/smo-install/scripts/sub-scripts/uninstall-onap.sh @@ -24,3 +24,4 @@ ### kubectl delete namespace onap +kubectl get pv | grep Released | awk '$1 {print$1}' | while read vol; do kubectl delete pv/${vol}; done diff --git a/smo-install/scripts/sub-scripts/uninstall-simulators.sh b/smo-install/scripts/sub-scripts/uninstall-simulators.sh index 1698d0a6..9fd51154 100755 --- a/smo-install/scripts/sub-scripts/uninstall-simulators.sh +++ b/smo-install/scripts/sub-scripts/uninstall-simulators.sh @@ -24,3 +24,4 @@ ### kubectl delete namespace network +kubectl get pv | grep Released | awk '$1 {print$1}' | while read vol; do kubectl delete pv/${vol}; done diff --git a/smo-install/scripts/uninstall-all.sh b/smo-install/scripts/uninstall-all.sh index ee15d501..5b3173a7 100755 --- a/smo-install/scripts/uninstall-all.sh +++ b/smo-install/scripts/uninstall-all.sh @@ -30,4 +30,5 @@ cd $SCRIPT_PATH ./sub-scripts/uninstall-onap.sh ./sub-scripts/uninstall-nonrtric.sh ./sub-scripts/uninstall-simulators.sh +./sub-scripts/uninstall-cicd.sh ./sub-scripts/clean-up.sh diff --git a/smo-install/test/pythonsdk/src/oransdk/dmaap/oran_dmaap.py b/smo-install/test/pythonsdk/src/oransdk/dmaap/oran_dmaap.py deleted file mode 100644 index a3079090..00000000 --- a/smo-install/test/pythonsdk/src/oransdk/dmaap/oran_dmaap.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# SPDX-License-Identifier: Apache-2.0 -"""Oran Dmaap module.""" -from typing import Dict -from onapsdk.dmaap.dmaap import Dmaap -from onapsdk.dmaap.dmaap_service import DmaapService - -class OranDmaap(Dmaap): - """Dmaap library provides functions for getting events from Dmaap.""" - - get_all_topics_url = f"{DmaapService._url}/topics/listAll" - - @classmethod - def create_topic(cls, - topic, - basic_auth: Dict[str, str]) -> dict: - """ - Create topic in Dmaap. - - Args: - topic: the topic to create, in json format - basic_auth: (Dict[str, str]) for example:{ 'username': 'bob', 'password': 'secret' } - - """ - create_events_url = f"{DmaapService._url}/topics/create" - instance_details = cls.send_message('POST', - 'Create Dmaap Topic', - create_events_url, - data=topic) - - @classmethod - def get_all_topics(cls, - basic_auth: Dict[str, str]) -> dict: - """ - Get all topics stored in Dmaap. - - Args: - basic_auth: (Dict[str, str]) for example:{ 'username': 'bob', 'password': 'secret' } - - Returns: - (dict) Topics from Dmaap - - """ - return super().get_all_topics(basic_auth) \ No newline at end of file diff --git a/smo-install/test/pythonsdk/src/oransdk/policy/clamp.py b/smo-install/test/pythonsdk/src/oransdk/policy/clamp.py new file mode 100644 index 00000000..e693a05a --- /dev/null +++ b/smo-install/test/pythonsdk/src/oransdk/policy/clamp.py @@ -0,0 +1,170 @@ +#!/usr/bin/env python3 +### +# ============LICENSE_START======================================================= +# ORAN SMO PACKAGE - PYTHONSDK TESTS +# ================================================================================ +# Copyright (C) 2022 AT&T Intellectual Property. 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. +# 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============================================ +# =================================================================== +# +### +"""Onap Policy Clamp Tosca Template module.""" + +from typing import Dict +from onapsdk.clamp.clamp_element import Clamp + +class ClampToscaTemplate(Clamp): + """Onap Policy Clamp Tosca Template class.""" + + header = {"Accept": "application/json", "Content-Type": "application/json"} + + def __init__(self, basic_auth: Dict[str, str]) -> None: + """ + Initialize loop instance object. + + Args: + basic_auth : basic auth + + """ + super().__init__() + self.basic_auth = basic_auth + + def get_template_instance(self) -> dict: + """ + Get tosca template instance. + + Returns: + the tosca template instance + """ + url = f"{self.base_url()}/toscaControlLoop/getToscaInstantiation" + template_instance = self.send_message_json('GET', + 'Get tosca template instance', + url, + basic_auth=self.basic_auth) + + return template_instance + + def upload_commission(self, tosca_template) -> dict: + """ + Upload Tosca to commissioning. + + Args: + tosca_template: the tosca template yaml + Returns: + the response of the uploading action + + """ + url = f"{self.base_url()}/toscaControlLoop/commissionToscaTemplate" + response = self.send_message_json('POST', + 'Upload Tosca to commissioning', + url, + data=tosca_template, + headers=self.header, + basic_auth=self.basic_auth) + return response + + def create_instance(self, tosca_instance_properties) -> dict: + """ + Create Tosca instance. + + Args: + tosca_instance_properties (str): the tosca template properties + Returns: + the response of the creation action + """ + url = f"{self.base_url()}/toscaControlLoop/postToscaInstanceProperties" + response = self.send_message_json('POST', + 'Create Tosca instance', + url, + data=tosca_instance_properties, + headers=self.header, + basic_auth=self.basic_auth) + return response + + def get_template_instance_status(self, name, version) -> dict: + """ + Get tosca template instance status. + + Args: + name (str): the name of the template instance + version (str): the version of the template instance + Returns: + the template instance + """ + url = f"{self.base_url()}/toscaControlLoop/getInstantiationOrderState?name={name}&version={version}" + template_instance = self.send_message_json('GET', + 'Get tosca template instance', + url, + basic_auth=self.basic_auth) + + return template_instance + + def change_instance_status(self, new_status, name, version) -> dict: + """ + Update tosca instance status. + + Args: + new_status (str): the new instance status + name (str): the new instance name + version (str): the new instance version + Returns: + the updated template instance + """ + body = '{"orderedState":"' + new_status + '","controlLoopIdentifierList":[{"name":"' + name + '","version":"' + version + '"}]}' + url = f"{self.base_url()}/toscaControlLoop/putToscaInstantiationStateChange" + response = self.send_message_json('PUT', + 'Update tosca instance status', + url, + data=body, + headers=self.header, + basic_auth=self.basic_auth) + return response + + def delete_template_instance(self, name: str, version: str) -> dict: + """ + Delete the tosca instance. + + Args: + name (str): the instance name. + version (str): the instance version. + Returns: + the response of the deletion action + """ + url = f"{self.base_url()}/toscaControlLoop/deleteToscaInstanceProperties?name={name}&version={version}" + response = self.send_message_json('DELETE', + 'Delete the tosca instance', + url, + headers=self.header, + basic_auth=self.basic_auth) + return response + + def decommission_template(self, name: str, version: str) -> dict: + """ + Decommission the tosca template. + + Args: + name (str): the tosca template name. + version (str): the tosca template version. + Returns: + the response of the decommission action + """ + url = f"{self.base_url()}/toscaControlLoop/decommissionToscaTemplate?name={name}&version={version}" + response = self.send_message_json('DELETE', + 'Decommission the tosca template', + url, + headers=self.header, + basic_auth=self.basic_auth) + return response diff --git a/smo-install/test/pythonsdk/src/oransdk/policy/templates/commission_apex.json.j2 b/smo-install/test/pythonsdk/src/oransdk/policy/templates/commission_apex.json.j2 new file mode 100644 index 00000000..cdacaa1e --- /dev/null +++ b/smo-install/test/pythonsdk/src/oransdk/policy/templates/commission_apex.json.j2 @@ -0,0 +1,2114 @@ +{ + "data_types": { + "onap.datatype.controlloop.Target": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "targetType": { + "required": true, + "constraints": [ + { + "valid_values": [ + "VNF","VM","VFMODULE","PNF"] + }], + "description": "Category for the target type", + "type": "string" + }, + "entityIds": { + "required": false, + "metadata": { + "clamp_possible_values": "ClampExecution:CSAR_RESOURCES" + }, + "entry_schema": { + "type": "string" + }, + "description": "Map of values that identify the resource. If none are provided, it is assumed that the +entity that generated the ONSET event will be the target. +", + "type": "map" + } + }, + "description": "Definition for a entity in A&AI to perform a control loop operation on" + }, + "onap.datatypes.ToscaConceptIdentifier": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "version": { + "required": true, + "type": "string" + }, + "name": { + "required": true, + "type": "string" + } + } + }, + "onap.datatype.controlloop.Operation": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "failure_guard": { + "required": false, + "default": "final_failure_guard", + "description": "Points to the operation to invoke when the current operation is blocked due to guard policy enforcement.", + "type": "string" + }, + "retries": { + "required": true, + "default": 0, + "description": "The number of retries the actor should attempt to perform the operation.", + "type": "integer" + }, + "success": { + "required": false, + "default": "final_success", + "description": "Points to the operation to invoke on success. A value of \"final_success\" indicates and end to the operation.", + "type": "string" + }, + "description": { + "required": false, + "description": "A user-friendly description of the intent for the operation", + "type": "string" + }, + "failure_retries": { + "required": false, + "default": "final_failure_retries", + "description": "Points to the operation to invoke when the current operation has exceeded its max retries.", + "type": "string" + }, + "timeout": { + "required": true, + "description": "The amount of time for the actor to perform the operation.", + "type": "integer" + }, + "failure": { + "required": false, + "default": "final_failure", + "description": "Points to the operation to invoke on Actor operation failure.", + "type": "string" + }, + "id": { + "required": true, + "description": "Unique identifier for the operation", + "type": "string" + }, + "failure_timeout": { + "required": false, + "default": "final_failure_timeout", + "description": "Points to the operation to invoke when the time out for the operation occurs.", + "type": "string" + }, + "failure_exception": { + "required": false, + "default": "final_failure_exception", + "description": "Points to the operation to invoke when the current operation causes an exception.", + "type": "string" + }, + "operation": { + "required": true, + "description": "The definition of the operation to be performed.", + "type": "onap.datatype.controlloop.Actor" + } + }, + "description": "An operation supported by an actor" + }, + "onap.datatype.controlloop.Actor": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "payload": { + "required": false, + "metadata": { + "clamp_possible_values": "ClampExecution:CDS/payload" + }, + "entry_schema": { + "type": "string" + }, + "description": "Name/value pairs of payload information passed by Policy to the actor", + "type": "map" + }, + "target": { + "required": true, + "description": "The resource the operation should be performed on.", + "type": "onap.datatype.controlloop.Target" + }, + "operation": { + "required": true, + "metadata": { + "clamp_possible_values": "Dictionary:DefaultOperations,ClampExecution:CDS/operation" + }, + "description": "The operation the actor is performing.", + "type": "string" + }, + "actor": { + "required": true, + "metadata": { + "clamp_possible_values": "Dictionary:DefaultActors,ClampExecution:CDS/actor" + }, + "description": "The actor performing the operation.", + "type": "string" + } + }, + "description": "An actor/operation/target definition" + } + }, + "topology_template": { + "policies": [ + { + "operational.apex.linkmonitor": { + "properties": { + "eventInputParameters": { + "DMaaPConsumer": { + "carrierTechnologyParameters": { + "parameters": { + "url": "http://message-router:3904/events/unauthenticated.SEC_FAULT_OUTPUT/users/link-monitor-nonrtric?timeout=15000&limit=100" + }, + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters" + }, + "eventName": "LinkFailureInputEvent", + "eventProtocolParameters": { + "parameters": { + "versionAlias": "version", + "pojoField": "LinkFailureInput" + }, + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "RestProducer": { + "eventNameFilter": "LinkFailureOutputEvent", + "carrierTechnologyParameters": { + "parameters": { + "url": "http://sdnc-oam:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node={OduId}/yang-ext:mount/o-ran-sc-du-hello-world:network-function/distributed-unit-functions={OduId}/radio-resource-management-policy-ratio=rrm-pol-2", + "httpMethod": "PUT", + "httpHeaders": [ + [ + "Authorization","Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=="]] + }, + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "parameters": { + "pojoField": "LinkFailureOutput" + }, + "eventProtocol": "JSON" + } + }, + "StdOutProducer": { + "eventNameFilter": "ApexMessageOutputEvent", + "carrierTechnologyParameters": { + "parameters": { + "standardIo": true + }, + "carrierTechnology": "FILE" + }, + "eventProtocolParameters": { + "parameters": { + "pojoField": "message" + }, + "eventProtocol": "JSON" + } + } + }, + "engineServiceParameters": { + "policy_type_impl": { + "apexPolicyModel": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel" + }, + "policies": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Policies" + }, + "policyMap": { + "entry": [ + { + "key": { + "version": "0.0.1", + "name": "LinkMonitorPolicy" + }, + "value": { + "template": "Freestyle", + "policyKey": { + "version": "0.0.1", + "name": "LinkMonitorPolicy" + }, + "state": { + "entry": [ + { + "key": "LinkClearedState", + "value": { + "defaultTask": { + "version": "0.0.1", + "name": "LinkClearedTask" + }, + "stateOutputs": { + "entry": [ + { + "key": "LinkClearedLogic_Output_Direct", + "value": { + "key": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkClearedState", + "localName": "LinkClearedLogic_Output_Direct" + }, + "outgoingEvent": { + "version": "0.0.1", + "name": "ApexMessageOutputEvent" + }, + "nextState": { + "parentKeyName": "NULL", + "parentKeyVersion": "0.0.0", + "parentLocalName": "NULL", + "localName": "NULL" + } + } + }] + }, + "taskReferences": { + "entry": [ + { + "key": { + "version": "0.0.1", + "name": "LinkClearedTask" + }, + "value": { + "key": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkClearedState", + "localName": "LinkClearedTask" + }, + "output": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkClearedState", + "localName": "LinkClearedLogic_Output_Direct" + }, + "outputType": "DIRECT" + } + }] + }, + "stateKey": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "NULL", + "localName": "LinkClearedState" + }, + "contextAlbumReference": [], + "stateFinalizerLogicMap": { + "entry": [] + }, + "taskSelectionLogic": { + "key": "NULL", + "logic": "", + "logicFlavour": "UNDEFINED" + }, + "trigger": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsEvent" + } + } + },{ + "key": "LinkFailureOrClearedState", + "value": { + "defaultTask": { + "version": "0.0.1", + "name": "NoPolicyDefinedTask" + }, + "stateOutputs": { + "entry": [ + { + "key": "CreateLinkClearedOutfieldsLogic_Output_Direct", + "value": { + "key": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureOrClearedState", + "localName": "CreateLinkClearedOutfieldsLogic_Output_Direct" + }, + "outgoingEvent": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsEvent" + }, + "nextState": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "NULL", + "localName": "LinkClearedState" + } + } + },{ + "key": "CreateLinkFailureOutfieldsLogic_Output_Direct", + "value": { + "key": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureOrClearedState", + "localName": "CreateLinkFailureOutfieldsLogic_Output_Direct" + }, + "outgoingEvent": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsEvent" + }, + "nextState": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "NULL", + "localName": "LinkFailureState" + } + } + },{ + "key": "NoPolicyDefinedLogic_Output_Direct", + "value": { + "key": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureOrClearedState", + "localName": "NoPolicyDefinedLogic_Output_Direct" + }, + "outgoingEvent": { + "version": "0.0.1", + "name": "ApexMessageOutputEvent" + }, + "nextState": { + "parentKeyName": "NULL", + "parentKeyVersion": "0.0.0", + "parentLocalName": "NULL", + "localName": "NULL" + } + } + }] + }, + "taskReferences": { + "entry": [ + { + "key": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsTask" + }, + "value": { + "key": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureOrClearedState", + "localName": "CreateLinkClearedOutfieldsTask" + }, + "output": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureOrClearedState", + "localName": "CreateLinkClearedOutfieldsLogic_Output_Direct" + }, + "outputType": "DIRECT" + } + },{ + "key": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsTask" + }, + "value": { + "key": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureOrClearedState", + "localName": "CreateLinkFailureOutfieldsTask" + }, + "output": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureOrClearedState", + "localName": "CreateLinkFailureOutfieldsLogic_Output_Direct" + }, + "outputType": "DIRECT" + } + },{ + "key": { + "version": "0.0.1", + "name": "NoPolicyDefinedTask" + }, + "value": { + "key": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureOrClearedState", + "localName": "NoPolicyDefinedTask" + }, + "output": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureOrClearedState", + "localName": "NoPolicyDefinedLogic_Output_Direct" + }, + "outputType": "DIRECT" + } + }] + }, + "stateKey": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "NULL", + "localName": "LinkFailureOrClearedState" + }, + "contextAlbumReference": [], + "stateFinalizerLogicMap": { + "entry": [] + }, + "taskSelectionLogic": { + "key": "TaskSelectionLogic", + "logic": "/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +executor.logger.info(\"Task Selection Execution: '\"+executor.subject.id+ + \"'. InputFields: '\"+executor.inFields+\"'\"); + +var linkFailureInput = executor.inFields.get(\"LinkFailureInput\"); +var commonEventHeader = linkFailureInput.get(\"event\").get(\"commonEventHeader\"); +var domain = commonEventHeader.get(\"domain\"); + +taskFailure = executor.subject.getTaskKey(\"CreateLinkFailureOutfieldsTask\"); +taskCleared = executor.subject.getTaskKey(\"CreateLinkClearedOutfieldsTask\"); +taskDefault = executor.subject.getDefaultTaskKey(); + +if (domain == \"fault\") { + var faultFields = linkFailureInput.get(\"event\").get(\"faultFields\"); + var alarmCondition = faultFields.get(\"alarmCondition\"); + var eventSeverity = faultFields.get(\"eventSeverity\"); + if (alarmCondition == \"28\" && eventSeverity != \"NORMAL\") { + taskFailure.copyTo(executor.selectedTask); + } else if (alarmCondition == \"28\" && eventSeverity == \"NORMAL\") { + taskCleared.copyTo(executor.selectedTask); + } else { + taskDefault.copyTo(executor.selectedTask); + } +} else { + taskDefault.copyTo(executor.selectedTask); +} + +true;", + "logicFlavour": "JAVASCRIPT" + }, + "trigger": { + "version": "0.0.1", + "name": "LinkFailureInputEvent" + } + } + },{ + "key": "LinkFailureState", + "value": { + "defaultTask": { + "version": "0.0.1", + "name": "LinkFailureTask" + }, + "stateOutputs": { + "entry": [ + { + "key": "LinkFailureLogic_Output_Direct", + "value": { + "key": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureState", + "localName": "LinkFailureLogic_Output_Direct" + }, + "outgoingEvent": { + "version": "0.0.1", + "name": "LinkFailureOutputEvent" + }, + "nextState": { + "parentKeyName": "NULL", + "parentKeyVersion": "0.0.0", + "parentLocalName": "NULL", + "localName": "NULL" + } + } + }] + }, + "taskReferences": { + "entry": [ + { + "key": { + "version": "0.0.1", + "name": "LinkFailureTask" + }, + "value": { + "key": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureState", + "localName": "LinkFailureTask" + }, + "output": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "LinkFailureState", + "localName": "LinkFailureLogic_Output_Direct" + }, + "outputType": "DIRECT" + } + }] + }, + "stateKey": { + "parentKeyName": "LinkMonitorPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "NULL", + "localName": "LinkFailureState" + }, + "contextAlbumReference": [], + "stateFinalizerLogicMap": { + "entry": [] + }, + "taskSelectionLogic": { + "key": "NULL", + "logic": "", + "logicFlavour": "UNDEFINED" + }, + "trigger": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsEvent" + } + } + }] + }, + "firstState": "LinkFailureOrClearedState" + } + }] + } + }, + "events": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Events" + }, + "eventMap": { + "entry": [ + { + "key": { + "version": "0.0.1", + "name": "ApexMessageOutputEvent" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "ApexMessageOutputEvent" + }, + "target": "APEX", + "source": "APEX", + "nameSpace": "org.onap.policy.apex.auth.clieditor", + "parameter": { + "entry": [ + { + "key": "message", + "value": { + "optional": false, + "key": "message", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "MessageSchema" + } + } + }] + } + } + },{ + "key": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsEvent" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsEvent" + }, + "target": "APEX", + "source": "APEX", + "nameSpace": "org.onap.policy.apex.auth.clieditor", + "parameter": { + "entry": [ + { + "key": "OruId", + "value": { + "optional": false, + "key": "OruId", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "OruIdSchema" + } + } + }] + } + } + },{ + "key": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsEvent" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsEvent" + }, + "target": "APEX", + "source": "APEX", + "nameSpace": "org.onap.policy.apex.auth.clieditor", + "parameter": { + "entry": [ + { + "key": "OduId", + "value": { + "optional": false, + "key": "OduId", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "OduIdSchema" + } + } + },{ + "key": "OruId", + "value": { + "optional": false, + "key": "OruId", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "OruIdSchema" + } + } + }] + } + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkFailureInputEvent" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkFailureInputEvent" + }, + "target": "APEX", + "source": "DMAAP", + "nameSpace": "org.onap.policy.apex.auth.clieditor", + "parameter": { + "entry": [ + { + "key": "LinkFailureInput", + "value": { + "optional": false, + "key": "LinkFailureInput", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "LinkFailureInputSchema" + } + } + }] + } + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkFailureOutputEvent" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkFailureOutputEvent" + }, + "target": "OAM", + "source": "APEX", + "nameSpace": "org.onap.policy.apex.auth.clieditor", + "parameter": { + "entry": [ + { + "key": "LinkFailureOutput", + "value": { + "optional": false, + "key": "LinkFailureOutput", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "LinkFailureOutputSchema" + } + } + }] + } + } + }] + } + }, + "keyInformation": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_KeyInfo" + }, + "keyInfoMap": { + "entry": [ + { + "key": { + "version": "0.0.1", + "name": "ApexMessageOutputEvent" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "ApexMessageOutputEvent" + }, + "description": "Generated description for concept referred to by key \"ApexMessageOutputEvent:0.0.1\"", + "UUID": "cca47d74-7754-4a61-b163-ca31f66b157b" + } + },{ + "key": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsEvent" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsEvent" + }, + "description": "Generated description for concept referred to by key \"CreateLinkClearedOutfieldsEvent:0.0.1\"", + "UUID": "a295d6a3-1b73-387e-abba-b41e9b608802" + } + },{ + "key": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsTask" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsTask" + }, + "description": "This task creates the output fields when link failure is cleared.", + "UUID": "fd594e88-411d-4a94-b2be-697b3a0d7adf" + } + },{ + "key": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsEvent" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsEvent" + }, + "description": "Generated description for concept referred to by key \"CreateLinkFailureOutfieldsEvent:0.0.1\"", + "UUID": "02be2b5d-45b7-3c54-ae54-97f2b5c30125" + } + },{ + "key": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsTask" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsTask" + }, + "description": "This task the output fields when link failure is detected.", + "UUID": "ac3d9842-80af-4a98-951c-bd79a431c613" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkClearedTask" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkClearedTask" + }, + "description": "This task sends a message to the output when link failure is cleared.", + "UUID": "eecfde90-896c-4343-8f9c-2603ced94e2d" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkFailureInputEvent" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkFailureInputEvent" + }, + "description": "Generated description for concept referred to by key \"LinkFailureInputEvent:0.0.1\"", + "UUID": "c4500941-3f98-4080-a9cc-5b9753ed050b" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkFailureInputSchema" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkFailureInputSchema" + }, + "description": "Generated description for concept referred to by key \"LinkFailureInputSchema:0.0.1\"", + "UUID": "3b3974fc-3012-3b02-9f33-c9d8eefe4dc1" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkFailureOutputEvent" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkFailureOutputEvent" + }, + "description": "Generated description for concept referred to by key \"LinkFailureOutputEvent:0.0.1\"", + "UUID": "4f04aa98-e917-4f4a-882a-c75ba5a99374" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkFailureOutputSchema" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkFailureOutputSchema" + }, + "description": "Generated description for concept referred to by key \"LinkFailureOutputSchema:0.0.1\"", + "UUID": "2d1a7f6e-eb9a-3984-be1f-283d98111b84" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkFailureTask" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkFailureTask" + }, + "description": "This task updates the config for O-RU when link failure is detected.", + "UUID": "3351b0f4-cf06-4fa2-8823-edf67bd30223" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel" + }, + "description": "This is the Apex Policy Model for link monitoring.", + "UUID": "540226fb-55ee-4f0e-a444-983a0494818e" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Events" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Events" + }, + "description": "Generated description for concept referred to by key \"LinkMonitorModel_Events:0.0.1\"", + "UUID": "27ad3e7e-fe3b-3bd6-9081-718705c2bcea" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_KeyInfo" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_KeyInfo" + }, + "description": "Generated description for concept referred to by key \"LinkMonitorModel_KeyInfo:0.0.1\"", + "UUID": "ea0b5f58-eefd-358a-9660-840c640bf981" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Policies" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Policies" + }, + "description": "Generated description for concept referred to by key \"LinkMonitorModel_Policies:0.0.1\"", + "UUID": "ee9e0b0f-2b7d-3ab7-9a98-c5ec05ed823d" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Schemas" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Schemas" + }, + "description": "Generated description for concept referred to by key \"LinkMonitorModel_Schemas:0.0.1\"", + "UUID": "fa5f9b8f-796c-3c70-84e9-5140c958c4bb" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Tasks" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Tasks" + }, + "description": "Generated description for concept referred to by key \"LinkMonitorModel_Tasks:0.0.1\"", + "UUID": "eec592f7-69d5-39a9-981a-e552f787ed01" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkMonitorPolicy" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorPolicy" + }, + "description": "Generated description for concept referred to by key \"LinkMonitorPolicy:0.0.1\"", + "UUID": "6c5e410f-489a-46ff-964e-982ce6e8b6d0" + } + },{ + "key": { + "version": "0.0.1", + "name": "MessageSchema" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "MessageSchema" + }, + "description": "A schema for messages from apex", + "UUID": "ac4b34ac-39d6-3393-a267-8d5b84854018" + } + },{ + "key": { + "version": "0.0.1", + "name": "NoPolicyDefinedTask" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "NoPolicyDefinedTask" + }, + "description": "This task sends a message to the output when an event is received for which no policy has been defined.", + "UUID": "d48b619e-d00d-4008-b884-02d76ea4350b" + } + },{ + "key": { + "version": "0.0.1", + "name": "OduIdSchema" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "OduIdSchema" + }, + "description": "A schema for O-DU-ID", + "UUID": "50662174-a88b-3cbd-91bd-8e91b40b2660" + } + },{ + "key": { + "version": "0.0.1", + "name": "OruIdSchema" + }, + "value": { + "key": { + "version": "0.0.1", + "name": "OruIdSchema" + }, + "description": "A schema for O-RU-ID", + "UUID": "54daf32b-015f-39cd-8530-a1175c5553e9" + } + }] + } + }, + "schemas": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Schemas" + }, + "schemas": { + "entry": [ + { + "key": { + "version": "0.0.1", + "name": "LinkFailureInputSchema" + }, + "value": { + "schemaDefinition": "{ + \"type\": \"record\", + \"name\": \"Link_Failure_Input\", + \"fields\": [ + { + \"name\": \"event\", + \"type\": { + \"type\": \"record\", + \"name\": \"Event_Type\", + \"fields\": [ + { + \"name\": \"commonEventHeader\", + \"type\": { + \"type\": \"record\", + \"name\": \"Common_Event_Header_Type\", + \"fields\": [ + { + \"name\": \"domain\", + \"type\": \"string\" + }, + { + \"name\": \"eventId\", + \"type\": \"string\" + }, + { + \"name\": \"eventName\", + \"type\": \"string\" + }, + { + \"name\": \"eventType\", + \"type\": \"string\" + }, + { + \"name\": \"sequence\", + \"type\": \"int\" + }, + { + \"name\": \"priority\", + \"type\": \"string\" + }, + { + \"name\": \"reportingEntityId\", + \"type\": \"string\" + }, + { + \"name\": \"reportingEntityName\", + \"type\": \"string\" + }, + { + \"name\": \"sourceId\", + \"type\": \"string\" + }, + { + \"name\": \"sourceName\", + \"type\": \"string\" + }, + { + \"name\": \"startEpochMicrosec\", + \"type\": \"string\" + }, + { + \"name\": \"lastEpochMicrosec\", + \"type\": \"string\" + }, + { + \"name\": \"nfNamingCode\", + \"type\": \"string\" + }, + { + \"name\": \"nfVendorName\", + \"type\": \"string\" + }, + { + \"name\": \"timeZoneOffset\", + \"type\": \"string\" + }, + { + \"name\": \"version\", + \"type\": \"string\" + }, + { + \"name\": \"vesEventListenerVersion\", + \"type\": \"string\" + } + ] + } + }, + { + \"name\": \"faultFields\", + \"type\": { + \"type\": \"record\", + \"name\": \"Fault_Fields_Type\", + \"fields\": [ + { + \"name\": \"faultFieldsVersion\", + \"type\": \"string\" + }, + { + \"name\": \"alarmCondition\", + \"type\": \"string\" + }, + { + \"name\": \"alarmInterfaceA\", + \"type\": \"string\" + }, + { + \"name\": \"eventSourceType\", + \"type\": \"string\" + }, + { + \"name\": \"specificProblem\", + \"type\": \"string\" + }, + { + \"name\": \"eventSeverity\", + \"type\": \"string\" + }, + { + \"name\": \"vfStatus\", + \"type\": \"string\" + }, + { + \"name\": \"alarmAdditionalInformation\", + \"type\": { + \"type\": \"record\", + \"name\": \"Alarm_Additional_Information_Type\", + \"fields\": [ + { + \"name\": \"eventTime\", + \"type\": \"string\" + }, + { + \"name\": \"equipType\", + \"type\": \"string\" + }, + { + \"name\": \"vendor\", + \"type\": \"string\" + }, + { + \"name\": \"model\", + \"type\": \"string\" + } + ] + } + } + ] + } + } + ] + } + } + ] +}", + "key": { + "version": "0.0.1", + "name": "LinkFailureInputSchema" + }, + "schemaFlavour": "Avro" + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkFailureOutputSchema" + }, + "value": { + "schemaDefinition": "{ + \"name\": \"Link_Failure_Output\", + \"type\": \"record\", + \"fields\": [ + { + \"name\": \"o_DasH_ran_DasH_sc_DasH_du_DasH_hello_DasH_world_ColoN_radio_DasH_resource_DasH_management_DasH_policy_DasH_ratio\", + \"type\": { + \"type\": \"array\", + \"items\": { + \"name\": \"o_DasH_ran_DasH_sc_DasH_du_DasH_hello_DasH_world_ColoN_radio_DasH_resource_DasH_management_DasH_policy_DasH_ratio_record\", + \"type\": \"record\", + \"fields\": [ + { + \"name\": \"id\", + \"type\": \"string\" + }, + { + \"name\": \"radio_DasH_resource_DasH_management_DasH_policy_DasH_max_DasH_ratio\", + \"type\": \"int\" + }, + { + \"name\": \"radio_DasH_resource_DasH_management_DasH_policy_DasH_members\", + \"type\": { + \"type\": \"array\", + \"items\": { + \"name\": \"radio_DasH_resource_DasH_management_DasH_policy_DasH_members_record\", + \"type\": \"record\", + \"fields\": [ + { + \"name\": \"mobile_DasH_country_DasH_code\", + \"type\": \"string\" + }, + { + \"name\": \"mobile_DasH_network_DasH_code\", + \"type\": \"string\" + }, + { + \"name\": \"slice_DasH_differentiator\", + \"type\": \"int\" + }, + { + \"name\": \"slice_DasH_service_DasH_type\", + \"type\": \"int\" + } + ] + } + } + }, + { + \"name\": \"radio_DasH_resource_DasH_management_DasH_policy_DasH_min_DasH_ratio\", + \"type\": \"int\" + }, + { + \"name\": \"user_DasH_label\", + \"type\": \"string\" + }, + { + \"name\": \"resource_DasH_type\", + \"type\": \"string\" + }, + { + \"name\": \"radio_DasH_resource_DasH_management_DasH_policy_DasH_dedicated_DasH_ratio\", + \"type\": \"int\" + }, + { + \"name\": \"administrative_DasH_state\", + \"type\": \"string\" + } + ] + } + } + } + ] +}", + "key": { + "version": "0.0.1", + "name": "LinkFailureOutputSchema" + }, + "schemaFlavour": "Avro" + } + },{ + "key": { + "version": "0.0.1", + "name": "MessageSchema" + }, + "value": { + "schemaDefinition": "java.lang.String", + "key": { + "version": "0.0.1", + "name": "MessageSchema" + }, + "schemaFlavour": "Java" + } + },{ + "key": { + "version": "0.0.1", + "name": "OduIdSchema" + }, + "value": { + "schemaDefinition": "java.lang.String", + "key": { + "version": "0.0.1", + "name": "OduIdSchema" + }, + "schemaFlavour": "Java" + } + },{ + "key": { + "version": "0.0.1", + "name": "OruIdSchema" + }, + "value": { + "schemaDefinition": "java.lang.String", + "key": { + "version": "0.0.1", + "name": "OruIdSchema" + }, + "schemaFlavour": "Java" + } + }] + } + }, + "tasks": { + "key": { + "version": "0.0.1", + "name": "LinkMonitorModel_Tasks" + }, + "taskMap": { + "entry": [ + { + "key": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsTask" + }, + "value": { + "taskParameters": { + "entry": [] + }, + "key": { + "version": "0.0.1", + "name": "CreateLinkClearedOutfieldsTask" + }, + "taskLogic": { + "key": "TaskLogic", + "logic": "/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +executor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\"); + +var linkFailureInput = executor.inFields.get(\"LinkFailureInput\"); +var oruId = linkFailureInput.get(\"event\").get(\"commonEventHeader\").get(\"sourceName\"); + +executor.outFields.put(\"OruId\", oruId); + +executor.logger.info(executor.outFields); + +true;", + "logicFlavour": "JAVASCRIPT" + }, + "inputFields": { + "entry": [ + { + "key": "LinkFailureInput", + "value": { + "optional": false, + "key": "LinkFailureInput", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "LinkFailureInputSchema" + } + } + }] + }, + "outputFields": { + "entry": [ + { + "key": "OruId", + "value": { + "optional": false, + "key": "OruId", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "OruIdSchema" + } + } + }] + }, + "contextAlbumReference": [] + } + },{ + "key": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsTask" + }, + "value": { + "taskParameters": { + "entry": [] + }, + "key": { + "version": "0.0.1", + "name": "CreateLinkFailureOutfieldsTask" + }, + "taskLogic": { + "key": "TaskLogic", + "logic": "/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +executor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\"); + +var returnValue = true; +var linkFailureInput = executor.inFields.get(\"LinkFailureInput\"); +var oruId = linkFailureInput.get(\"event\").get(\"commonEventHeader\").get(\"sourceName\"); +var oruOduMap = JSON.parse(executor.parameters.get(\"ORU-ODU-Map\")); + +if (oruId in oruOduMap) { + var oduId = oruOduMap[oruId]; + executor.outFields.put(\"OruId\", oruId); + executor.outFields.put(\"OduId\", oduId); + executor.logger.info(executor.outFields); +} else { + executor.message = \"No O-RU found in the config with this ID: \" + oruId; + returnValue = false; +} + +returnValue;", + "logicFlavour": "JAVASCRIPT" + }, + "inputFields": { + "entry": [ + { + "key": "LinkFailureInput", + "value": { + "optional": false, + "key": "LinkFailureInput", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "LinkFailureInputSchema" + } + } + }] + }, + "outputFields": { + "entry": [ + { + "key": "OduId", + "value": { + "optional": false, + "key": "OduId", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "OduIdSchema" + } + } + },{ + "key": "OruId", + "value": { + "optional": false, + "key": "OruId", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "OruIdSchema" + } + } + }] + }, + "contextAlbumReference": [] + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkClearedTask" + }, + "value": { + "taskParameters": { + "entry": [] + }, + "key": { + "version": "0.0.1", + "name": "LinkClearedTask" + }, + "taskLogic": { + "key": "TaskLogic", + "logic": "/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +executor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\"); + +var oruId = executor.inFields.get(\"OruId\"); + +executor.outFields.put(\"message\", \"CLEARED link failure for O-RU: \" + oruId); + +executor.logger.info(executor.outFields); + +true;", + "logicFlavour": "JAVASCRIPT" + }, + "inputFields": { + "entry": [ + { + "key": "OruId", + "value": { + "optional": false, + "key": "OruId", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "OruIdSchema" + } + } + }] + }, + "outputFields": { + "entry": [ + { + "key": "message", + "value": { + "optional": false, + "key": "message", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "MessageSchema" + } + } + }] + }, + "contextAlbumReference": [] + } + },{ + "key": { + "version": "0.0.1", + "name": "LinkFailureTask" + }, + "value": { + "taskParameters": { + "entry": [] + }, + "key": { + "version": "0.0.1", + "name": "LinkFailureTask" + }, + "taskLogic": { + "key": "TaskLogic", + "logic": "/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +executor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\"); + +var linkFailureOutput = executor.subject.getOutFieldSchemaHelper(\"LinkFailureOutput\").createNewInstance(); + +var oruId = executor.inFields.get(\"OruId\"); +var oduId = executor.inFields.get(\"OduId\"); + +var unlockMessageArray = new java.util.ArrayList(); +for (var i = 0; i < 1; i++) { + unlockMessageArray.add({ + \"id\":\"rrm-pol-2\", + \"radio_DasH_resource_DasH_management_DasH_policy_DasH_max_DasH_ratio\":25, + \"radio_DasH_resource_DasH_management_DasH_policy_DasH_members\": + [ + { + \"mobile_DasH_country_DasH_code\":\"310\", + \"mobile_DasH_network_DasH_code\":\"150\", + \"slice_DasH_differentiator\":1, + \"slice_DasH_service_DasH_type\":1 + } + ], + \"radio_DasH_resource_DasH_management_DasH_policy_DasH_min_DasH_ratio\":15, + \"user_DasH_label\":\"rrm-pol-2\", + \"resource_DasH_type\":\"prb\", + \"radio_DasH_resource_DasH_management_DasH_policy_DasH_dedicated_DasH_ratio\":20, + \"administrative_DasH_state\":\"unlocked\" + }); +} + +linkFailureOutput.put(\"o_DasH_ran_DasH_sc_DasH_du_DasH_hello_DasH_world_ColoN_radio_DasH_resource_DasH_management_DasH_policy_DasH_ratio\", unlockMessageArray); +executor.outFields.put(\"LinkFailureOutput\", linkFailureOutput.toString()); + +executor.getExecutionProperties().setProperty(\"OduId\", oduId); +executor.getExecutionProperties().setProperty(\"OruId\", oruId); + +executor.logger.info(executor.outFields); + +true;", + "logicFlavour": "JAVASCRIPT" + }, + "inputFields": { + "entry": [ + { + "key": "OduId", + "value": { + "optional": false, + "key": "OduId", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "OduIdSchema" + } + } + },{ + "key": "OruId", + "value": { + "optional": false, + "key": "OruId", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "OruIdSchema" + } + } + }] + }, + "outputFields": { + "entry": [ + { + "key": "LinkFailureOutput", + "value": { + "optional": false, + "key": "LinkFailureOutput", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "LinkFailureOutputSchema" + } + } + }] + }, + "contextAlbumReference": [] + } + },{ + "key": { + "version": "0.0.1", + "name": "NoPolicyDefinedTask" + }, + "value": { + "taskParameters": { + "entry": [] + }, + "key": { + "version": "0.0.1", + "name": "NoPolicyDefinedTask" + }, + "taskLogic": { + "key": "TaskLogic", + "logic": "/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +executor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\"); + +executor.outFields.put(\"message\", \"No policy defined for this event\"); + +executor.logger.info(executor.outFields); + +true;", + "logicFlavour": "JAVASCRIPT" + }, + "inputFields": { + "entry": [ + { + "key": "LinkFailureInput", + "value": { + "optional": false, + "key": "LinkFailureInput", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "LinkFailureInputSchema" + } + } + }] + }, + "outputFields": { + "entry": [ + { + "key": "message", + "value": { + "optional": false, + "key": "message", + "fieldSchemaKey": { + "version": "0.0.1", + "name": "MessageSchema" + } + } + }] + }, + "contextAlbumReference": [] + } + }] + } + } + } + }, + "version": "0.0.1", + "id": 101, + "instanceCount": 1, + "name": "LinkMonitorApexEngine", + "engineParameters": { + "taskParameters": [ + { + "key": "ORU-ODU-Map", + "value": "{ + \"o-ru-11211\": \"o-du-1121\", + \"o-ru-11223\": \"o-du-1122\", + \"o-ru-11222\": \"o-du-1122\", + \"o-ru-11221\": \"o-du-1122\" +}" + }], + "contextParameters": { + "schemaParameters": { + "Avro": { + "parameterClassName": "org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters" + } + }, + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" + }, + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + } + }, + "deploymentPort": 12345 + } + }, + "metadata": { + "policy-id": "operational.apex.linkmonitor", + "policy-version": "1.0.0" + }, + "version": "1.0.0", + "type_version": "1.0.0", + "type": "onap.policies.controlloop.operational.common.Apex" + } + }], + "node_templates": { + "org.onap.domain.linkmonitor.LinkMonitorControlLoopDefinition0": { + "properties": { + "elements": [ + { + "version": "1.2.3", + "name": "org.onap.domain.linkmonitor.LinkMonitorPolicyControlLoopElement" + }], + "provider": "Ericsson" + }, + "description": "Control loop for Link Monitor", + "version": "1.2.3", + "type_version": "1.0.0", + "type": "org.onap.policy.clamp.controlloop.ControlLoop" + }, + "org.onap.policy.controlloop.PolicyControlLoopParticipant": { + "properties": { + "provider": "ONAP" + }, + "description": "Participant for policy framework", + "version": "2.3.1", + "type_version": "1.0.1", + "type": "org.onap.policy.clamp.controlloop.Participant" + }, + "org.onap.domain.linkmonitor.LinkMonitorPolicyControlLoopElement": { + "properties": { + "participantType": { + "version": "2.3.1", + "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant" + }, + "policy_type_id": { + "version": "1.0.0", + "name": "onap.policies.controlloop.operational.common.Apex" + }, + "participant_id": { + "version": "1.0.0", + "name": "org.onap.PM_Policy" + }, + "pdpGroup": "defaultGroup", + "provider": "Ericsson", + "policy_id": { + "version": "1.0.0", + "name": "operational.apex.linkmonitor" + } + }, + "description": "Control loop element for the Link Monitor", + "version": "1.2.3", + "type_version": "1.0.1", + "type": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement" + } + } + }, + "policy_types": { + "onap.policies.controlloop.operational.Common": { + "derived_from": "tosca.policies.Root", + "properties": { + "abatement": { + "required": true, + "default": false, + "description": "Whether an abatement event message will be expected for the control loop from DCAE.", + "type": "boolean" + }, + "operations": { + "required": true, + "entry_schema": { + "type": "onap.datatype.controlloop.Operation" + }, + "description": "List of operations to be performed when Control Loop is triggered.", + "type": "list" + }, + "timeout": { + "required": true, + "description": "Overall timeout for executing all the operations. This timeout should equal or exceed the total +timeout for each operation listed. +", + "type": "integer" + }, + "id": { + "required": true, + "description": "The unique control loop id.", + "type": "string" + }, + "trigger": { + "required": true, + "description": "Initial operation to execute upon receiving an Onset event message for the Control Loop.", + "type": "string" + } + }, + "description": "Operational Policy for Control Loop execution. Originated in Frankfurt to support TOSCA Compliant +Policy Types. This does NOT support the legacy Policy YAML policy type. +", + "version": "1.0.0", + "name": "onap.policies.controlloop.operational.Common" + }, + "onap.policies.controlloop.operational.common.Apex": { + "derived_from": "onap.policies.controlloop.operational.Common", + "properties": { + "javaProperties": { + "required": false, + "description": "Name/value pairs of properties to be set for APEX if needed.", + "type": "string" + }, + "eventInputParameters": { + "required": true, + "description": "The event input parameters.", + "type": "string" + }, + "eventOutputParameters": { + "required": true, + "description": "The event output parameters.", + "type": "string" + }, + "engineServiceParameters": { + "required": true, + "description": "The engine parameters like name, instanceCount, policy implementation, parameters etc.", + "type": "string" + } + }, + "description": "Operational policies for Apex PDP", + "version": "1.0.0", + "type_version": "1.0.0", + "name": "onap.policies.controlloop.operational.common.Apex" + } + }, + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "node_types": { + "org.onap.policy.clamp.controlloop.ControlLoop": { + "derived_from": "tosca.nodetypes.Root", + "properties": { + "elements": { + "required": true, + "metadata": { + "common": true + }, + "entry_schema": { + "type": "onap.datatypes.ToscaConceptIdentifier" + }, + "description": "Specifies a list of control loop element definitions that make up this control loop definition", + "type": "list" + }, + "provider": { + "required": false, + "metadata": { + "common": true + }, + "description": "Specifies the organization that provides the control loop element", + "type": "string" + } + }, + "version": "1.0.1" + }, + "org.onap.policy.clamp.controlloop.Participant": { + "derived_from": "tosca.nodetypes.Root", + "properties": { + "provider": { + "requred": false, + "type": "string" + } + }, + "version": "1.0.1" + }, + "org.onap.policy.clamp.controlloop.ControlLoopElement": { + "derived_from": "tosca.nodetypes.Root", + "properties": { + "runningToPassiveTimeout": { + "required": false, + "metadata": { + "common": true + }, + "default": 60, + "constraints": [ + { + "greater_or_equal": 0 + }], + "description": "The maximum time in seconds to wait for a state chage from running to passive", + "type": "integer" + }, + "participantType": { + "required": true, + "metadata": { + "common": true + }, + "description": "The identity of the participant type that hosts this type of Control Loop Element", + "type": "onap.datatypes.ToscaConceptIdentifier" + }, + "startPhase": { + "required": false, + "metadata": { + "common": true + }, + "constraints": [ + { + "greater_or_equal": 0 + }], + "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", + "type": "integer" + }, + "passiveToUninitializedTimeout": { + "required": false, + "metadata": { + "common": true + }, + "default": 60, + "constraints": [ + { + "greater_or_equal": 0 + }], + "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", + "type": "integer" + }, + "uninitializedToPassiveTimeout": { + "required": false, + "metadata": { + "common": true + }, + "default": 60, + "constraints": [ + { + "greater_or_equal": 0 + }], + "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", + "type": "integer" + }, + "participant_id": { + "metadata": { + "common": true + }, + "requred": true, + "type": "onap.datatypes.ToscaConceptIdentifier" + }, + "provider": { + "required": false, + "metadata": { + "common": true + }, + "description": "Specifies the organization that provides the control loop element", + "type": "string" + }, + "passiveToRunningTimeout": { + "required": false, + "metadata": { + "common": true + }, + "default": 60, + "constraints": [ + { + "greater_or_equal": 0 + }], + "description": "The maximum time in seconds to wait for a state chage from passive to running", + "type": "integer" + } + }, + "version": "1.0.1" + }, + "org.onap.policy.clamp.controlloop.PolicyControlLoopElement": { + "derived_from": "org.onap.policy.clamp.controlloop.ControlLoopElement", + "properties": { + "policy_type_id": { + "requred": true, + "type": "onap.datatypes.ToscaConceptIdentifier" + }, + "policy_id": { + "requred": false, + "type": "onap.datatypes.ToscaConceptIdentifier" + } + }, + "version": "1.0.1" + } + } +} \ No newline at end of file diff --git a/smo-install/test/pythonsdk/src/orantests/configuration/settings.py b/smo-install/test/pythonsdk/src/orantests/configuration/settings.py index c12079ad..3b444de2 100644 --- a/smo-install/test/pythonsdk/src/orantests/configuration/settings.py +++ b/smo-install/test/pythonsdk/src/orantests/configuration/settings.py @@ -70,6 +70,7 @@ NBI_API_VERSION = "/nbi/api/v4" POLICY_BASICAUTH = { 'username': 'policyadmin', 'password': 'zb!XztG34' } SDNC_BASICAUTH = { 'username': 'admin', 'password': 'Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U' } +CLAMP_BASICAUTH = { 'username': 'demo@people.osaaf.org', 'password': 'demo123456!' } DMAAP_URL = "http://"+subprocess.run("kubectl get services message-router -n onap |grep message-router | awk '{print $3}'", shell=True, check=True, stdout=subprocess.PIPE).stdout.decode('utf-8').strip()+":3904" @@ -93,3 +94,12 @@ DMAAP_TOPIC_PNFREG = "unauthenticated.VES_PNFREG_OUTPUT" DMAAP_TOPIC_PNFREG_JSON = '{"topicName": "' + DMAAP_TOPIC_PNFREG + '"}' DMAAP_TOPIC_FAULT = "unauthenticated.SEC_FAULT_OUTPUT" DMAAP_TOPIC_FAULT_JSON = '{"topicName": "' + DMAAP_TOPIC_FAULT + '"}' + +### Number of pods left in completed state for ONAP namespace +ONAP_PODS_WHEN_READY = 9 +SMO_CHECK_RETRY = 30 +SMO_CHECK_TIMEOUT = 900 +SDNC_CHECK_RETRY = 30 +SDNC_CHECK_TIMEOUT = 900 +POLICY_CHECK_RETRY = 30 +POLICY_CHECK_TIMEOUT = 900 diff --git a/smo-install/test/pythonsdk/src/orantests/conftest.py b/smo-install/test/pythonsdk/src/orantests/conftest.py index 298cdccc..5fea0c0c 100644 --- a/smo-install/test/pythonsdk/src/orantests/conftest.py +++ b/smo-install/test/pythonsdk/src/orantests/conftest.py @@ -25,8 +25,11 @@ import logging import logging.config import os +from requests import RequestException from onapsdk.configuration import settings +from onapsdk.exceptions import ConnectionFailed, APIError from waiting import wait +from urllib3.exceptions import NewConnectionError from oransdk.dmaap.dmaap import OranDmaap from oransdk.policy.policy import OranPolicy from oransdk.sdnc.sdnc import OranSdnc @@ -50,7 +53,11 @@ policy = OranPolicy() def policy_component_ready(): """Check if components are ready.""" logger.info("Verify policy components are ready") - policy_ready = {"api_ready": False, "pap_ready": False, "apex_ready": False} + try: + policy_ready = {"api_ready": False, "pap_ready": False, "apex_ready": False} + except (RequestException, NewConnectionError, ConnectionFailed, APIError) as e: + logger.error(e) + return False policy_status = policy.get_components_status(settings.POLICY_BASICAUTH) if (policy_status["api"]["healthy"] and not policy_ready["api_ready"]): logger.info("Policy Api is ready") @@ -58,11 +65,21 @@ def policy_component_ready(): if (policy_status["pap"]["healthy"] and not policy_ready["pap_ready"]): logger.info("Policy Pap is ready") policy_ready["pap_ready"] = True - if (policy_status["pdps"]["apex"][0]["healthy"] == "HEALTHY" and not policy_ready["apex_ready"]): + if (len(policy_status["pdps"]["apex"]) > 0 and policy_status["pdps"]["apex"][0]["healthy"] == "HEALTHY" and not policy_ready["apex_ready"]): logger.info("Policy Apex is ready") policy_ready["apex_ready"] = True return policy_ready["api_ready"] and policy_ready["pap_ready"] and policy_ready["apex_ready"] +def sdnc_component_ready(): + """Check if SDNC component is ready.""" + logger.info("Verify sdnc component is ready") + + try: + response = OranSdnc.get_events(settings.SDNC_BASICAUTH, "test") + except (RequestException, NewConnectionError, ConnectionFailed, APIError) as e: + logger.error(e) + return False + return response.status_code == 200 ###### Entry points of PYTEST Session def pytest_sessionstart(): @@ -70,8 +87,8 @@ def pytest_sessionstart(): logger.info("Check and wait for SMO to be running") smo.wait_for_smo_to_be_running() logger.info("Check and for for SDNC to be running") - wait(lambda: OranSdnc.get_events(settings.SDNC_BASICAUTH, "test").status_code == 200, sleep_seconds=10, timeout_seconds=300, waiting_for="SDNC to be ready") - wait(lambda: policy_component_ready(), sleep_seconds=10, timeout_seconds=300, waiting_for="Policy to be ready") + wait(lambda: policy_component_ready(), sleep_seconds=settings.POLICY_CHECK_RETRY, timeout_seconds=settings.POLICY_CHECK_TIMEOUT, waiting_for="Policy to be ready") + wait(lambda: sdnc_component_ready(), sleep_seconds=settings.SDNC_CHECK_RETRY, timeout_seconds=settings.SDNC_CHECK_TIMEOUT, waiting_for="SDNC to be ready") ## Just kill any simulators that could already be runnin network_sims.stop_network_simulators() ###### END of FIRST start, now we can start the sims for the real tests. diff --git a/smo-install/test/pythonsdk/src/orantests/disabled_test_cl_apex.py b/smo-install/test/pythonsdk/src/orantests/disabled_test_cl_apex.py new file mode 100644 index 00000000..76edbdca --- /dev/null +++ b/smo-install/test/pythonsdk/src/orantests/disabled_test_cl_apex.py @@ -0,0 +1,222 @@ +#!/usr/bin/env python3 +### +# ============LICENSE_START======================================================= +# ORAN SMO PACKAGE - PYTHONSDK TESTS +# ================================================================================ +# Copyright (C) 2022 AT&T Intellectual Property. 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. +# 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============================================ +# =================================================================== +# +### +"""Closed Loop Apex usecase tests module.""" +# This usecase has limitations due to Clamp issue. +# 1. manually change clamp-be settings before running the test: +# - run command "kubectl -n onap edit cm onap-policy-clamp-be-configmap" +# find variable clamp.config.controlloop.runtime.url and change http into https +# - run command "kubectl rollout restart deployment onap-policy-clamp-be -n onap" +# and wait until policy-clamp-be pod restarted successfully +# 2. make sure using the policy-clamp-be version 6.2.0-snapshot-latest at this the moment + +import time +import logging +import logging.config +from onapsdk.configuration import settings +from onapsdk.exceptions import RequestError +from waiting import wait +from oransdk.dmaap.dmaap import OranDmaap +from oransdk.policy.policy import OranPolicy +from oransdk.policy.clamp import ClampToscaTemplate +from oransdk.sdnc.sdnc import OranSdnc +from oransdk.utils.jinja import jinja_env + +logging.config.dictConfig(settings.LOG_CONFIG) +logger = logging.getLogger("test Control Loops for O-RU Fronthaul Recovery usecase - Apex policy") +dmaap = OranDmaap() +clamp = ClampToscaTemplate(settings.CLAMP_BASICAUTH) + +def create_topic(): + """Create the topic in Dmaap.""" + logger.info("Create new topic") + topic = '{ "topicName": "unauthenticated.SEC_FAULT_OUTPUT", "topicDescription": "test topic", "partitionCount": 1, "replicationCnCount": 1, "transactionEnabled": "false"}' + response = dmaap.create_topic(topic) + logger.info("response is: %s", response) + +def verify_topic_created(): + """Verify whether needed topic created.""" + logger.info("Verify topic created") + topiclist = dmaap.get_all_topics({}) + topic_created = False + for topic in topiclist: + if topic["topicName"] == "unauthenticated.SEC_FAULT_OUTPUT": + topic_created = True + break + + if topic_created: + logger.info("Topic created successfully") + else: + logger.info("Topic creation failed") + +def upload_commission(tosca_template): + """ + Upload the tosca to commissioning. + + Args: + tosca_template : the tosca template to upload in json format + Returns: + the response from the upload action + """ + logger.info("Upload tosca to commissioning") + return clamp.upload_commission(tosca_template) + +def create_instance(tosca_template): + """ + Create a instance. + + Args: + tosca_template : the tosca template to create in json format + Returns: + the response from the creation action + """ + logger.info("Create Instance") + return clamp.create_instance(tosca_template) + +def change_instance_status(new_status) -> str: + """ + Change the instance statue. + + Args: + new_status : the new instance to be changed to + Returns: + the new status to be changed to + """ + logger.info("Change Instance Status to %s", new_status) + try: + clamp.change_instance_status(new_status, "PMSH_Instance1", "1.2.3") + except RequestError: + logger.info("Change Instance Status request returned failed. Will query the instance status to double check whether the request is successful or not.") + + # There's a bug in Clamp code, sometimes it returned 500, but actually the status has been changed successfully + # Thus we verify the status to determine whether it was successful or not + time.sleep(2) + response = clamp.get_template_instance() + return response["controlLoopList"][0]["orderedState"] + +def verify_instance_status(new_status): + """ + Verify whether the instance changed to the new status. + + Args: + new_status : the new status of the instance + Returns: + the boolean value indicating whether status changed successfully + """ + logger.info("Verify the Instance Status is updated to the expected status %s", new_status) + response = clamp.get_template_instance() + if response["controlLoopList"][0]["state"] == new_status: + return True + return False + +def verify_apex_policy_created(): + """ + Verify whether the Apex policy has deployed successfully. + + Returns: + the boolean value indicating whether policy deployed successfully + """ + logger.info("Verify Apex policy is deployed") + policy = OranPolicy() + policy_status_list = policy.get_policy_status(settings.POLICY_BASICAUTH) + + for status in policy_status_list: + logger.info("the status %s,%s,%s:", status["policy"]["name"], status["policy"]["version"], status["deploy"]) + if (status["policy"]["name"] == "operational.apex.linkmonitor" and status["policy"]["version"] == "1.0.0" and status["deploy"]): + return True + + logger.info("Failed to deploy Apex policy") + return False + +def delete_template_instance(): + """ + Delete the template instance. + + Returns: + the response from the deletion action + """ + logger.info("Delete Instance") + return clamp.delete_template_instance("PMSH_Instance1", "1.2.3") + +def decommission_tosca(): + """ + Decommission the tosca template. + + Returns: + the response from the decommission action + """ + logger.info("Decommission tosca") + return clamp.decommission_template("ToscaServiceTemplateSimple", "1.0.0") + +def send_dmaap_event(): + """Send a event to Dmaap that should trigger the apex policy.""" + event = jinja_env().get_template("LinkFailureEvent.json.j2").render() + dmaap.send_link_failure_event(event) + +def test_cl_oru_recovery(): + """The Closed Loop O-RU Fronthaul Recovery usecase Apex version.""" + create_topic() + verify_topic_created() + + tosca_template = jinja_env().get_template("commission_apex.json.j2").render() + + response = upload_commission(tosca_template) + assert response["errorDetails"] is None + + response = create_instance(tosca_template) + assert response["errorDetails"] is None + + response = change_instance_status("PASSIVE") + assert response == "PASSIVE" + wait(lambda: verify_instance_status("PASSIVE"), sleep_seconds=5, timeout_seconds=60, waiting_for="Clamp instance switches to PASSIVE") + + response = change_instance_status("RUNNING") + assert response == "RUNNING" + wait(lambda: verify_instance_status("RUNNING"), sleep_seconds=5, timeout_seconds=60, waiting_for="Clamp instance switches to RUNNING") + + sdnc = OranSdnc() + status = sdnc.get_odu_oru_status("o-du-1122", "rrm-pol-2", settings.SDNC_BASICAUTH) + assert status["o-ran-sc-du-hello-world:radio-resource-management-policy-ratio"][0]["administrative-state"] == "locked" + + send_dmaap_event() + + assert verify_apex_policy_created() + + time.sleep(20) + logger.info("Check O-du/O-ru status again") + status = sdnc.get_odu_oru_status("o-du-1122", "rrm-pol-2", settings.SDNC_BASICAUTH) + assert status["o-ran-sc-du-hello-world:radio-resource-management-policy-ratio"][0]["administrative-state"] == "unlocked" + + response = change_instance_status("PASSIVE") + assert response == "PASSIVE" + wait(lambda: verify_instance_status("PASSIVE"), sleep_seconds=5, timeout_seconds=60, waiting_for="Clamp instance switches to PASSIVE") + + response = change_instance_status("UNINITIALISED") + assert response == "UNINITIALISED" + wait(lambda: verify_instance_status("UNINITIALISED"), sleep_seconds=5, timeout_seconds=60, waiting_for="Clamp instance switches to UNINITIALISED") + + response = delete_template_instance() + assert response["errorDetails"] is None + + response = decommission_tosca() + assert response["errorDetails"] is None diff --git a/smo-install/test/pythonsdk/src/orantests/smo/onap.py b/smo-install/test/pythonsdk/src/orantests/smo/onap.py index 879a3fdf..e79cbe78 100644 --- a/smo-install/test/pythonsdk/src/orantests/smo/onap.py +++ b/smo-install/test/pythonsdk/src/orantests/smo/onap.py @@ -43,8 +43,8 @@ class Onap(): run(cmd, shell=True, check=False) cmd = "kubectl get pods --field-selector status.phase!=Running -n onap | wc -l" result = check_output(cmd, shell=True).decode('utf-8') - logger.info("Number of Onap pods not in Running state (expected <= 8): %s", result) - if int(result) <= 8: + logger.info("Number of Onap pods not in Running state (expected <= %s): %s", settings.ONAP_PODS_WHEN_READY, result) + if int(result) <= settings.ONAP_PODS_WHEN_READY: logger.info("ONAP is Up") return True logger.info("ONAP is Down") diff --git a/smo-install/test/pythonsdk/src/orantests/smo/smo.py b/smo-install/test/pythonsdk/src/orantests/smo/smo.py index 49be8035..f0a9a741 100644 --- a/smo-install/test/pythonsdk/src/orantests/smo/smo.py +++ b/smo-install/test/pythonsdk/src/orantests/smo/smo.py @@ -42,4 +42,4 @@ class Smo(): @classmethod def wait_for_smo_to_be_running(cls): """Check and wait for the SMo to be running.""" - wait(lambda: cls.onap.is_onap_up() and cls.non_rt_ric.is_nonrtric_up(), sleep_seconds=10, timeout_seconds=300, waiting_for="SMO to be ready") + wait(lambda: cls.onap.is_onap_up() and cls.non_rt_ric.is_nonrtric_up(), sleep_seconds=settings.SMO_CHECK_RETRY, timeout_seconds=settings.SMO_CHECK_TIMEOUT, waiting_for="SMO to be ready") diff --git a/smo-install/test/pythonsdk/src/orantests/test_dmaap.py b/smo-install/test/pythonsdk/src/orantests/test_dmaap.py deleted file mode 100644 index 50fa6674..00000000 --- a/smo-install/test/pythonsdk/src/orantests/test_dmaap.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: Apache-2.0 - -import logging -from pathlib import Path -from onapsdk.configuration import settings -from oransdk.dmaap.dmaap import OranDmaap -from oransdk.a1sim.a1sim import A1sim -from oransdk.utils.jinja import jinja_env - -BASIC_AUTH = {} - -logging.config.dictConfig(settings.LOG_CONFIG) -logger = logging.getLogger("test DMAAP") - -#dmaap = OranDmaap() -#logger.info("Get all the topics") -#topiclist = dmaap.get_all_topics(BASIC_AUTH) -#logger.info("response is: %s", topiclist) - - -#logger.info("Create new topic") -#topic = '{ "topicName": "unauthenticated.SEC_FAULT_OUTPUT", "topicDescription": "test topic", "partitionCount": 1, "replicationCnCount": 1, "transactionEnabled": "false"}' -#response = dmaap.create_topic(topic, BASIC_AUTH) -#logger.info("response is: %s", response) - - -#logger.info("Get topics again") -#topiclist = dmaap.get_all_topics(BASIC_AUTH) -#logger.info("response is: %s", topiclist) - - -def test_dmaap(): - logger.info("Get ric version for ost") - a1sim = A1sim() - version1 = a1sim.check_version(settings.A1SIM_OSC_URL) - - status = a1sim.check_status(settings.A1SIM_OSC_URL) - - number = a1sim.get_policy_number(settings.A1SIM_OSC_URL) - - data = jinja_env().get_template("OSC/policy_type.json.j2").render() - a1sim.create_policy_type(settings.A1SIM_OSC_URL, 1, data) - assert(True) diff --git a/smo-install/test/pythonsdk/test/test_dmaap.py b/smo-install/test/pythonsdk/test/test_dmaap.py deleted file mode 100644 index e1ff1bd2..00000000 --- a/smo-install/test/pythonsdk/test/test_dmaap.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: Apache-2.0 -import logging -from onapsdk.configuration import settings -from oransdk.dmaap.oran_dmaap import OranDmaap -from oransdk.a1sim.a1sim import A1sim - -BASIC_AUTH = {} -logger = logging.getLogger("") -logger.setLevel(logging.DEBUG) -fh = logging.StreamHandler() -fh_formatter = logging.Formatter('%(asctime)s %(levelname)s %(lineno)d:%(filename)s(%(process)d) - %(message)s') -fh.setFormatter(fh_formatter) -logger.addHandler(fh) - -dmaap = OranDmaap() -logger.info("Get all the topics") -topiclist = dmaap.get_all_topics(BASIC_AUTH) -logger.info("response is: %s", topiclist) - - -logger.info("Create new topic") -topic = '{ "topicName": "unauthenticated.SEC_FAULT_OUTPUT", "topicDescription": "test topic", "partitionCount": 1, "replicationCnCount": 1, "transactionEnabled": "false"}' -response = dmaap.create_topic(topic, BASIC_AUTH) -logger.info("response is: %s", response) - - -logger.info("Get topics again") -topiclist = dmaap.get_all_topics(BASIC_AUTH) -logger.info("response is: %s", topiclist) - - - -logger.info("Get ric version for ost") -a1sim = A1sim() -version1 = a1sim.check_version(settings.A1SIM_OST_URL) -version2 = a1sim.check_version(settings.A1SIM_STD1_URL) -version3 = a1sim.check_version(settings.A1SIM_STD2_URL) \ No newline at end of file diff --git a/smo-install/test/pythonsdk/test/test_settings.py b/smo-install/test/pythonsdk/test/test_settings.py deleted file mode 100644 index 1b909fac..00000000 --- a/smo-install/test/pythonsdk/test/test_settings.py +++ /dev/null @@ -1,4 +0,0 @@ -DMAAP_URL = "http://10.152.183.162:3904" -A1SIM_OST_URL = "http://10.1.244.4:8085" -A1SIM_STD1_URL = "http://10.1.244.48:8085" -A1SIM_STD2_URL = "http://10.1.244.30:8085" diff --git a/smo-install/test/pythonsdk/tox.ini b/smo-install/test/pythonsdk/tox.ini index 3e712eeb..1ceb5a59 100644 --- a/smo-install/test/pythonsdk/tox.ini +++ b/smo-install/test/pythonsdk/tox.ini @@ -10,11 +10,12 @@ deps = pydocstyle==5.1.1 onapsdk==9.0.0 waiting==1.4.1 + markupsafe==2.0.1 passenv = * [testenv:unit-tests] basepython=python3.8 -commands = pytest -v --junit-xml=unit-tests.xml unit-tests/ +commands = pytest -v --junit-xml=reports/junit/unit-tests.xml unit-tests/ setenv = PYTHONPATH = $PYTHONPATH:{toxinidir}/src ONAP_PYTHON_SDK_SETTINGS=oransdk.configuration.global_settings @@ -35,7 +36,7 @@ setenv = [testenv:oran-tests] basepython=python3.8 -commands = pytest -v --junit-xml=oran-tests.xml src/orantests/ +commands = pytest -v --junit-xml=reports/junit/oran-tests.xml src/orantests/ setenv = PYTHONPATH = $PYTHONPATH:{toxinidir}/src ONAP_PYTHON_SDK_SETTINGS=orantests.configuration.settings diff --git a/smo-install/tests_oom/Makefile b/smo-install/tests_oom/Makefile new file mode 100644 index 00000000..c2bb6f7f --- /dev/null +++ b/smo-install/tests_oom/Makefile @@ -0,0 +1,124 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# 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. + +PARENT_CHART := oran-tests-suite ru-du-simulators +COMMON_CHARTS_DIR := nonrtric-common aux-common ric-common +# FIXME OOM-765 +ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +OUTPUT_DIR := $(ROOT_DIR)/dist +PACKAGE_DIR := $(OUTPUT_DIR)/packages +SECRET_DIR := $(OUTPUT_DIR)/secrets +HELM_BIN := helm + +# Helm v2 and helm v3 uses different version format so we first try in helm v3 format +# and if it fails then we fallback to helm v2 one +HELM_VER := $(shell $(HELM_BIN) version --template "{{.Version}}" 2>/dev/null) +ifneq "$(findstring v3,$(HELM_VER))" "v3" + HELM_VER := $(shell $(HELM_BIN) version -c --template "{{.Client.SemVer}}") +endif + +# use this if you would like to push onap charts to repo with other name +# WARNING: Helm v3+ only +# WARNING: Make sure to edit also requirements files +HELM_REPO := local + +ifneq ($(SKIP_LINT),TRUE) + HELM_LINT_CMD := $(HELM_BIN) lint +else + HELM_LINT_CMD := echo "Skipping linting of" +endif + +#SUBMODS := robot +#EXCLUDES := config oneclick readiness test dist helm $(PARENT_CHART) dcae $(SUBMODS) +EXCLUDES := config oneclick readiness test dist helm $(PARENT_CHART) +HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.)))) $(PARENT_CHART) + +.PHONY: $(EXCLUDES) $(HELM_CHARTS) check-for-staging-images + +all: print_helm_bin $(COMMON_CHARTS_DIR) $(SUBMODS) $(HELM_CHARTS) helm-repo-update + +$(COMMON_CHARTS): + @echo "\n[$@]" + @make package-$@ + +$(HELM_CHARTS): + @echo "\n[$@]" + @make package-$@ + +$(SUBMODS): + @echo "\n[$@]" + @make submod-$@ + @make package-$@ + +submod-%: + @make $*/requirements.yaml + +%/requirements.yaml: + $(error Submodule $* needs to be retrieved from gerrit. See https://wiki.onap.org/display/DW/OOM+-+Development+workflow+after+code+transfer+to+tech+teams ); fi + +print_helm_bin: + $(info Using Helm binary ${HELM_BIN} which is helm version ${HELM_VER}) + +make-%: + @if [ -f $*/Makefile ]; then make -C $*; fi + +dep-%: make-% + @if [ -f $*/requirements.yaml ]; then $(HELM_BIN) dep up $*; fi + +lint-%: dep-% + @if [ -f $*/Chart.yaml ]; then $(HELM_LINT_CMD) $*; fi + +package-%: lint-% + @mkdir -p $(PACKAGE_DIR) +ifeq "$(findstring v3,$(HELM_VER))" "v3" + @if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$($(HELM_BIN) package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && $(HELM_BIN) push -f $$PACKAGE_NAME $(HELM_REPO); fi +else + @if [ -f $*/Chart.yaml ]; then $(HELM_BIN) package -d $(PACKAGE_DIR) $*; fi + @$(HELM_BIN) repo index $(PACKAGE_DIR) +endif + +clean: + @rm -f */requirements.lock + @find . -type f -name '*.tgz' -delete + @rm -rf $(PACKAGE_DIR)/* + +# publish helm plugins via distrubtion directory +plugins: + @cp -R helm $(PACKAGE_DIR)/ + +# start up a local helm repo to serve up helm chart packages +# WARNING: Only helm < v3 supported +repo: + @mkdir -p $(PACKAGE_DIR) + @$(HELM_BIN) serve --repo-path $(PACKAGE_DIR) & + @sleep 3 + @$(HELM_BIN) repo index $(PACKAGE_DIR) + @$(HELM_BIN) repo add local http://127.0.0.1:8879 + +# stop local helm repo +# WARNING: Only helm < v3 supported +repo-stop: + @pkill $(HELM_BIN) + @$(HELM_BIN) repo remove local + +check-for-staging-images: + $(ROOT_DIR)/contrib/tools/check-for-staging-images.sh + +helm-repo-update: +ifeq "$(findstring v3,$(HELM_VER))" "v3" + @$(HELM_BIN) repo update +endif + +%: + @: diff --git a/smo-install/oran_oom/du-simulator/Chart.yaml b/smo-install/tests_oom/du-simulator/Chart.yaml similarity index 100% rename from smo-install/oran_oom/du-simulator/Chart.yaml rename to smo-install/tests_oom/du-simulator/Chart.yaml diff --git a/smo-install/oran_oom/du-simulator/resources/config/config.json b/smo-install/tests_oom/du-simulator/resources/config/config.json similarity index 100% rename from smo-install/oran_oom/du-simulator/resources/config/config.json rename to smo-install/tests_oom/du-simulator/resources/config/config.json diff --git a/smo-install/oran_oom/du-simulator/resources/config/o-ran-sc-du-hello-world-operational.xml b/smo-install/tests_oom/du-simulator/resources/config/o-ran-sc-du-hello-world-operational.xml similarity index 100% rename from smo-install/oran_oom/du-simulator/resources/config/o-ran-sc-du-hello-world-operational.xml rename to smo-install/tests_oom/du-simulator/resources/config/o-ran-sc-du-hello-world-operational.xml diff --git a/smo-install/oran_oom/du-simulator/resources/config/o-ran-sc-du-hello-world-running.xml b/smo-install/tests_oom/du-simulator/resources/config/o-ran-sc-du-hello-world-running.xml similarity index 100% rename from smo-install/oran_oom/du-simulator/resources/config/o-ran-sc-du-hello-world-running.xml rename to smo-install/tests_oom/du-simulator/resources/config/o-ran-sc-du-hello-world-running.xml diff --git a/smo-install/oran_oom/du-simulator/templates/configmap.yaml b/smo-install/tests_oom/du-simulator/templates/configmap.yaml similarity index 100% rename from smo-install/oran_oom/du-simulator/templates/configmap.yaml rename to smo-install/tests_oom/du-simulator/templates/configmap.yaml diff --git a/smo-install/oran_oom/du-simulator/templates/configmapenv.yaml b/smo-install/tests_oom/du-simulator/templates/configmapenv.yaml similarity index 100% rename from smo-install/oran_oom/du-simulator/templates/configmapenv.yaml rename to smo-install/tests_oom/du-simulator/templates/configmapenv.yaml diff --git a/smo-install/oran_oom/du-simulator/templates/deployment.yaml b/smo-install/tests_oom/du-simulator/templates/deployment.yaml similarity index 100% rename from smo-install/oran_oom/du-simulator/templates/deployment.yaml rename to smo-install/tests_oom/du-simulator/templates/deployment.yaml diff --git a/smo-install/oran_oom/du-simulator/templates/service.yaml b/smo-install/tests_oom/du-simulator/templates/service.yaml similarity index 100% rename from smo-install/oran_oom/du-simulator/templates/service.yaml rename to smo-install/tests_oom/du-simulator/templates/service.yaml diff --git a/smo-install/oran_oom/du-simulator/values.yaml b/smo-install/tests_oom/du-simulator/values.yaml similarity index 98% rename from smo-install/oran_oom/du-simulator/values.yaml rename to smo-install/tests_oom/du-simulator/values.yaml index 02e657bc..9d3142d8 100644 --- a/smo-install/oran_oom/du-simulator/values.yaml +++ b/smo-install/tests_oom/du-simulator/values.yaml @@ -14,7 +14,7 @@ # Static Defaults image: - repository: 'nexus3.o-ran-sc.org:10004/o-ran-sc' + repository: 'nexus3.o-ran-sc.org:10001/o-ran-sc' name: nts-ng-o-ran-du tag: 1.4.3 pullPolicy: IfNotPresent diff --git a/smo-install/tests_oom/oran-tests-suite/Chart.yaml b/smo-install/tests_oom/oran-tests-suite/Chart.yaml new file mode 100644 index 00000000..e41ddb94 --- /dev/null +++ b/smo-install/tests_oom/oran-tests-suite/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: oran-tests-suite +version: 1.0.0 +appVersion: 1.0.0 +description: Open Radio Access Network (ORAN) +home: https://www.o-ran.org/ +sources: +- https://gerrit.o-ran-sc.org/r/#/admin/projects/ +kubeVersion: ">=1.19.0-0" diff --git a/smo-install/tests_oom/oran-tests-suite/requirements.yaml b/smo-install/tests_oom/oran-tests-suite/requirements.yaml new file mode 100644 index 00000000..2bf40123 --- /dev/null +++ b/smo-install/tests_oom/oran-tests-suite/requirements.yaml @@ -0,0 +1,23 @@ +# Copyright © 2021-2022 AT&T Intellectual Property +# +# 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. + +dependencies: + - name: jenkins + version: ~3.11.3 + repository: https://charts.jenkins.io + condition: testsSuite.jenkins + - name: oran-tests + version: ~1.0.0 + repository: "@local" + condition: testsSuite.tests diff --git a/smo-install/tests_oom/oran-tests-suite/templates/secret.yaml b/smo-install/tests_oom/oran-tests-suite/templates/secret.yaml new file mode 100644 index 00000000..66961de0 --- /dev/null +++ b/smo-install/tests_oom/oran-tests-suite/templates/secret.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Secret +metadata: + name: github-secret-credentials +type: kubernetes.io/basic-auth +stringData: + username: {{.Values.github.username}} + password: {{.Values.github.password}} + +--- + +apiVersion: v1 +kind: Secret +metadata: + name: gerrit-secret-credentials +type: kubernetes.io/basic-auth +stringData: + username: {{.Values.gerrit.username}} + password: {{.Values.gerrit.password}} + diff --git a/smo-install/tests_oom/oran-tests-suite/values.yaml b/smo-install/tests_oom/oran-tests-suite/values.yaml new file mode 100644 index 00000000..64c1a147 --- /dev/null +++ b/smo-install/tests_oom/oran-tests-suite/values.yaml @@ -0,0 +1,351 @@ +# Copyright © 2022 AT&T Intellectual Property +# +# 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. + +testsSuite: + jenkins: true + tests: false + +oran-tests: + oranTests: + name: orantests1 + flag: true + commitId: 7b4b4007db003d28ee347e3d373e8ac605581cb5 + +github: + username: testuser + password: api-token +gerrit: + username: testuser + password: api-token + +jenkins: + controller: + imagePullPolicy: "IfNotPresent" + nodePort: 32080 + serviceType: NodePort + additionalExistingSecrets: + - name: github-secret-credentials + keyName: username + - name: github-secret-credentials + keyName: password + - name: gerrit-secret-credentials + keyName: username + - name: gerrit-secret-credentials + keyName: password + + + additionalPlugins: + - job-dsl:1.77 + - pipeline-githubnotify-step:1.0.5 + - lockable-resources:2.14 + - gerrit-code-review:0.4.4 + JCasC: + securityRealm: |- + local: + allowsSignup: false + enableCaptcha: false + users: + - id: "test" + name: "Jenkins Admin" + password: "test" + authorizationStrategy: |- + loggedInUsersCanDoAnything: + allowAnonymousRead: true + defaultConfig: true + configScripts: + welcome-message: | + jenkins: + systemMessage: Welcome to the ORAN SMO Package embedded CI\CD server. This Jenkins is configured and managed 'as code'. + credentials: | + credentials: + system: + domainCredentials: + - credentials: + - usernamePassword: + description: "github access username password" + id: "github_username_pass" + password: ${github-secret-credentials-password} + scope: GLOBAL + username: ${github-secret-credentials-username} + - usernamePassword: + description: "gerrit access username password" + id: "gerrit_username_pass" + password: ${gerrit-secret-credentials-password} + scope: GLOBAL + username: ${gerrit-secret-credentials-username} + + proxy: "" + views: | + jenkins: + views: + - all: + name: "all" + - list: + columns: + - "status" + - "weather" + - "jobName" + - "lastSuccess" + - "lastFailure" + - "lastDuration" + - "buildButton" + includeRegex: "github-manual.*" + name: "github-manual" + - list: + columns: + - "status" + - "weather" + - "jobName" + - "lastSuccess" + - "lastFailure" + - "lastDuration" + - "buildButton" + includeRegex: "gerrit-manual.*" + name: "gerrit-manual" + - list: + columns: + - "status" + - "weather" + - "jobName" + - "lastSuccess" + - "lastFailure" + - "lastDuration" + - "buildButton" + includeRegex: "github-automatic.*" + name: "github-automatic" + - list: + columns: + - "status" + - "weather" + - "jobName" + - "lastSuccess" + - "lastFailure" + - "lastDuration" + - "buildButton" + includeRegex: "gerrit-automatic.*" + name: "gerrit-automatic" + + + proxy: "" + pipeline-job: | + jobs: + - script: > + pipelineJob('github-manual-start-test') { + parameters { + stringParam('BRANCH',"*/main","Branch or Commit ID") + stringParam('FLAVOR', "pythonsdk-tests", "Helm override SMO Package flavor, it is obviously the directory in the helm-override folder") + } + concurrentBuild(false) + description('This job is triggered manually to execute the SMO tests on the RUNNING SMO in the K8S cluster') + definition { + cpsScm { + scm { + git { + remote { + github('sebdet/oran-deployment') + } + branch('$BRANCH') + extensions { + cleanBeforeCheckout() + } + + } + } + scriptPath("jenkins/github/manual-tests-pipeline") + } + } + } + - script: > + pipelineJob('github-manual-start-smo') { + parameters { + stringParam('BRANCH',"*/main","Branch or Commit ID") + stringParam('FLAVOR', "pythonsdk-tests", "Helm override SMO Package flavor, it is obviously the directory in the helm-override folder") + } + description('This job is triggered manually to start SMO in the K8S cluster') + concurrentBuild(false) + definition { + cpsScm { + scm { + git { + remote { + github('sebdet/oran-deployment') + } + branch('$BRANCH') + extensions { + cleanBeforeCheckout() + } + } + } + scriptPath("jenkins/github/manual-start-pipeline") + } + } + } + - script: > + pipelineJob('github-manual-stop-smo') { + parameters { + stringParam('BRANCH',"*/main","Branch or Commit ID") + } + + concurrentBuild(false) + description('This job is triggered manually to stop the running SMO in the K8S cluster') + definition { + cpsScm { + scm { + git { + remote { + github('sebdet/oran-deployment') + } + branch('$BRANCH') + } + } + scriptPath("jenkins/github/manual-stop-pipeline") + } + } + } + - script: > + multibranchPipelineJob('github-automatic-trigger-verify') { + description('This job is triggered automatically when pull requests are opened on GITHUB.') + triggers { + periodic(30) + } + branchSources { + github { + id('1') // IMPORTANT: use a constant and unique identifier + repoOwner('sebdet') + repository('oran-deployment') + scanCredentialsId('github_username_pass') + buildForkPRHead(false) + buildForkPRMerge(false) + buildOriginBranch(true) + buildOriginBranchWithPR(false) + buildOriginPRHead(true) + buildOriginPRMerge(false) + } + } + factory { + workflowBranchProjectFactory { + // Relative location within the checkout of your Pipeline script. + scriptPath("jenkins/github/automatic-verify-pipeline") + } + } + } + - script: > + multibranchPipelineJob('gerrit-automatic-trigger-verify') { + description('This job is triggered automatically when pull requests are opened on LF GERRIT.') + triggers { + periodic(30) + } + branchSources { + branchSource { + source { + gerrit { + id('2') // IMPORTANT: use a constant and unique identifier + credentialsId('gerrit_username_pass') + remote("https://gerrit.o-ran-sc.org/r/a/it/dep") + traits { + changeDiscoveryTrait { + queryString("is:open") + } + } + } + } + } + } + factory { + + workflowBranchProjectFactory { + // Relative location within the checkout of your Pipeline script. + scriptPath("smo-install/jenkins/gerrit/automatic-verify-pipeline") + } + } + } + + - script: > + pipelineJob('gerrit-manual-start-test') { + parameters { + stringParam('BRANCH',"master","Branch or Commit ID") + stringParam('FLAVOR', "pythonsdk-tests", "Helm override SMO Package flavor, it is obviously the directory in the helm-override folder") + } + concurrentBuild(false) + description('This job is triggered manually to execute the SMO tests on the RUNNING SMO in the K8S cluster') + definition { + cpsScm { + scm { + git { + remote { + url('https://gerrit.o-ran-sc.org/r/it/dep') + } + branch('$BRANCH') + extensions { + cleanBeforeCheckout() + } + + } + } + scriptPath("smo-install/jenkins/gerrit/manual-tests-pipeline") + } + } + } + + - script: > + pipelineJob('gerrit-manual-start-smo') { + parameters { + stringParam('BRANCH',"master","Branch or Commit ID") + stringParam('FLAVOR', "pythonsdk-tests", "Helm override SMO Package flavor, it is obviously the directory in the helm-override folder") + } + description('This job is triggered manually to start SMO in the K8S cluster') + concurrentBuild(false) + definition { + cpsScm { + scm { + git { + remote { + url('https://gerrit.o-ran-sc.org/r/it/dep') + } + branch('$BRANCH') + extensions { + cleanBeforeCheckout() + } + } + } + scriptPath("smo-install/jenkins/gerrit/manual-start-pipeline") + } + } + } + + - script: > + pipelineJob('gerrit-manual-stop-smo') { + parameters { + stringParam('BRANCH',"master","Branch or Commit ID") + } + + concurrentBuild(false) + description('This job is triggered manually to stop the running SMO in the K8S cluster') + definition { + cpsScm { + scm { + git { + remote { + url('https://gerrit.o-ran-sc.org/r/it/dep') + } + branch('$BRANCH') + extensions { + cleanBeforeCheckout() + } + } + } + scriptPath("smo-install/jenkins/gerrit/manual-stop-pipeline") + } + } + } diff --git a/smo-install/tests_oom/oran-tests/Chart.yaml b/smo-install/tests_oom/oran-tests/Chart.yaml new file mode 100644 index 00000000..983ff686 --- /dev/null +++ b/smo-install/tests_oom/oran-tests/Chart.yaml @@ -0,0 +1,19 @@ +# Copyright © 2022 AT&T Intellectual Property +# +# 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. + +apiVersion: v1 +appVersion: "1.0.0" +description: A Helm chart to deploy the python sdk tests +name: oran-tests +version: 1.0.0 diff --git a/smo-install/tests_oom/oran-tests/templates/configmapenv.yaml b/smo-install/tests_oom/oran-tests/templates/configmapenv.yaml new file mode 100644 index 00000000..9cef25f5 --- /dev/null +++ b/smo-install/tests_oom/oran-tests/templates/configmapenv.yaml @@ -0,0 +1,24 @@ +# Copyright © 2021-2022 AT&T Intellectual Property +# +# 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. + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.oranTests.name }}-configmapenv + labels: + tests-name: {{ .Values.oranTests.name }}-env + release: {{ .Release.Name }} + chart: {{ .Chart.Name }} +data: + SSH_CONNECTIONS: {{ .Values.oranTests.flag | quote }} diff --git a/smo-install/tests_oom/oran-tests/templates/job.yaml b/smo-install/tests_oom/oran-tests/templates/job.yaml new file mode 100644 index 00000000..b6a83b6c --- /dev/null +++ b/smo-install/tests_oom/oran-tests/templates/job.yaml @@ -0,0 +1,72 @@ +# Copyright © 2021-2022 AT&T Intellectual Property +# +# 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. + +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ .Values.oranTests.name }} + labels: + tests-name: {{ .Values.oranTests.name }} + release: {{ .Release.Name }} + chart: {{ .Chart.Name }} +spec: + manualSelector: true + selector: + matchLabels: + tests-name: {{ .Values.oranTests.name }} + template: + metadata: + labels: + tests-name: {{ .Values.oranTests.name }} + release: {{ .Release.Name }} + chart: {{ .Chart.Name }} + annotations: + checksum/config: {{ print .Values | sha256sum }} + spec: + hostname: "{{ .Values.oranTests.name }}" + restartPolicy: Never + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}/{{ .Values.image.name}}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + tty: true + stdin: true + envFrom: + - configMapRef: + name: {{ .Values.oranTests.name }}-configmapenv + securityContext: + capabilities: + add: + - SYS_ADMIN + - SYS_PTRACE + command: ["/bin/sh", "-c"] + args: + - apt-get update -y; + DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata; + apt-get install git wget sudo -y; + wget https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl; + mv kubectl /usr/bin; + chmod a+x /usr/bin/kubectl; + kubectl version; + + cd /opt; + git clone --recursive "https://github.com/sebdet/oran-deployment.git"; + cd /opt/oran-deployment; + git reset --hard {{ .Values.oranTests.commitId }}; + /opt/oran-deployment/scripts/layer-0/0-setup-tests-env.sh; + /opt/oran-deployment/scripts/layer-0/0-setup-charts-museum.sh; + /opt/oran-deployment/scripts/layer-0/0-setup-helm3.sh; + /opt/oran-deployment/scripts/sub-scripts/build-tests.sh; + cd test/pythonsdk; + tox; diff --git a/smo-install/tests_oom/oran-tests/templates/service.yaml b/smo-install/tests_oom/oran-tests/templates/service.yaml new file mode 100644 index 00000000..a2d1aa43 --- /dev/null +++ b/smo-install/tests_oom/oran-tests/templates/service.yaml @@ -0,0 +1,31 @@ +# Copyright © 2021-2022 AT&T Intellectual Property +# +# 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. + +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.oranTests.name }}" + labels: + tests-name: {{ .Values.oranTests.name }} + release: {{ .Release.Name }} + chart: {{ .Chart.Name }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.ports.port }} + nodePort: {{ .Values.service.ports.nodePort }} + selector: + tests-name: {{ .Values.oranTests.name }} + release: {{ .Release.Name }} + chart: {{ .Chart.Name }} diff --git a/smo-install/tests_oom/oran-tests/values.yaml b/smo-install/tests_oom/oran-tests/values.yaml new file mode 100644 index 00000000..faa281de --- /dev/null +++ b/smo-install/tests_oom/oran-tests/values.yaml @@ -0,0 +1,31 @@ +# Copyright © 2021-2022 AT&T Intellectual Property +# +# 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. + +# Static Defaults +image: + repository: docker.io + name: ubuntu + tag: 20.04 + pullPolicy: IfNotPresent + +oranTests: + name: orantests1 + flag: true + commitId: 7b4b4007db003d28ee347e3d373e8ac605581cb5 +service: + type: NodePort + ports: + port: 830 + nodePort: 30901 + diff --git a/smo-install/oran_oom/ru-du-simulators/Chart.yaml b/smo-install/tests_oom/ru-du-simulators/Chart.yaml similarity index 100% rename from smo-install/oran_oom/ru-du-simulators/Chart.yaml rename to smo-install/tests_oom/ru-du-simulators/Chart.yaml diff --git a/smo-install/oran_oom/ru-du-simulators/requirements.yaml b/smo-install/tests_oom/ru-du-simulators/requirements.yaml similarity index 100% rename from smo-install/oran_oom/ru-du-simulators/requirements.yaml rename to smo-install/tests_oom/ru-du-simulators/requirements.yaml diff --git a/smo-install/oran_oom/ru-du-simulators/values.yaml b/smo-install/tests_oom/ru-du-simulators/values.yaml similarity index 100% rename from smo-install/oran_oom/ru-du-simulators/values.yaml rename to smo-install/tests_oom/ru-du-simulators/values.yaml diff --git a/smo-install/oran_oom/ru-simulator/Chart.yaml b/smo-install/tests_oom/ru-simulator/Chart.yaml similarity index 100% rename from smo-install/oran_oom/ru-simulator/Chart.yaml rename to smo-install/tests_oom/ru-simulator/Chart.yaml diff --git a/smo-install/oran_oom/ru-simulator/resources/config/config.json b/smo-install/tests_oom/ru-simulator/resources/config/config.json similarity index 100% rename from smo-install/oran_oom/ru-simulator/resources/config/config.json rename to smo-install/tests_oom/ru-simulator/resources/config/config.json diff --git a/smo-install/oran_oom/ru-simulator/resources/config/ietf-hardware-operational.json b/smo-install/tests_oom/ru-simulator/resources/config/ietf-hardware-operational.json similarity index 100% rename from smo-install/oran_oom/ru-simulator/resources/config/ietf-hardware-operational.json rename to smo-install/tests_oom/ru-simulator/resources/config/ietf-hardware-operational.json diff --git a/smo-install/oran_oom/ru-simulator/resources/config/ietf-hardware-running.json b/smo-install/tests_oom/ru-simulator/resources/config/ietf-hardware-running.json similarity index 100% rename from smo-install/oran_oom/ru-simulator/resources/config/ietf-hardware-running.json rename to smo-install/tests_oom/ru-simulator/resources/config/ietf-hardware-running.json diff --git a/smo-install/oran_oom/ru-simulator/resources/config/ietf-interfaces-operational.xml b/smo-install/tests_oom/ru-simulator/resources/config/ietf-interfaces-operational.xml similarity index 100% rename from smo-install/oran_oom/ru-simulator/resources/config/ietf-interfaces-operational.xml rename to smo-install/tests_oom/ru-simulator/resources/config/ietf-interfaces-operational.xml diff --git a/smo-install/oran_oom/ru-simulator/resources/config/ietf-interfaces-running.xml b/smo-install/tests_oom/ru-simulator/resources/config/ietf-interfaces-running.xml similarity index 100% rename from smo-install/oran_oom/ru-simulator/resources/config/ietf-interfaces-running.xml rename to smo-install/tests_oom/ru-simulator/resources/config/ietf-interfaces-running.xml diff --git a/smo-install/oran_oom/ru-simulator/templates/configmap.yaml b/smo-install/tests_oom/ru-simulator/templates/configmap.yaml similarity index 100% rename from smo-install/oran_oom/ru-simulator/templates/configmap.yaml rename to smo-install/tests_oom/ru-simulator/templates/configmap.yaml diff --git a/smo-install/oran_oom/ru-simulator/templates/configmapenv.yaml b/smo-install/tests_oom/ru-simulator/templates/configmapenv.yaml similarity index 100% rename from smo-install/oran_oom/ru-simulator/templates/configmapenv.yaml rename to smo-install/tests_oom/ru-simulator/templates/configmapenv.yaml diff --git a/smo-install/oran_oom/ru-simulator/templates/deployment.yaml b/smo-install/tests_oom/ru-simulator/templates/deployment.yaml similarity index 100% rename from smo-install/oran_oom/ru-simulator/templates/deployment.yaml rename to smo-install/tests_oom/ru-simulator/templates/deployment.yaml diff --git a/smo-install/oran_oom/ru-simulator/templates/service.yaml b/smo-install/tests_oom/ru-simulator/templates/service.yaml similarity index 100% rename from smo-install/oran_oom/ru-simulator/templates/service.yaml rename to smo-install/tests_oom/ru-simulator/templates/service.yaml diff --git a/smo-install/oran_oom/ru-simulator/values.yaml b/smo-install/tests_oom/ru-simulator/values.yaml similarity index 98% rename from smo-install/oran_oom/ru-simulator/values.yaml rename to smo-install/tests_oom/ru-simulator/values.yaml index 532ea2e8..66647786 100644 --- a/smo-install/oran_oom/ru-simulator/values.yaml +++ b/smo-install/tests_oom/ru-simulator/values.yaml @@ -14,7 +14,7 @@ # Static Defaults image: - repository: 'nexus3.o-ran-sc.org:10004/o-ran-sc' + repository: 'nexus3.o-ran-sc.org:10001/o-ran-sc' name: nts-ng-o-ran-ru-fh tag: 1.4.3 pullPolicy: IfNotPresent diff --git a/smo-install/oran_oom/topology-server/Chart.yaml b/smo-install/tests_oom/topology-server/Chart.yaml similarity index 100% rename from smo-install/oran_oom/topology-server/Chart.yaml rename to smo-install/tests_oom/topology-server/Chart.yaml diff --git a/smo-install/oran_oom/topology-server/resources/config/config.json b/smo-install/tests_oom/topology-server/resources/config/config.json similarity index 100% rename from smo-install/oran_oom/topology-server/resources/config/config.json rename to smo-install/tests_oom/topology-server/resources/config/config.json diff --git a/smo-install/oran_oom/topology-server/resources/config/tapi-common-operational.xml b/smo-install/tests_oom/topology-server/resources/config/tapi-common-operational.xml similarity index 100% rename from smo-install/oran_oom/topology-server/resources/config/tapi-common-operational.xml rename to smo-install/tests_oom/topology-server/resources/config/tapi-common-operational.xml diff --git a/smo-install/oran_oom/topology-server/resources/config/tapi-common-running.xml b/smo-install/tests_oom/topology-server/resources/config/tapi-common-running.xml similarity index 100% rename from smo-install/oran_oom/topology-server/resources/config/tapi-common-running.xml rename to smo-install/tests_oom/topology-server/resources/config/tapi-common-running.xml diff --git a/smo-install/oran_oom/topology-server/templates/configmap.yaml b/smo-install/tests_oom/topology-server/templates/configmap.yaml similarity index 100% rename from smo-install/oran_oom/topology-server/templates/configmap.yaml rename to smo-install/tests_oom/topology-server/templates/configmap.yaml diff --git a/smo-install/oran_oom/topology-server/templates/configmapenv.yaml b/smo-install/tests_oom/topology-server/templates/configmapenv.yaml similarity index 100% rename from smo-install/oran_oom/topology-server/templates/configmapenv.yaml rename to smo-install/tests_oom/topology-server/templates/configmapenv.yaml diff --git a/smo-install/oran_oom/topology-server/templates/deployment.yaml b/smo-install/tests_oom/topology-server/templates/deployment.yaml similarity index 100% rename from smo-install/oran_oom/topology-server/templates/deployment.yaml rename to smo-install/tests_oom/topology-server/templates/deployment.yaml diff --git a/smo-install/oran_oom/topology-server/templates/service.yaml b/smo-install/tests_oom/topology-server/templates/service.yaml similarity index 100% rename from smo-install/oran_oom/topology-server/templates/service.yaml rename to smo-install/tests_oom/topology-server/templates/service.yaml diff --git a/smo-install/oran_oom/topology-server/values.yaml b/smo-install/tests_oom/topology-server/values.yaml similarity index 99% rename from smo-install/oran_oom/topology-server/values.yaml rename to smo-install/tests_oom/topology-server/values.yaml index 1a738bbc..47c33382 100644 --- a/smo-install/oran_oom/topology-server/values.yaml +++ b/smo-install/tests_oom/topology-server/values.yaml @@ -17,7 +17,7 @@ replicaCount: 1 image: repository: 'nexus3.o-ran-sc.org:10004/o-ran-sc' name: smo-nts-ng-topology-server - tag: 1.4.3 + tag: 1.4.5 pullPolicy: IfNotPresent service: -- 2.16.6