From: Kevin Sandi Date: Tue, 9 Apr 2024 20:44:07 +0000 (-0600) Subject: Chore: Add gerrit maven verify GHA workflow X-Git-Url: https://gerrit.onap.org/r/gitweb?p=sdnc%2Foam.git;a=commitdiff_plain;h=refs%2Fheads%2Fmaster;hp=fbf997335b6cca38872e855ca168f20b18b286f5 Chore: Add gerrit maven verify GHA workflow Issue-ID: CIMAN-33 Change-Id: I08d63083ec1544936a131a54d519369183d54f0f Signed-off-by: Kevin Sandi --- diff --git a/.github/workflows/gerrit-verify.yaml b/.github/workflows/gerrit-verify.yaml new file mode 100644 index 00000000..28a59b21 --- /dev/null +++ b/.github/workflows/gerrit-verify.yaml @@ -0,0 +1,114 @@ +--- +name: Gerrit Composed Maven Verify + +# yamllint disable-line rule:truthy +on: + workflow_dispatch: + inputs: + GERRIT_BRANCH: + description: "Branch that change is against" + required: true + type: string + GERRIT_CHANGE_ID: + description: "The ID for the change" + required: true + type: string + GERRIT_CHANGE_NUMBER: + description: "The Gerrit number" + required: true + type: string + GERRIT_CHANGE_URL: + description: "URL to the change" + required: true + type: string + GERRIT_EVENT_TYPE: + description: "Type of Gerrit event" + required: true + type: string + GERRIT_PATCHSET_NUMBER: + description: "The patch number for the change" + required: true + type: string + GERRIT_PATCHSET_REVISION: + description: "The revision sha" + required: true + type: string + GERRIT_PROJECT: + description: "Project in Gerrit" + required: true + type: string + GERRIT_REFSPEC: + description: "Gerrit refspec of change" + required: true + type: string + +concurrency: + # yamllint disable-line rule:line-length + group: compose-maven-verify-${{ github.workflow }}-${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }} + cancel-in-progress: true + +jobs: + prepare: + runs-on: ubuntu-latest + steps: + - name: Clear votes + # yamllint disable-line rule:line-length + uses: lfit/gerrit-review-action@6ac4c2322b68c0120a9b516eb0421491ee1b3fdf # v0.4 + with: + host: ${{ vars.GERRIT_SERVER }} + username: ${{ vars.GERRIT_SSH_USER }} + key: ${{ secrets.GERRIT_SSH_PRIVKEY }} + known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }} + gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }} + gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }} + vote-type: clear + comment-only: true + - name: Allow replication + run: sleep 10s + + maven-verify: + needs: prepare + # use compose-jjb-verify from the v0.4 series of releng-reusable-workflows + # yamllint disable-line rule:line-length + uses: lfit/releng-reusable-workflows/.github/workflows/compose-maven-verify.yaml@main + with: + GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }} + GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }} + GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }} + GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }} + GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }} + GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }} + GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }} + GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }} + GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }} + JDK_VERSION: "17" + MVN_VERSION: "3.8.2" + MVN_PROFILES: "docker" + MVN_OPTS: >- + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r + -DaltDeploymentRepository=staging::default::file:"${GITHUB_WORKSPACE}"/m2repo + -Dkaraf.keep.unpack + -Ddocker.skip.push=true + + vote: + if: ${{ always() }} + # yamllint enable rule:line-length + needs: [prepare, maven-verify] + runs-on: ubuntu-latest + steps: + - name: Get conclusion + # yamllint disable-line rule:line-length + uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # v3.0.3 + - name: Set vote + # yamllint disable-line rule:line-length + uses: lfit/gerrit-review-action@6ac4c2322b68c0120a9b516eb0421491ee1b3fdf # v0.4 + with: + host: ${{ vars.GERRIT_SERVER }} + username: ${{ vars.GERRIT_SSH_USER }} + key: ${{ secrets.GERRIT_SSH_PRIVKEY }} + known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }} + gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }} + gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }} + vote-type: ${{ env.WORKFLOW_CONCLUSION }} + comment-only: true diff --git a/.gitignore b/.gitignore index b632be92..33b7de6d 100755 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ org.eclipse.core.resources.prefs .pydevproject maven-eclipse.xml workspace +.factorypath +.vscode ## Compilation Files ## *.class diff --git a/.gitreview b/.gitreview index 77039608..a433b844 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,4 @@ host=gerrit.onap.org port=29418 project=sdnc/oam.git +defaultbranch=master diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 3797dc8b..192952d2 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -5,14 +5,12 @@ # Required version: 2 -formats: - - htmlzip - build: - image: latest + os: ubuntu-20.04 + tools: + python: "3.8" python: - version: 3.7 install: - requirements: docs/requirements-docs.txt diff --git a/INFO.yaml b/INFO.yaml index f8b0d372..fd99c558 100644 --- a/INFO.yaml +++ b/INFO.yaml @@ -21,32 +21,36 @@ mailing_list: realtime_discussion: '' meetings: - type: 'zoom' - agenda: 'https://wiki.onap.org/display/DW/Software+Defined+Network+Controller+Project' - url: 'https://wiki.onap.org/display/DW/Software+Defined+Network+Controller+Project#SoftwareDefinedNetworkControllerProject-Meetings' server: 'n/a' channel: 'n/a' repeats: 'weekly' time: '13:00 UTC' repositories: - - 'sdnc/adaptors' - - 'sdnc/apps' - - 'sdnc/northbound' - 'sdnc/oam' committers: - <<: *onap_sdnc_ptl - - name: 'Prabhuram Somasundaram' - email: 'ps7551@att.com' - company: 'ATT' - id: 'Prabhu_Ram' - timezone: '' - - name: 'David Stilwell' - email: 'stilwelld@att.com' - company: 'ATT' - id: 'stilwelld' - timezone: '' + - name: 'Herbert Eiselt' + email: 'herbert.eiselt@highstreet-technologies.com' + company: 'Highstreet Technologies' + id: 'highstreetherbert' + timezone: 'Germany/Berlin' + - name: 'Michael Durre' + email: 'michael.duerre@highstreet-technologies.com' + company: 'Highstreet Technologies' + id: 'metaljackL' + timezone: 'Germany/Berlin' tsc: approval: 'https://lists.onap.org/pipermail/onap-tsc' changes: - type: 'Deletion' name: 'Ryan Goulding' link: 'https://lists.onap.org/g/onap-tsc/message/4261' + - type: 'Addition' + name: 'Herbert Eiselt' + link: 'https://lists.onap.org/g/onap-tsc/message/6952' + - type: 'Addition' + name: 'Michael Durre' + link: 'https://lists.onap.org/g/onap-tsc/message/6952' + - type: 'Deletion' + name: 'David Stilwell' + link: 'https://lists.onap.org/g/onap-tsc/message/8308' diff --git a/README.md b/README.md index 98b67fb0..e24b0c35 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,36 @@ -This source repository contains the code for SDN Controller operations, administration and maintenance utilities. This code depends on the following, which should be downloaded and compiled first: +This source repository contains the directed graphs to support the +SDNC controller, as well as the code to create the SDNC docker containers. -1. org.openecomp.sdnc/sdnc-core -2. org.openecomp.sdnc/sdnc-adaptors -3. org.openecomp.sdnc/sdnc-northbound -4. org.openecomp.sdnc/sdnc-plugins +# Local compilation -To compile this code: +The following command will do a local build and create all SDNC +docker containers: -1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains references to the OpenECOMP repositories and OpenDaylight repositories. See example-settings.xml for an example. +```bash +mvn clean install -P docker -Ddocker.pull.registry=nexus3.onap.org:10001 +``` -2. To compile, run "mvn clean install". +To do a local build of only the SDNC controller docker image: +```bash +cd installation/sdnc +mvn clean install -P docker -Ddocker.pull.registry=nexus3.onap.org:10001 +``` + +# Local CSIT testing + +To perform local CSIT testing, first create a local docker build +of the SDNC controller images following the steps above. + +Important note: CSIT testing is still based on Python2. So, before +running the CSIT locally, be sure that your local environment is +using the python2 version of 'python' and 'pip' + +Once you have a local SDNC image build and python2 is installed, +you can run a local CSIT test by running the following commands: + +```bash +cd csit +./run-project-csit.sh +``` diff --git a/SdncReports/SdncReportsApi/pom.xml b/SdncReports/SdncReportsApi/pom.xml index b0e7c043..b4641af8 100644 --- a/SdncReports/SdncReportsApi/pom.xml +++ b/SdncReports/SdncReportsApi/pom.xml @@ -1,191 +1,189 @@ - 4.0.0 - jar - SdncReportsApi - org.onap.sdnc.oam - 2.0.0-SNAPSHOT - sdnc-oam :: SdncReports :: SdncReportsApi - - org.onap.sdnc.oam - SdncReports - 2.0.0-SNAPSHOT - - - - - UTF-8 - UTF-8 - 1.8 - - - - - - ch.vorburger.mariaDB4j - mariaDB4j - 2.2.3 - - - - - com.google.code.gson - gson - 2.8.2 - - - - ${project.groupId} - SdncReportsDao - ${project.version} - - - - org.mariadb.jdbc - mariadb-java-client - 1.1.9 - - - - org.springframework.boot - spring-boot-starter-web - 1.5.4.RELEASE - - - - org.springframework - spring-context - 4.3.9.RELEASE - - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - - - org.springframework.boot - spring-boot-devtools - true - - - - org.springframework.boot - spring-boot-starter-test - test - 1.5.3.RELEASE - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - - - org.springframework.boot - spring-boot-starter-log4j2 - - - - - org.webjars - bootstrap - 3.3.7 - - - - org.webjars - bootstrap-datepicker - 1.0.1 - - - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - - org.jacoco - jacoco-maven-plugin - 0.7.5.201505241946 - - - pre-unit-test - - prepare-agent - - - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - - surefireArgLine - - - - - post-unit-test - test - - report - - - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - - ${project.reporting.outputDirectory}/jacoco-ut - - - - - - - io.fabric8 - docker-maven-plugin - 0.15.3 - - http://127.0.0.1:9092 - true - - - vishal/sdnc_report - - Dockerfile - - artifact - - - - - - - - + 4.0.0 + + + org.onap.sdnc.oam + SdncReports + 2.2.0-SNAPSHOT + + + SdncReportsApi + jar + + sdnc-oam :: SdncReports :: SdncReportsApi + + + UTF-8 + UTF-8 + 1.8 + + + + + + ch.vorburger.mariaDB4j + mariaDB4j + 2.2.3 + + + + + com.google.code.gson + gson + 2.8.2 + + + + ${project.groupId} + SdncReportsDao + ${project.version} + + + + org.mariadb.jdbc + mariadb-java-client + 1.1.9 + + + + org.springframework.boot + spring-boot-starter-web + 1.5.4.RELEASE + + + + org.springframework + spring-context + 4.3.9.RELEASE + + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + + + + + org.springframework.boot + spring-boot-devtools + true + + + + org.springframework.boot + spring-boot-starter-test + 1.5.3.RELEASE + test + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + + org.springframework.boot + spring-boot-starter-log4j2 + + + + + org.webjars + bootstrap + 3.3.7 + + + + org.webjars + bootstrap-datepicker + 1.0.1 + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + org.jacoco + jacoco-maven-plugin + 0.7.5.201505241946 + + + pre-unit-test + + prepare-agent + + + + ${project.build.directory}/coverage-reports/jacoco-ut.exec + + surefireArgLine + + + + + post-unit-test + test + + report + + + + ${project.build.directory}/coverage-reports/jacoco-ut.exec + + ${project.reporting.outputDirectory}/jacoco-ut + + + + + + + io.fabric8 + docker-maven-plugin + 0.15.3 + + http://127.0.0.1:9092 + true + + + vishal/sdnc_report + + Dockerfile + + artifact + + + + + + + + diff --git a/SdncReports/SdncReportsApi/src/main/webapp/WEB-INF/views/index.jsp b/SdncReports/SdncReportsApi/src/main/webapp/WEB-INF/views/index.jsp index 3c7be352..1bc683d9 100644 --- a/SdncReports/SdncReportsApi/src/main/webapp/WEB-INF/views/index.jsp +++ b/SdncReports/SdncReportsApi/src/main/webapp/WEB-INF/views/index.jsp @@ -26,15 +26,15 @@ - - + + - + @@ -55,13 +55,13 @@
-
+
- + - \ No newline at end of file + diff --git a/SdncReports/SdncReportsDao/pom.xml b/SdncReports/SdncReportsDao/pom.xml index 5c959944..453907d2 100644 --- a/SdncReports/SdncReportsDao/pom.xml +++ b/SdncReports/SdncReportsDao/pom.xml @@ -1,59 +1,57 @@ - 4.0.0 - org.onap.sdnc.oam - SdncReportsDao - 2.0.0-SNAPSHOT - jar - - sdnc-oam :: SdncReports :: SdncReportsDao - - - org.onap.sdnc.oam - SdncReports - 2.0.0-SNAPSHOT - - - - - org.springframework - spring-context - - - - org.springframework.boot - spring-boot-starter-test - test - 1.5.3.RELEASE - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.hibernate - hibernate-entitymanager - - - - - - - - - - com.fasterxml.jackson.core - jackson-annotations - - - - - org.mariadb.jdbc - mariadb-java-client - 1.1.7 - - + 4.0.0 + + + org.onap.sdnc.oam + SdncReports + 2.2.0-SNAPSHOT + + + SdncReportsDao + jar + + sdnc-oam :: SdncReports :: SdncReportsDao + + + + org.springframework + spring-context + + + + org.springframework.boot + spring-boot-starter-test + 1.5.3.RELEASE + test + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.hibernate + hibernate-entitymanager + + + + + + + + + com.fasterxml.jackson.core + jackson-annotations + + + + + org.mariadb.jdbc + mariadb-java-client + 1.1.7 + + diff --git a/SdncReports/pom.xml b/SdncReports/pom.xml index 56a73916..ce15a0f1 100644 --- a/SdncReports/pom.xml +++ b/SdncReports/pom.xml @@ -1,77 +1,76 @@ - 4.0.0 + 4.0.0 + + org.onap.ccsdk.parent + spring-boot-1-starter-parent + 2.6.1 + + - org.onap.sdnc.oam - SdncReports - 2.0.0-SNAPSHOT - pom + org.onap.sdnc.oam + SdncReports + 2.2.0-SNAPSHOT + pom - sdnc-oam :: SdncReports + sdnc-oam :: SdncReports - - org.onap.ccsdk.parent - spring-boot-1-starter-parent - 2.0.0-SNAPSHOT - - - - ecomp-releases - http://nexus.onap.org/content/repositories/releases - - - ecomp-snapshots - http://nexus.onap.org/content/repositories/snapshots - - + + SdncReportsDao + SdncReportsApi + - - SdncReportsDao - SdncReportsApi - - - - - - - org.jacoco - jacoco-maven-plugin - 0.7.5.201505241946 - - - - pre-unit-test - - prepare-agent - - - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - - surefireArgLine - - - - - post-unit-test - test - - report - - - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - - ${project.reporting.outputDirectory}/jacoco-ut - - - - - - + + + ecomp-releases + http://nexus.onap.org/content/repositories/releases + + + ecomp-snapshots + http://nexus.onap.org/content/repositories/snapshots + + + + + + org.jacoco + jacoco-maven-plugin + 0.7.5.201505241946 + + + + pre-unit-test + + prepare-agent + + + + ${project.build.directory}/coverage-reports/jacoco-ut.exec + + surefireArgLine + + + + + post-unit-test + test + + report + + + + ${project.build.directory}/coverage-reports/jacoco-ut.exec + + ${project.reporting.outputDirectory}/jacoco-ut + + + + + + diff --git a/admportal/pom.xml b/admportal/pom.xml index 35892390..3218e49b 100644 --- a/admportal/pom.xml +++ b/admportal/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 2.0.0-SNAPSHOT + 2.6.1 org.onap.sdnc.oam admportal - 2.0.0-SNAPSHOT + 2.2.0-SNAPSHOT pom sdnc-oam :: admportal @@ -28,21 +28,12 @@ ${maven.build.timestamp} ${project.version}-${build.number} - - - - org.onap.ccsdk.sli.core - sli-core-artifacts - ${ccsdk.sli.core.version} - pom - import - - - + org.onap.ccsdk.sli.core sli-common + ${ccsdk.sli.version} org.mariadb.jdbc diff --git a/configbackuprestore/getBackupVnfDetailService/pom.xml b/configbackuprestore/getBackupVnfDetailService/pom.xml index b1e35c0e..7220a168 100644 --- a/configbackuprestore/getBackupVnfDetailService/pom.xml +++ b/configbackuprestore/getBackupVnfDetailService/pom.xml @@ -1,146 +1,152 @@ - 4.0.0 - - org.onap.sdnc.oam.vnfbackup - configbackuprestore - 2.0.0-SNAPSHOT - - org.onap.sdnc.oam.vnfbackup - getBackupVnfDetailService - 2.0.0-SNAPSHOT - sdnc-oam :: vnfbackup :: getBackupVnfDetailService - http://maven.apache.org - - UTF-8 - - - - junit - junit - 4.4 - test - - - org.mariadb.jdbc - mariadb-java-client - 1.1.9 - - - - commons-codec - commons-codec - 1.9 - - - - org.springframework.boot - spring-boot-starter-web - 1.5.4.RELEASE - - - - org.springframework - spring-context - 4.3.9.RELEASE - - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - - - org.springframework.boot - spring-boot-devtools - true - - - - org.springframework.boot - spring-boot-starter-test - test - 1.5.3.RELEASE - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - - - org.springframework.boot - spring-boot-starter-log4j2 - - - - org.javers - javers-core - 3.9.3 - - - - org.json - json - 20180130 - - - - - com.flipkart.zjsonpatch - zjsonpatch - 0.4.6 - - - - - - - org.jacoco - jacoco-maven-plugin - 0.7.5.201505241946 - - - - pre-unit-test - - prepare-agent - - - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - - surefireArgLine - - - - - post-unit-test - test - - report - - - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - - ${project.reporting.outputDirectory}/jacoco-ut - - - - - - + 4.0.0 + + + org.onap.sdnc.oam.vnfbackup + configbackuprestore + 2.2.0-SNAPSHOT + + + org.onap.sdnc.oam.vnfbackup + getBackupVnfDetailService + 2.2.0-SNAPSHOT + + sdnc-oam :: vnfbackup :: getBackupVnfDetailService + http://maven.apache.org + + + UTF-8 + + + + + junit + junit + 4.4 + test + + + org.mariadb.jdbc + mariadb-java-client + 1.1.9 + + + + commons-codec + commons-codec + 1.9 + + + + org.springframework.boot + spring-boot-starter-web + 1.5.4.RELEASE + + + + org.springframework + spring-context + 4.3.9.RELEASE + + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + + + + + org.springframework.boot + spring-boot-devtools + true + + + + org.springframework.boot + spring-boot-starter-test + 1.5.3.RELEASE + test + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + + org.springframework.boot + spring-boot-starter-log4j2 + + + + org.javers + javers-core + 3.9.3 + + + + org.json + json + 20180130 + + + + + com.flipkart.zjsonpatch + zjsonpatch + 0.4.6 + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.7.5.201505241946 + + + + pre-unit-test + + prepare-agent + + + + ${project.build.directory}/coverage-reports/jacoco-ut.exec + + surefireArgLine + + + + + post-unit-test + test + + report + + + + ${project.build.directory}/coverage-reports/jacoco-ut.exec + + ${project.reporting.outputDirectory}/jacoco-ut + + + + + + diff --git a/configbackuprestore/pom.xml b/configbackuprestore/pom.xml index 07916c0d..43157f2c 100644 --- a/configbackuprestore/pom.xml +++ b/configbackuprestore/pom.xml @@ -1,94 +1,93 @@ - + + 4.0.0 - 4.0.0 + + org.onap.ccsdk.parent + spring-boot-1-starter-parent + 2.6.1 + - org.onap.sdnc.oam.vnfbackup - configbackuprestore - 2.0.0-SNAPSHOT - sdnc-oam :: vnfbackup - pom + org.onap.sdnc.oam.vnfbackup + configbackuprestore + 2.2.0-SNAPSHOT + pom - - org.onap.ccsdk.parent - spring-boot-1-starter-parent - 2.0.0-SNAPSHOT - + sdnc-oam :: vnfbackup - - UTF-8 + + getBackupVnfDetailService + vnfconfigreportsservice + vnfconfigbackupservice + - - nexus.onap.org - 443 - https - https://nexus.onap.org/content/groups/public - https://nexus.onap.org/content/groups/staging - https://nexus.onap.org/content/repositories/releases - https://nexus.onap.org/content/repositories/snapshots - ecomp-staging - 176c31dfe190a - + + + ecomp-releases + http://nexus.onap.org/content/repositories/releases + + + ecomp-snapshots + http://nexus.onap.org/content/repositories/snapshots + + - - - junit - junit - 3.8.1 - test - - + + UTF-8 - - - ecomp-releases - http://nexus.onap.org/content/repositories/releases - - - ecomp-snapshots - http://nexus.onap.org/content/repositories/snapshots - - + + nexus.onap.org + 443 + https + https://nexus.onap.org/content/groups/public + https://nexus.onap.org/content/groups/staging + https://nexus.onap.org/content/repositories/releases + https://nexus.onap.org/content/repositories/snapshots + ecomp-staging + 176c31dfe190a + - - getBackupVnfDetailService - vnfconfigreportsservice - vnfconfigbackupservice - + + + junit + junit + 3.8.1 + test + + - - - - org.jacoco - jacoco-maven-plugin - 0.7.5.201505241946 - + + + + org.jacoco + jacoco-maven-plugin + 0.7.5.201505241946 + - - pre-unit-test - - prepare-agent - - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - surefireArgLine - - - - - post-unit-test - test - - report - - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - ${project.reporting.outputDirectory}/jacoco-ut - - - - - - + + pre-unit-test + + prepare-agent + + + ${project.build.directory}/coverage-reports/jacoco-ut.exec + surefireArgLine + + + + post-unit-test + test + + report + + + ${project.build.directory}/coverage-reports/jacoco-ut.exec + ${project.reporting.outputDirectory}/jacoco-ut + + + + + + diff --git a/configbackuprestore/vnfconfigbackupservice/pom.xml b/configbackuprestore/vnfconfigbackupservice/pom.xml index 70a9a80a..e4f4ac8c 100644 --- a/configbackuprestore/vnfconfigbackupservice/pom.xml +++ b/configbackuprestore/vnfconfigbackupservice/pom.xml @@ -1,171 +1,171 @@ - - 4.0.0 - - - org.onap.sdnc.oam.vnfbackup - configbackuprestore - 2.0.0-SNAPSHOT - - - org.onap.sdnc.oam.vnfbackup - vnfconfigbackupservice - 2.0.0-SNAPSHOT - sdnc-oam :: vnfbackup :: vnfconfigbackupservice - http://maven.apache.org - - - - - org.onap.sdnc.oam.vnfbackup - getBackupVnfDetailService - 2.0.0-SNAPSHOT - - - - org.onap.sdnc.oam.vnfbackup - vnfconfigreportsservice - 2.0.0-SNAPSHOT - - - - org.jmockit - jmockit - 1.19 - test - - - - org.jmockit - jmockit-coverage - 1.19 - test - - - - junit - junit - 4.9 - test - - - - javax.servlet - jstl - provided - - - - org.mariadb.jdbc - mariadb-java-client - 1.1.9 - - - - - commons-codec - commons-codec - 1.9 - - - - org.springframework.boot - spring-boot-starter-web - 1.5.4.RELEASE - - - - org.springframework - spring-context - 4.3.9.RELEASE - - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - - org.springframework.boot - spring-boot-devtools - true - - - - org.springframework.boot - spring-boot-starter-test - test - 1.5.3.RELEASE - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - - - org.springframework.boot - spring-boot-starter-log4j2 - - - - org.json - json - 20180130 - - - - - com.fasterxml - jackson-xml-databind - 0.6.2 - - - - org.webjars - bootstrap - 3.3.7 - - - - org.webjars - bootstrap-datepicker - 1.0.1 - - - - org.webjars.bower - angular-object-diff - 1.0.1 - - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.21.0 - - -XX:+StartAttachListener - - - - + 4.0.0 + + + org.onap.sdnc.oam.vnfbackup + configbackuprestore + 2.2.0-SNAPSHOT + + + org.onap.sdnc.oam.vnfbackup + vnfconfigbackupservice + 2.2.0-SNAPSHOT + + sdnc-oam :: vnfbackup :: vnfconfigbackupservice + http://maven.apache.org + + + + + org.onap.sdnc.oam.vnfbackup + getBackupVnfDetailService + 2.2.0-SNAPSHOT + + + + org.onap.sdnc.oam.vnfbackup + vnfconfigreportsservice + 2.2.0-SNAPSHOT + + + + org.jmockit + jmockit + 1.19 + test + + + + org.jmockit + jmockit-coverage + 1.19 + test + + + + junit + junit + 4.9 + test + + + + javax.servlet + jstl + provided + + + + org.mariadb.jdbc + mariadb-java-client + 1.1.9 + + + + + commons-codec + commons-codec + 1.9 + + + + org.springframework.boot + spring-boot-starter-web + 1.5.4.RELEASE + + + + org.springframework + spring-context + 4.3.9.RELEASE + + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + + + + org.springframework.boot + spring-boot-devtools + true + + + + org.springframework.boot + spring-boot-starter-test + 1.5.3.RELEASE + test + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + + org.springframework.boot + spring-boot-starter-log4j2 + + + + org.json + json + 20180130 + + + + + com.fasterxml + jackson-xml-databind + 0.6.2 + + + + org.webjars + bootstrap + 3.3.7 + + + + org.webjars + bootstrap-datepicker + 1.0.1 + + + + org.webjars.bower + angular-object-diff + 1.0.1 + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.21.0 + + -XX:+StartAttachListener + + + + diff --git a/configbackuprestore/vnfconfigbackupservice/src/main/webapp/WEB-INF/views/index.jsp b/configbackuprestore/vnfconfigbackupservice/src/main/webapp/WEB-INF/views/index.jsp index 95b64141..c9a00b08 100644 --- a/configbackuprestore/vnfconfigbackupservice/src/main/webapp/WEB-INF/views/index.jsp +++ b/configbackuprestore/vnfconfigbackupservice/src/main/webapp/WEB-INF/views/index.jsp @@ -34,7 +34,7 @@ - + @@ -61,7 +61,7 @@
-
+
@@ -70,4 +70,4 @@
- \ No newline at end of file + diff --git a/configbackuprestore/vnfconfigreportsservice/pom.xml b/configbackuprestore/vnfconfigreportsservice/pom.xml index 4cd0356a..a1865f6f 100644 --- a/configbackuprestore/vnfconfigreportsservice/pom.xml +++ b/configbackuprestore/vnfconfigreportsservice/pom.xml @@ -1,110 +1,115 @@ - 4.0.0 - - org.onap.sdnc.oam.vnfbackup - configbackuprestore - 2.0.0-SNAPSHOT - - org.onap.sdnc.oam.vnfbackup - vnfconfigreportsservice - 2.0.0-SNAPSHOT - sdnc-oam :: vnfbackup :: vnfconfigreportservice - http://maven.apache.org - - UTF-8 - - - - junit - junit - 4.11 - test - - - - javax.servlet - jstl - provided - - - - org.mariadb.jdbc - mariadb-java-client - 1.1.9 - - - - commons-codec - commons-codec - 1.9 - - - - org.springframework.boot - spring-boot-starter-web - 1.5.4.RELEASE - - - - org.springframework - spring-context - 4.3.9.RELEASE - - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - - - org.springframework.boot - spring-boot-devtools - true - - - - org.springframework.boot - spring-boot-starter-test - test - 1.5.3.RELEASE - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - - - org.springframework.boot - spring-boot-starter-log4j2 - - - - org.json - json - 20180130 - - - - com.fasterxml - jackson-xml-databind - 0.6.2 - - - org.mockito - mockito-all - 1.9.5 - test - - + 4.0.0 + + + org.onap.sdnc.oam.vnfbackup + configbackuprestore + 2.2.0-SNAPSHOT + + + org.onap.sdnc.oam.vnfbackup + vnfconfigreportsservice + 2.2.0-SNAPSHOT + + sdnc-oam :: vnfbackup :: vnfconfigreportservice + http://maven.apache.org + + + UTF-8 + + + + + junit + junit + 4.11 + test + + + + javax.servlet + jstl + provided + + + + org.mariadb.jdbc + mariadb-java-client + 1.1.9 + + + + commons-codec + commons-codec + 1.9 + + + + org.springframework.boot + spring-boot-starter-web + 1.5.4.RELEASE + + + + org.springframework + spring-context + 4.3.9.RELEASE + + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + + + + + org.springframework.boot + spring-boot-devtools + true + + + + org.springframework.boot + spring-boot-starter-test + 1.5.3.RELEASE + test + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + + org.springframework.boot + spring-boot-starter-log4j2 + + + + org.json + json + 20180130 + + + + com.fasterxml + jackson-xml-databind + 0.6.2 + + + org.mockito + mockito-all + 1.9.5 + test + + diff --git a/csit/.gitignore b/csit/.gitignore new file mode 100644 index 00000000..fbc74b3d --- /dev/null +++ b/csit/.gitignore @@ -0,0 +1,3 @@ +env.properties +config/mount.xml +archives/ diff --git a/csit/config/mount.xml.tmpl b/csit/config/mount.xml.tmpl new file mode 100644 index 00000000..04305252 --- /dev/null +++ b/csit/config/mount.xml.tmpl @@ -0,0 +1,14 @@ + + PNFDemo + + ODL_private_key_0 + netconf + + pnfaddr + 6513 + false + + TLS + + 5 + diff --git a/csit/plans/sdnc/generate_certs.sh b/csit/plans/sdnc/generate_certs.sh new file mode 100755 index 00000000..d5b80179 --- /dev/null +++ b/csit/plans/sdnc/generate_certs.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (c) 2022 highstreet technologies GmbH 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. +# +# generates fresh certificates for netconfserver + + +tls_dir=$1 + +cd $tls_dir +echo "generate all required certificates and store in $tls_dir" +openssl version +openssl req -newkey rsa:4096 -keyform PEM -keyout ca.key -x509 -days 3650 -outform PEM -out ca.crt -nodes \ + -subj "/C=DE/ST=Berlin/L=Berlin/O=ONAP/OU=SDNC/CN=www.onap.org/emailAddress=dev@www.example.com" +openssl genrsa -out client.key 4096 +openssl req -new -key client.key -out client.req -nodes \ + -subj "/C=PL/ST=DS/L=Wroclaw/O=ONAP/OU=SDNC/CN=www.onap.org" +openssl x509 -req -in client.req -CA ca.crt -CAkey ca.key -set_serial 101 -extensions client -days 365 -outform PEM -out client.crt +openssl genrsa -out server_key.pem 4096 +openssl req -new -key server_key.pem -out server.req -sha256 -nodes \ + -subj "/C=PL/ST=DS/L=Wroclaw/O=ONAP/OU=SDNC/CN=www.onap.org" +openssl x509 -req -in server.req -CA ca.crt -CAkey ca.key -set_serial 100 -extensions server -days 1460 -outform PEM -out server_cert.crt -sha256 + diff --git a/csit/plans/sdnc/setup.sh b/csit/plans/sdnc/setup.sh new file mode 100644 index 00000000..7c953a3c --- /dev/null +++ b/csit/plans/sdnc/setup.sh @@ -0,0 +1,175 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# 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. +# +# Modifications copyright (c) 2020-2021 Samsung Electronics Co., Ltd. +# Modifications copyright (c) 2021 AT&T Intellectual Property +# + +# Remove all dangling images and cleanup /w/workspace and /tmp +docker image prune -f +echo "Remove onap repository artifacts" +rm -r /tmp/r/org/onap +echo "Remove all target folders from workspace" +rm -r $(find /w/workspace -name target) + +###################### Netconf Simulator Setup ###################### + +echo "Clean" +sudo apt clean + +# Get integration/simulators +if [ -d ${WORKSPACE}/archives/pnf-simulator ] +then + rm -rf ${WORKSPACE}/archives/pnf-simulator +fi +mkdir ${WORKSPACE}/archives/pnf-simulator +git clone "https://gerrit.onap.org/r/integration/simulators/pnf-simulator" ${WORKSPACE}/archives/pnf-simulator + +# Fix docker-compose to add nexus repo for onap dockers +PNF_SIM_REGISTRY=nexus3.onap.org:10001 +PNF_SIM_VERSION=1.0.5 +mv ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml.orig +cat ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml.orig | sed -re "s/image: onap\/org.onap.integration.simulators.(.*$)/image: $PNF_SIM_REGISTRY\/onap\/org.onap.integration.simulators.\1:$PNF_SIM_VERSION/" > ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml + +# Remove carriage returns (if any) from netopeer start script +mv ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh.orig +cat ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh.orig | sed -e "s/\r$//g" > ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh +chmod 755 ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh + +# generate fresh certificates for netconfserver [INT-2269] + +./generate_certs.sh "${WORKSPACE}"/archives/pnf-simulator/netconfsimulator/tls + +# Start Netconf Simulator Container with docker-compose and configuration from docker-compose.yml +docker-compose -f "${WORKSPACE}"/archives/pnf-simulator/netconfsimulator/docker-compose.yml up -d + +# Add test user in netopeer container +sleep 60 +docker exec netconfsimulator_netopeer_1 useradd --system test + +############################## SDNC Setup ############################## + +# Copy client certs from netconf simulator to SDNC certs directory +mkdir /tmp/keys0 +cp ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/tls/client.crt /tmp/keys0 +cp ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/tls/client.key /tmp/keys0 +cp ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/tls/ca.crt /tmp/keys0/trustedCertificates.crt +cwd=$(pwd) +cd /tmp +if [ ! -d ${SDNC_CERT_PATH} ] +then + mkdir -p ${SDNC_CERT_PATH} +fi +chmod -f go+w $SDNC_CERT_PATH +cat > $SDNC_CERT_PATH/certs.properties <<-END +keys0.zip +***** +END +zip -r $SDNC_CERT_PATH/keys0.zip keys0 +rm -rf /tmp/keys0 + + +# Export default Networking bridge created on the host machine +export LOCAL_IP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+') + +unset http_proxy https_proxy + +# Append test data to standard data init file to create db init script +cat ${WORKSPACE}/../installation/sdnc/src/main/resources/sdnctl.dump ${WORKSPACE}/scripts/csit-data.sql > ${WORKSPACE}/archives/csit-dbinit.sql + +# start SDNC containers with docker compose and configuration from docker-compose.yml +docker-compose -f ${SCRIPTS}/docker-compose.yml up -d + + +# WAIT 5 minutes maximum and check karaf.log for readiness every 10 seconds + +TIME_OUT=300 +INTERVAL=10 +TIME=0 +while [ "$TIME" -lt "$TIME_OUT" ]; do + +docker exec ${SDNC_CONTAINER_NAME} cat /opt/opendaylight/data/log/karaf.log | grep 'warp coils' + + if [ $? == 0 ] ; then + echo SDNC karaf started in $TIME seconds + break; + fi + + echo Sleep $INTERVAL seconds before testing if SDNC is up. Total wait time up until now is $TIME seconds. Timeout is $TIME_OUT seconds + sleep $INTERVAL + TIME=$(($TIME+$INTERVAL)) +done + +if [ "$TIME" -ge "$TIME_OUT" ]; then + echo TIME OUT: karaf session not started in $TIME_OUT seconds, setup failed + exit 1; +fi + +num_bundles=$(docker exec -i ${SDNC_CONTAINER_NAME} sh -c "echo '' | /opt/opendaylight/current/bin/client bundle:list" | tail -1 | cut -d' ' -f1) + + if [ "$num_bundles" -ge 333 ]; then + num_failed_bundles=$(docker exec -i ${SDNC_CONTAINER_NAME} sh -c "echo '' | /opt/opendaylight/current/bin/client bundle:list" | grep -w Failure | wc -l) + failed_bundles=$(docker exec -i ${SDNC_CONTAINER_NAME} sh -c "echo '' | /opt/opendaylight/current/bin/client bundle:list" | grep -w Failure) + echo There is/are $num_failed_bundles failed bundles out of $num_bundles installed bundles. + fi + +if [ "$num_failed_bundles" -ge 1 ]; then + echo "The following bundle(s) are in a failed state: " + echo " $failed_bundles" +fi + +# Check if certificate installation is done +TIME_OUT=300 +INTERVAL=10 +TIME=0 +while [ "$TIME" -lt "$TIME_OUT" ]; do + + docker-compose -f "${SCRIPTS}"/docker-compose.yml logs sdnc | grep 'Everything OK in Certificate Installation' + + if [ $? == 0 ] ; then + echo SDNC karaf started in $TIME seconds + break; + fi + + echo Sleep: $INTERVAL seconds before testing if SDNC is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds + sleep $INTERVAL + TIME=$(($TIME+$INTERVAL)) +done + +if [ "$TIME" -ge "$TIME_OUT" ]; then + echo TIME OUT: karaf session not started in $TIME_OUT seconds, setup failed + exit 1; +fi + +# Update default Networking bridge IP in mount.json file +cp ${REQUEST_DATA_PATH}/mount.xml.tmpl ${REQUEST_DATA_PATH}/mount.xml +sed -i "s/pnfaddr/${LOCAL_IP}/g" "${REQUEST_DATA_PATH}"/mount.xml + + +######################################################################### + +# Export SDNC, AAF-Certservice-Cient, Netconf-Pnp-Simulator Continer Names +export REQUEST_DATA_PATH="${REQUEST_DATA_PATH}" +export SDNC_CONTAINER_NAME="${SDNC_CONTAINER_NAME}" +export CLIENT_CONTAINER_NAME="${CLIENT_CONTAINER_NAME}" +export NETCONF_PNP_SIM_CONTAINER_NAME="${NETCONF_PNP_SIM_CONTAINER_NAME}" + +REPO_IP='127.0.0.1' +ROBOT_VARIABLES+=" -v REPO_IP:${REPO_IP} " +ROBOT_VARIABLES+=" -v SCRIPTS:${SCRIPTS} " + +echo "Finished executing setup for SDNC" + diff --git a/csit/plans/sdnc/teardown.sh b/csit/plans/sdnc/teardown.sh new file mode 100644 index 00000000..e6b7faba --- /dev/null +++ b/csit/plans/sdnc/teardown.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# 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. +# +# Modifications copyright (c) 2017 AT&T Intellectual Property +# Modifications copyright (c) 2020 Samsung Electronics Co., Ltd. +# +docker-compose -f "${SCRIPTS}"/docker-compose.yml down -v +docker-compose -f "${WORKSPACE}"/archives/pnf-simulator/netconfsimulator/docker-compose.yml down -v diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml new file mode 100644 index 00000000..0a03984c --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml new file mode 100644 index 00000000..f9b5960c --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml @@ -0,0 +1,285 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign.xml new file mode 100644 index 00000000..d4cdd898 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml new file mode 100644 index 00000000..1b8a7d20 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_service-topology-operation-assign.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_service-topology-operation-assign.xml new file mode 100644 index 00000000..300c1a92 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_service-topology-operation-assign.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml new file mode 100644 index 00000000..e5f823a9 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml new file mode 100644 index 00000000..fa6271a4 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml @@ -0,0 +1,705 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml new file mode 100644 index 00000000..4f31a9fe --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml new file mode 100644 index 00000000..78f1abe2 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml new file mode 100644 index 00000000..2ad5a468 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml @@ -0,0 +1,899 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/csit/plans/sdnc/testdata/VNF-API_generate-subnets-subnet-id.xml b/csit/plans/sdnc/testdata/VNF-API_generate-subnets-subnet-id.xml new file mode 100644 index 00000000..2486391c --- /dev/null +++ b/csit/plans/sdnc/testdata/VNF-API_generate-subnets-subnet-id.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/csit/plans/sdnc/testplan.txt b/csit/plans/sdnc/testplan.txt new file mode 100644 index 00000000..9810e58a --- /dev/null +++ b/csit/plans/sdnc/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under csit/tests/. +# Place the suites in run order. +sdnc \ No newline at end of file diff --git a/csit/plans/sdnr/setup.sh b/csit/plans/sdnr/setup.sh new file mode 100755 index 00000000..94e367be --- /dev/null +++ b/csit/plans/sdnr/setup.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# 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. +# +# Modifications copyright (c) 2017 AT&T Intellectual Property +# Modifications copyright (c) 2022 highstreet technologies GmbH Property +# + +# Remove all not needed images and clean workspace +sudo apt clean +docker rmi -f $(docker images onap/sdnc-dmaap-listener-image -a -q) +docker rmi -f $(docker images onap/sdnc-ueb-listener-image -a -q) +docker rmi -f $(docker images onap/onap/sdnc-web-image -a -q) +docker rmi -f $(docker images onap/sdnc-ansible-server-image -a -q) +docker rmi -f $(docker images onap/sdnc-aaf-image -a -q) +docker rmi -f $(docker images onap/ccsdk-ansible-server-image -a -q) +docker rmi -f $(docker images onap/ccsdk-odlsli-alpine-image -a -q) +docker images + +echo "Start plan sdnr" + +source ${WORKSPACE}/scripts/sdnr/sdnr-launch.sh +onap_dependent_components_launch +nts_networkfunctions_launch ${WORKSPACE}/plans/sdnr/testdata/nts-networkfunctions.csv +sdnr_web_launch + +## environment for SDNC/R specific robot test runs +## Ready state will be checked every SDNC_READY_RETRY_PERIOD seconds +# SDNC_READY_RETRY_PERIOD=15 +## SDNC ready state will be checked max SDNC_READY_TIMEOUT seconds +# SDNC_READY_TIMEOUT=450 + +## if jenkins should be ok without running robots TCS's +#SDNC_RELEASE_WITHOUT_ROBOT=true + +#Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_DEBUG_LEVEL=DEBUG # INFO or DEBUG + +ROBOT_VARIABLES="--variablefile=${WORKSPACE}/plans/sdnr/testdata/localhost.py -L ${ROBOT_DEBUG_LEVEL}" +ROBOT_IMAGE="hightec/sdnc-test-lib:v0.12.0" + diff --git a/csit/plans/sdnr/teardown.sh b/csit/plans/sdnr/teardown.sh new file mode 100755 index 00000000..005f6f31 --- /dev/null +++ b/csit/plans/sdnr/teardown.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# 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. +# +# Modifications copyright (c) 2017 AT&T Intellectual Property +# Modifications copyright (c) 2021 highstreet technologies GmbH Property +# + +source ${WORKSPACE}/scripts/sdnr/sdnr-teardown.sh +sdnr_teardown diff --git a/csit/plans/sdnr/testdata/localhost.py b/csit/plans/sdnr/testdata/localhost.py new file mode 100644 index 00000000..373d90c9 --- /dev/null +++ b/csit/plans/sdnr/testdata/localhost.py @@ -0,0 +1,68 @@ +#!python + +# This file describes test all paramters for a specific test environment and system under test. +# SDNR Custom keywords and test suites use this file to be independent +# This file es created once for a test system +# in robot commandline pass the file with '--variablefile .py' + +## Access SDNR cluster +SDNR_PROTOCOL = "http://" +SDNR_HOST = "127.0.0.1" +SDNR_PORT = "8282" +SDNR_USER = "admin" +SDNR_PASSWORD = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" +#SDNR_PASSWORD = "admin" +WEBSOCKET_PORT = "8182" + +RELEASE_VERSION="argon" # expected opendaylight version + +# for odlux gui testing +WEBDRIVER_PATH = "/usr/local/bin/chromedriver" + +# sdnrdb is based on mariaDB + +USE_MARIA_DB=True +MARIADB = {'IP': SDNR_HOST, 'PORT': 3306} + +RESTCONF_TIMEOUT = '90 s' +# Restconf response time longer than VALID_RESPONSE_TIME in s will be notified as warning in the robot logs +VALID_RESPONSE_TIME = 5 + +# Define network function parameter +NETWORK_FUNCTIONS = { + 'O_RAN_FH': {"NAME": "o-ran-fh", "IP": "172.40.0.40", "PORT": "830", "USER": "netconf", + "PASSWORD": "netconf!", 'NETCONF_HOST': '172.40.0.1', 'BASE_PORT': 40000, 'TLS_PORT': 40500}, + 'X_RAN': {"NAME": "x-ran", "IP": "172.40.0.42", "PORT": "830", "USER": "netconf", + "PASSWORD": "netconf!", 'NETCONF_HOST': '172.40.0.1', 'BASE_PORT': 42000, 'TLS_PORT': 42500}, + 'ONF_CORE_1_2': {"NAME": "onf-core-1-2", "IP": "172.40.0.30", "PORT": "830", + "USER": "netconf", "PASSWORD": "netconf!", 'NETCONF_HOST': '172.40.0.1', 'BASE_PORT': 30000, + 'TLS_PORT': 30500}, + 'ONF_CORE_1_4': {"NAME": "onf-core-1-4", "IP": "172.40.0.31", "PORT": "830", + "USER": "netconf", "PASSWORD": "netconf!", 'NETCONF_HOST': '172.40.0.1', 'BASE_PORT': 31000, + 'TLS_PORT': 31500}, + 'OPENROADM_6_1_0': {"NAME": "openroadm-6-1-0", "IP": "172.40.0.36", "PORT": "830", "USER": "netconf", + "PASSWORD": "netconf!", 'NETCONF_HOST': '172.40.0.1', 'BASE_PORT': 36000, 'TLS_PORT': 36500} +} + +VESCOLLECTOR = {"SCHEME": "https", "IP": "172.40.0.1", "PORT": 8443, "AUTHMETHOD": "basic-auth", "USERNAME": "sample1", + "PASSWORD": "sample1"} + +NTS_SSH_CONNECTIONS = 10 +NTS_TLS_CONNECTIONS = 10 +# ssh settings for karaf-shell +# list of default log topics, short name (defined in ...) or long name +KARAF_CONSOLE = {'KARAF_USER': "karaf", 'KARAF_PASSWORD': "karaf", 'KARAF_LOG_LEVEL': "DEFAULT", + 'KARAF_LOGGER_LIST': ['netconf', 'wtfeatures'], + 'HOST_LIST': [{'KARAF_HOST': "127.0.0.1", 'KARAF_PORT': 8101} + ]} +# define log level used by default +KARAF_LOG_LEVEL = "DEFAULT" +# save karaf logs after test execution +KARAF_GET_LOG = True +KARAF_LOG_FILE_PATH = '/opt/opendaylight/data/log/' +# KARAF_LOG_FILE_PATH = '/var/log/onap/sdnc/karaf.log' +# write useful statistics in background +WRITE_STATISTICS_BACKGROUND = False +WRITE_STATISTICS_BACKGROUND_INTERVAL = 5 + +GLOBAL_SUITE_SETUP_CONFIG = {'setup_ssh_lib': True} diff --git a/csit/plans/sdnr/testdata/nts-networkfunctions.csv b/csit/plans/sdnr/testdata/nts-networkfunctions.csv new file mode 100644 index 00000000..0b0970d0 --- /dev/null +++ b/csit/plans/sdnr/testdata/nts-networkfunctions.csv @@ -0,0 +1,6 @@ +NAME,NTS_NF_DOCKER_REPOSITORY,NTS_NF_IMAGE_NAME,NTS_NF_IMAGE_TAG,NTSFUNC-IP,NTSFUNC-IPv6,NTS_HOST_NETCONF_SSH_BASE_PORT,NTS_HOST_NETCONF_TLS_BASE_PORT,NTS_NF_SSH_CONNECTIONS,NTS_NF_TLS_CONNECTIONS,PORT,NETCONF_HOST,USER,PASSWORD,NTS_FUNCTION_TYPE +ONF-CORE-1-2,docker.io/hightec/,nts-ng-onf-core-1-2,1.3.4,172.40.0.30,2001:db8:1:50:172:50:0:30,30000,30500,1,1,830,172.40.0.1,netconf,netconf!,nts-onf-pac:NTS_FUNCTION_TYPE_ONF_CORE_MODEL_1_2 +ONF-CORE-1-4,docker.io/hightec/,nts-ng-onf-core-1-4,1.3.4,172.40.0.31,2001:db8:1:50:172:50:0:31,31000,31500,1,1,830,172.40.0.1,netconf,netconf!,nts-onf-pac:NTS_FUNCTION_TYPE_ONF_CORE_MODEL_1_4 +OPENROADM-6-1-0,docker.io/hightec/,nts-ng-openroadm-6.1.0,1.3.4,172.40.0.36,2001:db8:1:50:172:50:0:36,36000,36500,1,1,830,172.40.0.1,netconf,netconf!,nts-openroadm-pac:NTS_FUNCTION_TYPE_OPENROADM_6_1_0 +O-RAN-FH,docker.io/hightec/,nts-ng-o-ran-fh,1.3.4,172.40.0.40,2001:db8:1:50:172:50:0:40,40000,40500,1,1,830,172.40.0.1,netconf,netconf!,nts-o-ran-fh-pac:NTS_FUNCTION_TYPE_O_RAN_FH +X-RAN,docker.io/hightec/,nts-ng-x-ran,1.3.4,172.40.0.42,2001:db8:1:50:172:50:0:42,42000,42500,1,1,830,172.40.0.1,netconf,netconf!,nts-x-ran-pac:NTS_FUNCTION_TYPE_X_RAN diff --git a/csit/plans/sdnr/testplan.txt b/csit/plans/sdnr/testplan.txt new file mode 100644 index 00000000..4c07c7fb --- /dev/null +++ b/csit/plans/sdnr/testplan.txt @@ -0,0 +1,9 @@ +# Test suites are relative paths under [integration/csit.git]/tests/. +# Place the suites in run order. + + +## To skip sdnr robot test suite +## set in .setup.sh SDNC_RELEASE_WITHOUT_ROBOT=true +sdnr/healthcheck +sdnr/functional +sdnr/odlux diff --git a/csit/prepare-csit.sh b/csit/prepare-csit.sh new file mode 100755 index 00000000..550a0233 --- /dev/null +++ b/csit/prepare-csit.sh @@ -0,0 +1,49 @@ +#!/bin/bash -x +# +# Copyright 2019-2021 © Samsung Electronics Co., Ltd. +# +# 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. +# +# This script installs common libraries required by CSIT tests +# + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel`/csit +fi + +TESTPLANDIR=${WORKSPACE}/${TESTPLAN} + +# Assume that if ROBOT_VENV is set and virtualenv with system site packages can be activated, +# ci-management/jjb/integration/include-raw-integration-install-robotframework.sh has already +# been executed + +if [ -f ${WORKSPACE}/env.properties ]; then + source ${WORKSPACE}/env.properties +fi +if [ -f ${ROBOT_VENV}/bin/activate ]; then + source ${ROBOT_VENV}/bin/activate +else + rm -rf /tmp/ci-management + rm -f ${WORKSPACE}/env.properties + cd /tmp + git clone "https://gerrit.onap.org/r/ci-management" + source /tmp/ci-management/jjb/integration/include-raw-integration-install-robotframework.sh +fi + +# install eteutils +mkdir -p ${ROBOT_VENV}/src/onap +rm -rf ${ROBOT_VENV}/src/onap/testsuite +#pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.5.1.*' --pre + +pip freeze + diff --git a/csit/run-csit.sh b/csit/run-csit.sh new file mode 100755 index 00000000..7021f0f9 --- /dev/null +++ b/csit/run-csit.sh @@ -0,0 +1,233 @@ +#!/bin/bash -x +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# Modification Copyright 2019-2021 © Samsung Electronics Co., Ltd. +# Modification Copyright 2021 © highstreet-technologies GmbH +# +# 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. +# +# $1 project/functionality +# $2 robot options + + +# +# functions +# + +function on_exit(){ + rc=$? + if [[ ${WORKSPACE} ]]; then + if [[ ${WORKDIR} ]]; then + rsync -av "$WORKDIR/" "$WORKSPACE/archives/$TESTPLAN" + fi + # Record list of active docker containers + docker ps --format "{{.Image}}" > "$WORKSPACE/archives/$TESTPLAN/_docker-images.log" + + # show memory consumption after all docker instances initialized + docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-2-after-robot.txt" + fi + # Run teardown script plan if it exists + cd "${TESTPLANDIR}" + TEARDOWN="${TESTPLANDIR}/teardown.sh" + if [ -f "${TEARDOWN}" ]; then + echo "Running teardown script ${TEARDOWN}" + source_safely "${TEARDOWN}" + fi + # TODO: do something with the output + exit $rc +} +# ensure that teardown and other finalizing steps are always executed +trap on_exit EXIT + +function docker_stats(){ + #General memory details + echo "> top -bn1 | head -3" + top -bn1 | head -3 + echo + + echo "> free -h" + free -h + echo + + #Memory details per Docker + echo "> docker ps" + docker ps + echo + + echo "> docker stats --no-stream" + docker stats --no-stream + echo +} + +# save current set options +function save_set() { + RUN_CSIT_SAVE_SET="$-" + RUN_CSIT_SHELLOPTS="$SHELLOPTS" +} + +# load the saved set options +function load_set() { + _setopts="$-" + + # bash shellopts + for i in $(echo "$SHELLOPTS" | tr ':' ' ') ; do + set +o ${i} + done + for i in $(echo "$RUN_CSIT_SHELLOPTS" | tr ':' ' ') ; do + set -o ${i} + done + + # other options + for i in $(echo "$_setopts" | sed 's/./& /g') ; do + set +${i} + done + set -${RUN_CSIT_SAVE_SET} +} + +# set options for quick bailout when error +function harden_set() { + set -xeo pipefail + set +u # enabled it would probably fail too many often +} + +# relax set options so the sourced file will not fail +# the responsibility is shifted to the sourced file... +function relax_set() { + set +e + set +o pipefail +} + +# wrapper for sourcing a file +function source_safely() { + [ -z "$1" ] && return 1 + relax_set + . "$1" + load_set +} + +# +# main +# + + +# set and save options for quick failure +harden_set && save_set + +if [ $# -eq 0 ] +then + echo + echo "Usage: $0 plans// []" + echo + echo " , , : " + echo " The same values as for the '{project}-csit-{functionality}' JJB job template." + echo + exit 1 +fi + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=$(git rev-parse --show-toplevel) +fi + +if [ -f "${WORKSPACE}/${1}/testplan.txt" ]; then + export TESTPLAN="${1}" +else + echo "testplan not found: ${WORKSPACE}/${TESTPLAN}/testplan.txt" + exit 2 +fi + +export TESTOPTIONS="${2}" + +rm -rf "$WORKSPACE/archives/$TESTPLAN" +mkdir -p "$WORKSPACE/archives/$TESTPLAN" + +TESTPLANDIR="${WORKSPACE}/${TESTPLAN}" + +# Set env variables +source_safely "${WORKSPACE}/sdnc-csit.env" +if [[ -z $ROBOT_IMAGE ]]; then + # Run installation of prerequired libraries + source_safely "${WORKSPACE}/prepare-csit.sh" + # Activate the virtualenv containing all the required libraries installed by prepare-csit.sh + source_safely "${ROBOT_VENV}/bin/activate" +fi + +WORKDIR=$(mktemp -d --suffix=-robot-workdir) +chmod a+rwx "${WORKDIR}" +echo "Additional info" +ls -lsa "${WORKDIR}" +id + +# Add csit scripts to PATH +export PATH="${PATH}:${WORKSPACE}/docker/scripts:${WORKSPACE}/scripts:${ROBOT_VENV}/bin" +export SCRIPTS="${WORKSPACE}/scripts" +export ROBOT_VARIABLES= + +# Sign in to nexus3 docker repo +docker login -u docker -p docker nexus3.onap.org:10001 + +# Run setup script plan if it exists +cd "${TESTPLANDIR}" +SETUP="${TESTPLANDIR}/setup.sh" +if [ -f "${SETUP}" ]; then + echo "Running setup script ${SETUP}" + source_safely "${SETUP}" +fi + +# show memory consumption after all docker instances initialized +docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-1-after-setup.txt" + +# Run test plan +cd "$WORKDIR" +echo "Reading the testplan:" +cat "${TESTPLANDIR}/testplan.txt" | egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' | sed "s|^|${WORKSPACE}/tests/|" > testplan.txt +cat testplan.txt +SUITES=$( xargs -a testplan.txt ) + +echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" +echo "Starting Robot test suites ${SUITES} ..." +relax_set + +if [[ -z $SDNC_RELEASE_WITHOUT_ROBOT ]] ; then + if [[ -z $SDNC_READY_STATE_TIME_OUT ]] ; then + # Runs an alternative robotframework setup as docker image in $ROBOT_IMAGE + # test suites will be executed within this docker container + # and results are stored as usual + if [[ -z $ROBOT_IMAGE ]]; then + echo "*** TRACE **** python is $(which python) [version $(python --version)]" + env + python -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} + else + echo "*** TRACE **** python is running in a container" + docker run --rm --net="host" \ + --env-file ${WORKSPACE}/sdnc-csit-robot.env \ + -v ${WORKSPACE}:${WORKSPACE} -v ${WORKDIR}:${WORKDIR} $ROBOT_IMAGE \ + python3 -B -m robot -N ${TESTPLAN} -v WORKSPACE:/tmp --outputdir ${WORKDIR} ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} + fi + else + echo "[INFO] Skip Robot test suite, because SDNC is not in ready state" + echo "[ERROR] SDNC is not in ready state, check karaf.log!" + false + fi +else + echo "[WARNING] SDNC_RELEASE_WITHOUT_ROBOT is TRUE " + echo "[WARNING] Dummy Robot test suite is executed, job remains ok. " + docker run --rm --net="host" \ + -v ${WORKSPACE}:${WORKSPACE} -v ${WORKDIR}:${WORKDIR} $ROBOT_IMAGE \ + python3 -B -m robot -N ${TESTPLAN} -v WORKSPACE:/tmp --outputdir ${WORKDIR} ${ROBOT_VARIABLES} ${TESTOPTIONS} ${WORKSPACE}/tests/sdnr/debug/10_dummy.robot + true +fi +RESULT=$? +load_set +echo "RESULT: $RESULT" +# Note that the final steps are done in on_exit function after this exit! +exit $RESULT diff --git a/csit/run-project-csit.sh b/csit/run-project-csit.sh new file mode 100755 index 00000000..12eb349f --- /dev/null +++ b/csit/run-project-csit.sh @@ -0,0 +1,33 @@ +#!/bin/bash -x +# +# Copyright 2020-2021 © Samsung Electronics Co., Ltd. +# +# 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. +# + +# $1 test options (passed on to run-csit.sh as such) +# + +export TESTOPTIONS=${1} +export WORKSPACE=$(git rev-parse --show-toplevel)/csit + +rm -rf ${WORKSPACE}/archives +mkdir -p ${WORKSPACE}/archives +cd ${WORKSPACE} + +# Execute all testsuites defined under plans subdirectory +for dir in plans/*/ +do + dir=${dir%*/} # remove the trailing / + ./run-csit.sh ${dir} ${TESTOPTIONS} +done diff --git a/csit/scripts/aaisimulator/aaiclient.properties b/csit/scripts/aaisimulator/aaiclient.properties new file mode 100755 index 00000000..74b5e567 --- /dev/null +++ b/csit/scripts/aaisimulator/aaiclient.properties @@ -0,0 +1,82 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 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========================================================= +### + +# +# Configuration file for A&AI Client +# + +# +# Certificate keystore and truststore +# +org.onap.ccsdk.sli.adaptors.aai.ssl.trust=/opt/onap/sdnc/data/stores/truststoreONAPall.jks +org.onap.ccsdk.sli.adaptors.aai.ssl.trust.psswd=${AAI_TRUSTSTORE_PASSWORD} +org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore=true + +org.onap.ccsdk.sli.adaptors.aai.client.name=${AAI_CLIENT_NAME} +org.onap.ccsdk.sli.adaptors.aai.client.psswd=${AAI_CLIENT_PASSWORD} + +org.onap.ccsdk.sli.adaptors.aai.application=openECOMP +# +# Configuration file for A&AI Client +# +org.onap.ccsdk.sli.adaptors.aai.uri=http://aaihost:8080 +connection.timeout=60000 +read.timeout=60000 + +# query +org.onap.ccsdk.sli.adaptors.aai.path.query=/aai/v13/search/sdn-zone-query +org.onap.ccsdk.sli.adaptors.aai.query.nodes=/aai/v13/search/nodes-query?search-node-type={node-type}&filter={entity-identifier}:EQUALS:{entity-name} +org.onap.ccsdk.sli.adaptors.aai.query.generic=/aai/v13/search/generic-query?key={identifier}:{value}&start-node-type={start-node-type}&include=complex&depth=3 + +# named query +org.onap.ccsdk.sli.adaptors.aai.query.named=/aai/search/named-query + +#update +org.onap.ccsdk.sli.adaptors.aai.update=/aai/v13/actions/update + +# UBB Notify +org.onap.ccsdk.sli.adaptors.aai.path.notify=/aai/v13/actions/notify +org.onap.ccsdk.sli.adaptors.aai.notify.selflink.fqdn=<%= @ubbUri %>/restconf/config/L3SDN-API:services/layer3-service-list/{service-instance-id} +org.onap.ccsdk.sli.adaptors.aai.notify.selflink.avpn=<%= @ubbUri %>/restconf/config/L3AVPN-EVC-API:services/service-list/{service-instance-id}/service-data/avpn-logicalchannel-information + +# P-Interfaces +org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterfaces=/aai/v13/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces +org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface=/aai/v13/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name} + +# VNF IMAGES +org.onap.ccsdk.sli.adaptors.aai.path.vnf.images=/aai/v13/service-design-and-creation/vnf-images +org.onap.ccsdk.sli.adaptors.aai.path.vnf.image=/aai/v13/service-design-and-creation/vnf-images/vnf-image/{att-uuid} +org.onap.ccsdk.sli.adaptors.aai.path.vnf.image.query=/aai/v13/service-design-and-creation/vnf-images/vnf-image?application={application_model}&application-vendor={application_vendor} + +# service instance +org.onap.ccsdk.sli.adaptors.aai.path.svcinst.query=/aai/v13/search/generic-query?key=service-instance.service-instance-id:{svc-instance-id}&start-node-type=service-instance&include=service-instance +org.onap.ccsdk.sli.adaptors.aai.path.service.instance=/aai/v13/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id} + +# VNF IMAGES QUERY +org.onap.ccsdk.sli.adaptors.aai.path.vnf.image.query=/aai/v13/service-design-and-creation/vnf-images/vnf-image?application={application_model}&application-vendor={application_vendor} + +# +# Formatting +# +org.onap.ccsdk.sli.adaptors.aai.param.format=filter=%s:%s +org.onap.ccsdk.sli.adaptors.aai.param.vnf_type=vnf-type +org.onap.ccsdk.sli.adaptors.aai.param.physical.location.id=physical-location-id +org.onap.ccsdk.sli.adaptors.aai.param.service.type=service-type diff --git a/csit/scripts/aaisimulator/wiremock/mappings/aai.json b/csit/scripts/aaisimulator/wiremock/mappings/aai.json new file mode 100755 index 00000000..64739068 --- /dev/null +++ b/csit/scripts/aaisimulator/wiremock/mappings/aai.json @@ -0,0 +1,41 @@ +{ + "mappings": [{ + "request": { + "method": "GET", + "url": "/aai/v24/business/customers/customer/testsvc1/service-subscriptions/service-subscription/test/service-instances/service-instance/5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca?depth=1" + }, + "response": { + "status": 200, + "jsonBody": { + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-name": "Nzrdm61asmsf01_svc", + "service-type": "INFRASTRUCTURE", + "service-role": "PROVIDER-NETWORK", + "environment-context": "General_Revenue-Bearing", + "workload-context": "Testing", + "resource-version": "1616417209896", + "selflink": "restconf/config/GENERIC-RESOURCE-API:services/service/5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca/service-data/service-topology/", + "orchestration-status": "Inventoried" + } + } + }, + { + "request": { + "method": "PATCH", + "url": "/aai/v24/business/customers/customer/testsvc1/service-subscriptions/service-subscription/test/service-instances/service-instance/5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca?resource-version=1616417209896", + "bodyPatterns": [{ + "equalToJson": { + "selflink": "restconf/config/GENERIC-RESOURCE-API:services/service/5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca/service-data/service-topology/", + "resource-version": "1616417209896", + "service-instance-name": "zrdm61asmsf01_svc" + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": true + }] + }, + "response": { + "status": 200 + } + } + ] +} diff --git a/csit/scripts/csit-data.sql b/csit/scripts/csit-data.sql new file mode 100644 index 00000000..06c94960 --- /dev/null +++ b/csit/scripts/csit-data.sql @@ -0,0 +1,79 @@ +-- +-- Dumping data for table `SERVICE_MODEL` +-- + +LOCK TABLES `SERVICE_MODEL` WRITE; +/*!40000 ALTER TABLE `SERVICE_MODEL` DISABLE KEYS */; +INSERT INTO `SERVICE_MODEL` VALUES ('00e50cbd-ef0f-4b28-821e-f2b583752dd3','!!com.att.sdnctl.uebclient.SdncNetworkServiceModel\ndescription: null\nimports:\n- Second try_vbng: {file: resource-SecondTryVbng-template.yml}\nmetadata: {invariantUUID: dbf9288d-18ef-4d28-82cb-29373028f367, UUID: 00e50cbd-ef0f-4b28-821e-f2b583752dd3,\n name: vBNG_0202, description: Virtual, type: Service, category: Network L1-3, serviceEcompNaming: false,\n serviceHoming: false}\ntopology_template:\n node_templates:\n Second try_vbng 1:\n type: com.att.d2.resource.vf.SecondTryVbng\n metadata: {invariantUUID: 57516bfc-35f5-4169-a4ee-66a495a9c645, UUID: f196fdad-9b74-4fcc-9d38-72f4a71aea77,\n customizationUUID: 72a9f413-4d16-4f7b-b0bc-d98f87997f01, version: \'1.0\', name: Second try_vbng,\n description: ntwork, type: VF, category: Generic, subcategory: Network Elements}\n groups:\n secondtry_vbng1..SecondTryVbng..VSR_base_hot..module-0:\n type: com.att.d2.groups.VfModule\n metadata: {vfModuleModelName: SecondTryVbng..VSR_base_hot..module-0, vfModuleModelInvariantUUID: b73fcd7d-f374-4e7e-a905-f5e58eb8a34a,\n vfModuleModelUUID: 3b3ff306-b493-4b3d-bb3d-baa13c2d82c7, vfModuleModelVersion: \'1\',\n vfModuleModelCustomizationUUID: d106e920-0188-48b7-9f90-ae7c1ab43b73}\n properties: {min_vf_module_instances: 1, vf_module_label: VSR_base_hot, max_vf_module_instances: 1,\n vf_module_type: Base, vf_module_description: null, volume_group: false, initial_count: 1}\n substitution_mappings:\n node_type: com.att.d2.service.Vbng0202\n capabilities:\n Second try_vbng 1.attachment_iom_ctrl_fabric_0_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.os_CPM:\n type: tosca.capabilities.OperatingSystem\n occurrences: [1, UNBOUNDED]\n properties:\n distribution: {type: string, required: false}\n type: {type: string, required: false}\n version: {type: version, required: false}\n architecture: {type: string, required: false}\n Second try_vbng 1.scalable_CPM:\n type: tosca.capabilities.Scalable\n occurrences: [1, UNBOUNDED]\n properties:\n max_instances: {type: integer, default: 1, required: false}\n min_instances: {type: integer, default: 1, required: false}\n default_instances: {type: integer, required: false}\n Second try_vbng 1.binding_iom_data_0_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.attachment_iom_mgt_0_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.binding_cpm_ctrl_fabric_0_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.scalable_IOM:\n type: tosca.capabilities.Scalable\n occurrences: [1, UNBOUNDED]\n properties:\n max_instances: {type: integer, default: 1, required: false}\n min_instances: {type: integer, default: 1, required: false}\n default_instances: {type: integer, required: false}\n Second try_vbng 1.attachment_iom_data_0_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.host_CPM:\n type: tosca.capabilities.Container\n occurrences: [1, UNBOUNDED]\n valid_source_types: [tosca.nodes.SoftwareComponent]\n properties:\n num_cpus: {type: integer, required: false}\n disk_size: {type: scalar-unit.size, required: false}\n cpu_frequency: {type: scalar-unit.frequency, required: false}\n mem_size: {type: scalar-unit.size, required: false}\n Second try_vbng 1.attachment_cpm_mgt_0_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.binding_iom_data_1_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.attachment_iom_data_3_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.binding_iom_mgt_0_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.attachment_iom_data_2_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.binding_iom_data_2_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.endpoint_CPM:\n type: tosca.capabilities.Endpoint.Admin\n occurrences: [1, UNBOUNDED]\n properties:\n port_name: {type: string, required: false}\n protocol: {type: string, default: tcp, required: false}\n port: {type: PortDef, required: false}\n initiator: {type: string, default: source, required: false}\n network_name: {type: string, default: PRIVATE, required: false}\n secure: {type: boolean, default: true, required: false}\n ports:\n type: map\n required: false\n entry_schema: {type: PortSpec}\n url_path: {type: string, required: false}\n Second try_vbng 1.binding_cpm_mgt_0_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.feature:\n type: tosca.capabilities.Node\n occurrences: [1, UNBOUNDED]\n Second try_vbng 1.binding_IOM:\n type: tosca.capabilities.network.Bindable\n occurrences: [1, UNBOUNDED]\n Second try_vbng 1.attachment_cpm_ctrl_fabric_0_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.binding_iom_ctrl_fabric_0_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.binding_iom_data_3_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.binding_CPM:\n type: tosca.capabilities.network.Bindable\n occurrences: [1, UNBOUNDED]\n Second try_vbng 1.attachment_iom_data_1_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.host_IOM:\n type: tosca.capabilities.Container\n occurrences: [1, UNBOUNDED]\n valid_source_types: [tosca.nodes.SoftwareComponent]\n properties:\n num_cpus: {type: integer, required: false}\n disk_size: {type: scalar-unit.size, required: false}\n cpu_frequency: {type: scalar-unit.frequency, required: false}\n mem_size: {type: scalar-unit.size, required: false}\n Second try_vbng 1.os_IOM:\n type: tosca.capabilities.OperatingSystem\n occurrences: [1, UNBOUNDED]\n properties:\n distribution: {type: string, required: false}\n type: {type: string, required: false}\n version: {type: version, required: false}\n architecture: {type: string, required: false}\n Second try_vbng 1.endpoint_IOM:\n type: tosca.capabilities.Endpoint.Admin\n occurrences: [1, UNBOUNDED]\n properties:\n port_name: {type: string, required: false}\n protocol: {type: string, default: tcp, required: false}\n port: {type: PortDef, required: false}\n initiator: {type: string, default: source, required: false}\n network_name: {type: string, default: PRIVATE, required: false}\n secure: {type: boolean, default: true, required: false}\n ports:\n type: map\n required: false\n entry_schema: {type: PortSpec}\n url_path: {type: string, required: false}\n requirements:\n Second try_vbng 1.local_storage_IOM:\n occurrences: [0, UNBOUNDED]\n capability: tosca.capabilities.Attachment\n node: tosca.nodes.BlockStorage\n relationship: tosca.relationships.AttachesTo\n Second try_vbng 1.link_iom_ctrl_fabric_0_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.link_cpm_ctrl_fabric_0_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.link_cpm_mgt_0_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.link_iom_data_3_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.local_storage_CPM:\n occurrences: [0, UNBOUNDED]\n capability: tosca.capabilities.Attachment\n node: tosca.nodes.BlockStorage\n relationship: tosca.relationships.AttachesTo\n Second try_vbng 1.dependency:\n occurrences: [0, UNBOUNDED]\n capability: tosca.capabilities.Node\n node: tosca.nodes.Root\n relationship: tosca.relationships.DependsOn\n Second try_vbng 1.link_iom_data_2_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.link_iom_data_0_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.link_iom_mgt_0_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.port:\n occurrences: [0, UNBOUNDED]\n capability: tosca.capabilities.Attachment\n node: com.att.d2.resource.cp.nodes.heat.network.neutron.Port\n relationship: com.att.d2.relationships.AttachesTo\n Second try_vbng 1.link_iom_data_1_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\ntosca_definitions_version: tosca_simple_yaml_1_0\n','dbf9288d-18ef-4d28-82cb-29373028f367',NULL,'vBNG_0202','Virtual','Service','Network L1-3','N','Vbng0202','service-Vbng0202-template.yml',NULL); +/*!40000 ALTER TABLE `SERVICE_MODEL` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `NETWORK_MODEL` +-- + +LOCK TABLES `NETWORK_MODEL` WRITE; +/*!40000 ALTER TABLE `NETWORK_MODEL` DISABLE KEYS */; +INSERT INTO `NETWORK_MODEL` VALUES ('b0cf3385-a390-488c-b6a0-d879fb4a4825','00e50cbd-ef0f-4b28-821e-f2b583752dd3','null','206d5e6c-4cba-4c14-b942-5d946c881869','9b7c1cbe-ddcd-458c-8792-d76391419b72','NEUTRON','VcpesvcVbng0412a.bng_mux','NEUTRON',NULL,NULL,NULL,'Y',NULL,'N',NULL,NULL,'N',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1.0'); +/*!40000 ALTER TABLE `NETWORK_MODEL` ENABLE KEYS */; +UNLOCK TABLES; +-- +-- Dumping data for table `VFC_MODEL` +-- + +LOCK TABLES `VFC_MODEL` WRITE; +/*!40000 ALTER TABLE `VFC_MODEL` DISABLE KEYS */; +INSERT INTO `VFC_MODEL` VALUES ('8b84aeae-51cf-48c2-8bb1-50c7aa444a16','null','84dfff0d-74df-4782-afc9-8a902db20c89','621eac8e-ade1-4d21-86a4-1a66caf964db','1.0',NULL,'Y',NULL,'vgmux','vgmux','vgmux','vgmux2-base-ubuntu-16-04','m1.medium',NULL,'{ecomp_generated_naming=true}',0,NULL); +/*!40000 ALTER TABLE `VFC_MODEL` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `VFC_TO_NETWORK_ROLE_MAPPING` +-- + +LOCK TABLES `VFC_TO_NETWORK_ROLE_MAPPING` WRITE; +/*!40000 ALTER TABLE `VFC_TO_NETWORK_ROLE_MAPPING` DISABLE KEYS */; +INSERT INTO `VFC_TO_NETWORK_ROLE_MAPPING` VALUES (2034,'8b84aeae-51cf-48c2-8bb1-50c7aa444a16','default-network-role','vgmux','mux_gw_private',0,0,'N',NULL,'4',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `VFC_TO_NETWORK_ROLE_MAPPING` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `VF_MODEL` +-- + +LOCK TABLES `VF_MODEL` WRITE; +/*!40000 ALTER TABLE `VF_MODEL` DISABLE KEYS */; +INSERT INTO `VF_MODEL` VALUES ('5724fcc8-2ae2-45ce-8d44-795092b85dee','null','b3dc6465-942c-42af-8464-2bf85b6e504b','ba3b8981-9a9c-4945-92aa-486234ec321f','1.0','vcpevsp_vgmux_0412',NULL,'Y',1,NULL,NULL,NULL,NULL,'integration','1.0', NULL, NULL, NULL); +/*!40000 ALTER TABLE `VF_MODEL` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `VF_MODULE_MODEL` +-- + +LOCK TABLES `VF_MODULE_MODEL` WRITE; +/*!40000 ALTER TABLE `VF_MODULE_MODEL` DISABLE KEYS */; +INSERT INTO `VF_MODULE_MODEL` VALUES ('59ffe5ba-cfaf-4e83-a2f3-159522dcebac','null','7ca7567c-f42c-4ed8-bcde-f8971b92d90a','513cc9fc-fff5-4c46-9728-393437536c4d','1','Base',NULL,NULL,'5724fcc8-2ae2-45ce-8d44-795092b85dee','base_vcpe_vgmux'); +/*!40000 ALTER TABLE `VF_MODULE_MODEL` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `VF_MODULE_TO_VFC_MAPPING` +-- + +LOCK TABLES `VF_MODULE_TO_VFC_MAPPING` WRITE; +/*!40000 ALTER TABLE `VF_MODULE_TO_VFC_MAPPING` DISABLE KEYS */; +INSERT INTO `VF_MODULE_TO_VFC_MAPPING` VALUES (1668,'59ffe5ba-cfaf-4e83-a2f3-159522dcebac','8b84aeae-51cf-48c2-8bb1-50c7aa444a16','vgmux',1); +/*!40000 ALTER TABLE `VF_MODULE_TO_VFC_MAPPING` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-11-02 21:47:47 diff --git a/csit/scripts/docker-compose.yml b/csit/scripts/docker-compose.yml new file mode 100755 index 00000000..b852c973 --- /dev/null +++ b/csit/scripts/docker-compose.yml @@ -0,0 +1,96 @@ +version: '3' + +services: + mariadb: + image: nexus3.onap.org:10001/mariadb:10.1.11 + ports: + - "3306:3306" + container_name: mariadb + volumes: + - /etc/localtime:/etc/localtime:ro + - ../archives/csit-dbinit.sql:/docker-entrypoint-initdb.d/dump.sql + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + hostname: + mariadb + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + + aaisim: + image: rodolpheche/wiremock + ports: + - "8080:8080" + command: --verbose + container_name: aaisim + volumes: + - /etc/localtime:/etc/localtime:ro + - ./aaisimulator/wiremock:/home/wiremock:ro + hostname: + aaisim + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + + sdnc: + image: onap/sdnc-image:latest + container_name: sdnc_controller + volumes: + - /etc/localtime:/etc/localtime:ro + - $SDNC_CERT_PATH:/opt/opendaylight/current/certs + - ./aaisimulator/aaiclient.properties:/opt/onap/sdnc/data/properties/aaiclient.properties:ro + entrypoint: ["/opt/onap/sdnc/bin/startODL.sh"] + ports: + - "8282:8181" + hostname: + sdnc + links: + - mariadb:dbhost + - mariadb:sdnctldb01 + - mariadb:sdnctldb02 + - aaisim:aaihost + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - SDNC_CONFIG_DIR=/opt/onap/sdnc/data/properties + - SDNC_BIN=/opt/onap/sdnc/bin + - ODL_CERT_DIR=/tmp + - ODL_ADMIN_USERNAME=${ODL_USER} + - ODL_ADMIN_PASSWORD=${ODL_PASSWORD} + - ODL_USER=${ODL_USER} + - ODL_PASSWORD=${ODL_PASSWORD} + - ODL_CERT_DIR=/opt/opendaylight/current/certs + - SDNC_DB_INIT=true + - HONEYCOMB_USER=${HONEYCOMB_USER} + - HONEYCOMB_PASSWORD=${HONEYCOMB_PASSWORD} + - TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD} + - KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD} + - SO_USER=${SO_USER} + - SO_PASSWORD=${SO_PASSWORD} + - NENG_USER=${NENG_USER} + - NENG_PASSWORD=${NENG_PASSWORD} + - CDS_USER=${CDS_USER} + - CDS_PASSWORD=${CDS_PASSWORD} + - ANSIBLE_USER=${ANSIBLE_USER} + - ANSIBLE_PASSWORD=${ANSIBLE_PASSWORD} + - SQL_CRYPTKEY=${SQL_CRYPTKEY} + - A1_TRUSTSTORE_PASSWORD=a1adapter + - KARAF_CONSOLE_LOG_LEVEL=info + depends_on: + - mariadb + dns: + - ${DNS_IP_ADDR-10.0.100.1} + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" diff --git a/csit/scripts/sdnr/docker-compose/.env b/csit/scripts/sdnr/docker-compose/.env new file mode 100644 index 00000000..a6b0b92b --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/.env @@ -0,0 +1,53 @@ +COMPOSE_PROJECT_NAME=integration + +# network +# all components are reachable via docker network +# IP adresses are defined within each section +NETWORK_NAME=integration +NETWORK_SUBNET=172.40.0.0/16 +GATEWAY_IP=172.40.0.1 +IPV6_ENABLED="false" + +# sdnc/r +NEXUS_DOCKER_REPO=nexus3.onap.org:10001 +NEXUS_DOCKER_IMAGE_NAME=onap/sdnc-image +NEXUS_DOCKER_IMAGE_TAG=latest +ODL_ADMIN_USERNAME=admin +ODL_ADMIN_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +#ODL_ADMIN_PASSWORD=admin +ODL_CERT_DIR=/opt/opendaylight/current/certs +SDN_CONTROLLER_PROTOCOL="http" +SDNR_IP=172.40.0.21 +SDNRPORT=8181 +SDNR_DM=true +SDNR_WEBSOCKET_PORT=8182 + +# sdnrdb +MARIADB_VERSION=10.5 +MARIADB_IMAGE=bitnami/mariadb +MARIADB_IP=172.40.0.71 + + +# sdnc-web +#NEXUS_DOCKER_REPO see sdnc section +NEXUS_DOCKER_WEB_IMAGE_NAME=onap/sdnc-web-image +NEXUS_DOCKER_WEB_IMAGE_TAG=latest +SDNR_WEB_IP=172.40.0.25 +SDNC_WEB_PORT=8282 + + +# onap dependent components +VESC_IMAGE=nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.10.3 +DMAAP_IMAGE=nexus3.onap.org:10001/onap/dmaap/dmaap-mr:1.1.18 +KAFKA_IMAGE=nexus3.onap.org:10001/onap/dmaap/kafka111:1.0.4 +ZOOKEEPER_IMAGE=nexus3.onap.org:10001/onap/dmaap/zookeeper:6.0.3 +ZOOKEEPER_IP=172.40.0.60 +KAFKA_IP=172.40.0.70 +DMAAP_IP=172.40.0.80 +VESCOLLECTOR_IP=172.40.0.90 + +# NTSim +NTS_NF_SDN_CONTROLLER_IP=127.0.0.1 +NTS_NF_SDN_CONTROLLER_PORT=8181 +NTS_HOST_IP=172.40.0.1 +NTS_NF_MOUNT_POINT_ADDRESSING_METHOD=docker-mapping diff --git a/csit/scripts/sdnr/docker-compose/docker-compose-nts-networkfunction.yaml b/csit/scripts/sdnr/docker-compose/docker-compose-nts-networkfunction.yaml new file mode 100644 index 00000000..a4ae7feb --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/docker-compose-nts-networkfunction.yaml @@ -0,0 +1,63 @@ +# ******************************************************************************* +# * ============LICENSE_START======================================================================== +# * Copyright (C) 2021 highstreet technologies GmbH 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========================================================================== +version: "3" +services: + nts-function: + image: ${NTS_NF_DOCKER_REPOSITORY}${NTS_NF_IMAGE_NAME}:${NTS_NF_IMAGE_TAG} + container_name: ${NTS_NF_IMAGE_NAME} + stop_grace_period: 5m + cap_add: + - NET_ADMIN + ports: + - "::${NTS_HOST_NETCONF_SSH_BASE_PORT}-${NTS_HOST_NETCONF_SSH_BASE_PORT_PLUS_SSH_CON}:${EXPOSE_PORT_SSH}-${EXPOSE_PORT_SSH_PLUS_CON}" + - "::${NTS_HOST_NETCONF_TLS_BASE_PORT}-${NTS_HOST_NETCONF_TLS_BASE_PORT_PLUS_TLS_CON}:${EXPOSE_PORT_TLS}-${EXPOSE_PORT_TLS_PLUS_CON}" + environment: + NTS_NF_STANDALONE_START_FEATURES: "datastore-populate ves-heartbeat ves-pnf-registration web-cut-through manual-notification-generation" + NTS_NF_MOUNT_POINT_ADDRESSING_METHOD: ${NTS_NF_MOUNT_POINT_ADDRESSING_METHOD} # mapping types: host-mapping, docker-mapping + NTS_HOST_IP: ${NTS_HOST_IP} + HOSTNAME: ${NTS_NF_CONTAINER_NAME} + IPv6_ENABLED: ${IPV6_ENABLED} + + SSH_CONNECTIONS: ${NTS_NF_SSH_CONNECTIONS} + TLS_CONNECTIONS: ${NTS_NF_TLS_CONNECTIONS} + NTS_HOST_NETCONF_SSH_BASE_PORT: ${NTS_HOST_NETCONF_SSH_BASE_PORT} + NTS_HOST_NETCONF_TLS_BASE_PORT: ${NTS_HOST_NETCONF_TLS_BASE_PORT} + + SDN_CONTROLLER_PROTOCOL: ${SDN_CONTROLLER_PROTOCOL} + SDN_CONTROLLER_IP: ${NTS_NF_SDN_CONTROLLER_IP} + SDN_CONTROLLER_PORT: ${NTS_NF_SDN_CONTROLLER_PORT} + SDN_CONTROLLER_CALLHOME_PORT: 6666 + SDN_CONTROLLER_USERNAME: ${ODL_ADMIN_USERNAME} + SDN_CONTROLLER_PASSWORD: ${ODL_ADMIN_PASSWORD} + + VES_ENDPOINT_PROTOCOL: "https" + VES_ENDPOINT_IP: "127.0.0.1" + VES_ENDPOINT_PORT: 1234 + VES_ENDPOINT_AUTH_METHOD: "no-auth" + VES_ENDPOINT_USERNAME: "admin" + VES_ENDPOINT_PASSWORD: "admin" + networks: + integration: + ipv4_address: ${NTS_NF_IP} + +networks: + integration: + name: ${NETWORK_NAME} + driver: bridge + ipam: + driver: default + config: + - subnet: ${NETWORK_SUBNET} + gateway: ${GATEWAY_IP} diff --git a/csit/scripts/sdnr/docker-compose/docker-compose-onap-addons.yaml b/csit/scripts/sdnr/docker-compose/docker-compose-onap-addons.yaml new file mode 100644 index 00000000..e4e80a6e --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/docker-compose-onap-addons.yaml @@ -0,0 +1,101 @@ +version: '2' +services: + zookeeper: + image: ${ZOOKEEPER_IMAGE} + container_name: zookeeper + ports: + - "2181:2181" + environment: + ZOOKEEPER_REPLICAS: 1 + ZOOKEEPER_TICK_TIME: 2000 + ZOOKEEPER_SYNC_LIMIT: 5 + ZOOKEEPER_INIT_LIMIT: 10 + ZOOKEEPER_MAX_CLIENT_CNXNS: 200 + ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3 + ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 24 + ZOOKEEPER_CLIENT_PORT: 2181 + KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl + ZOOKEEPER_SERVER_ID: + volumes: + - ./zk/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf + networks: + integration: + aliases: + - zookeeper + ipv4_address: ${ZOOKEEPER_IP} + kafka: + image: ${KAFKA_IMAGE} + container_name: kafka + ports: + - "9092:9092" + environment: + enableCadi: 'false' + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000 + KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT + KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://kafka:9092 + KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:9092 + KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT + KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false' + KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf + KAFKA_ZOOKEEPER_SET_ACL: 'true' + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + # Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment + KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1 + volumes: + - ./kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf + networks: + integration: + aliases: + - kafka + ipv4_address: ${KAFKA_IP} + + depends_on: + - zookeeper + onap-dmaap: + container_name: onap-dmaap + image: ${DMAAP_IMAGE} + ports: + - "3904:3904" + - "3905:3905" + environment: + enableCadi: 'false' + volumes: + - ./mr/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties + - ./mr/logback.xml:/appl/dmaapMR1/bundleconfig/etc/logback.xml + - ./mr/cadi.properties:/appl/dmaapMR1/etc/cadi.properties + networks: + integration: + aliases: + - dmaap + ipv4_address: ${DMAAP_IP} + + depends_on: + - zookeeper + - kafka + vesc: + image: ${VESC_IMAGE} + container_name: vescollector + environment: + DMAAPHOST: "dmaap" + ports: + - "8080:8080" + - "8443:8443" + volumes: + - ./vesc/collector.properties:/opt/app/VESCollector/etc/collector.properties + - ./vesc/ves-dmaap-config.json:/opt/app/VESCollector/etc/ves-dmaap-config.json + - ./vesc/externalRepo:/opt/app/VESCollector/etc/externalRepo + + networks: + integration: + ipv4_address: ${VESCOLLECTOR_IP} + +networks: + integration: + name: ${NETWORK_NAME} + driver: bridge + ipam: + driver: default + config: + - subnet: ${NETWORK_SUBNET} diff --git a/csit/scripts/sdnr/docker-compose/docker-compose-sdnrdb-elasticsearch.yaml b/csit/scripts/sdnr/docker-compose/docker-compose-sdnrdb-elasticsearch.yaml new file mode 100644 index 00000000..0072b5bc --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/docker-compose-sdnrdb-elasticsearch.yaml @@ -0,0 +1,22 @@ +version: "2.2" +services: + sdnrdb: + image: ${ES_IMAGE}:${ES_VERSION} + container_name: sdnrdb + environment: + - discovery.type=single-node + networks: + integration: + ipv4_address: ${ESDB_IP} + sdnr: + environment: + - SDNRDBURL=http://sdnrdb:9200 +networks: + integration: + name: ${NETWORK_NAME} + driver: bridge + ipam: + driver: default + config: + - subnet: ${NETWORK_SUBNET} + gateway: ${GATEWAY_IP} diff --git a/csit/scripts/sdnr/docker-compose/docker-compose-sdnrdb-mariadb.yaml b/csit/scripts/sdnr/docker-compose/docker-compose-sdnrdb-mariadb.yaml new file mode 100644 index 00000000..686ae7d4 --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/docker-compose-sdnrdb-mariadb.yaml @@ -0,0 +1,44 @@ +# ******************************************************************************* +# * ============LICENSE_START======================================================================== +# * Copyright (C) 2021 highstreet technologies GmbH 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========================================================================== +version: "2.2" +services: + sdnrdb: + image: ${MARIADB_IMAGE}:${MARIADB_VERSION} + container_name: sdnrdb + ports: + - 3306:3306 + environment: + - MARIADB_ROOT_PASSWORD=admin + - MARIADB_DATABASE=sdnrdb + - MARIADB_USER=sdnrdb + - MARIADB_PASSWORD=sdnrdb + - MARIADB_EXTRA_FLAGS=--bind-address=* --max_connections=400 + - MYSQL_ROOT_PASSWORD=admin + - MYSQL_DATABASE=sdnrdb + - MYSQL_USER=sdnrdb + - MYSQL_PASSWORD=sdnrdb + networks: + integration: + ipv4_address: ${MARIADB_IP} + +networks: + integration: + name: ${NETWORK_NAME} + driver: bridge + ipam: + driver: default + config: + - subnet: ${NETWORK_SUBNET} + gateway: ${GATEWAY_IP} diff --git a/csit/scripts/sdnr/docker-compose/docker-compose-single-sdnr-web.override.yaml b/csit/scripts/sdnr/docker-compose/docker-compose-single-sdnr-web.override.yaml new file mode 100644 index 00000000..0f547e8f --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/docker-compose-single-sdnr-web.override.yaml @@ -0,0 +1,33 @@ +version: "2.2" +services: + sdnr: + environment: + - SDNRDM="true" + sdnr-web: + image: ${NEXUS_DOCKER_WEB_IMAGE_NAME}:${NEXUS_DOCKER_IMAGE_TAG} + container_name: sdnr-web + ports: + - "${SDNC_WEB_PORT}:${SDNC_WEB_PORT}" + environment: + - WEBPROTOCOL=HTTP + - WEBPORT=${SDNC_WEB_PORT} + - SDNRPROTOCOL=HTTP + - SDNRHOST=sdnr + - SDNRPORT=${SDNRPORT} + depends_on: + - sdnr + command: ["/wait-for-sdnc.sh", "sdnr:${SDNRPORT}/ready", "/opt/bitnami/nginx/sbin/run.sh"] + volumes: + - ./wait-for-sdnc.sh:/wait-for-sdnc.sh + networks: + integration: + ipv4_address: ${SDNR_WEB_IP} +networks: + integration: + name: ${NETWORK_NAME} + driver: bridge + ipam: + driver: default + config: + - subnet: ${NETWORK_SUBNET} + gateway: ${GATEWAY_IP} diff --git a/csit/scripts/sdnr/docker-compose/docker-compose-single-sdnr.yaml b/csit/scripts/sdnr/docker-compose/docker-compose-single-sdnr.yaml new file mode 100644 index 00000000..48c32ba0 --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/docker-compose-single-sdnr.yaml @@ -0,0 +1,55 @@ +version: "2.2" +services: + sdnr: + image: ${NEXUS_DOCKER_IMAGE_NAME}:${NEXUS_DOCKER_IMAGE_TAG} + container_name: sdnr + ports: + - "8181:8181" + - "8101:8101" + - "${SDNR_WEBSOCKET_PORT}:${SDNR_WEBSOCKET_PORT}" +#entrypoint: ["/bin/bash", "/opt/onap/sdnc/bin/startODL.oom.sh"] + environment: + - SDNC_CONFIG_DIR=/opt/onap/ccsdk/data/properties + - ODL_CERT_DIR=${ODL_CERT_DIR} + - ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD} + - ENABLE_ODL_CLUSTER=false + - SDNC_REPLICAS=0 + - CCSDK_REPLICAS=0 + - DOMAIN="" + - SDNRWT=true + - SDNRINIT=true + - SDNRONLY=true + - JAVA_OPTS=-Xms256m -Xmx2g + - SDNR_WEBSOCKET_PORT=${SDNR_WEBSOCKET_PORT} + - SDNR_KAFKA_ENABLED=true + - SDNR_KAFKA_BOOTSTRAP_SERVERS=kafka:9092 + - SDNR_KAFKA_SECURITY_PROTOCOL=PLAINTEXT + - SDNR_KAFKA_SASL_MECHANISM=PLAIN + - SDNR_KAFKA_SASL_JAAS_CONFIG=PLAIN + - SDNRUSERNAME=${ODL_ADMIN_USERNAME} + - SDNRPASSWORD=${ODL_ADMIN_PASSWORD} + - SDNRDBTYPE=MARIADB + - SDNRDBURL=jdbc:mysql://sdnrdb:3306/sdnrdb + - SDNRDBUSERNAME=sdnrdb + - SDNRDBPASSWORD=sdnrdb + volumes: + - ./sdnr/certs/certs.properties:${ODL_CERT_DIR}/certs.properties + - ./sdnr/certs/keys0.zip:${ODL_CERT_DIR}/keys0.zip + networks: + integration: + ipv4_address: ${SDNR_IP} + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + +networks: + integration: + name: ${NETWORK_NAME} + driver: bridge + ipam: + driver: default + config: + - subnet: ${NETWORK_SUBNET} + gateway: ${GATEWAY_IP} diff --git a/csit/scripts/sdnr/docker-compose/kafka/zk_client_jaas.conf b/csit/scripts/sdnr/docker-compose/kafka/zk_client_jaas.conf new file mode 100755 index 00000000..d4ef1eb0 --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/kafka/zk_client_jaas.conf @@ -0,0 +1,5 @@ +Client { + org.apache.zookeeper.server.auth.DigestLoginModule required + username="kafka" + password="kafka_secret"; + }; \ No newline at end of file diff --git a/csit/scripts/sdnr/docker-compose/mr/MsgRtrApi.properties b/csit/scripts/sdnr/docker-compose/mr/MsgRtrApi.properties new file mode 100644 index 00000000..33ff0fdb --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/mr/MsgRtrApi.properties @@ -0,0 +1,169 @@ +############################################################################### +# ============LICENSE_START======================================================= +# org.onap.dmaap +# ================================================================================ +# Copyright � 2017 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========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +############################################################################### +############################################################################### +## +## Cambria API Server config +## +## - Default values are shown as commented settings. +## + +############################################################################### +## +## HTTP service +## +## - 3904 is standard as of 7/29/14. +# +## Zookeeper Connection +## +## Both Cambria and Kafka make use of Zookeeper. +## +#config.zk.servers=172.18.1.1 +config.zk.servers=zookeeper +#config.zk.root=/fe3c/cambria/config + + +############################################################################### +## +## Kafka Connection +## +## Items below are passed through to Kafka's producer and consumer +## configurations (after removing "kafka.") +## if you want to change request.required.acks it can take this one value +#kafka.metadata.broker.list=localhost:9092,localhost:9093 +kafka.metadata.broker.list=kafka:9092 +##kafka.request.required.acks=-1 +#kafka.client.zookeeper=${config.zk.servers} +consumer.timeout.ms=100 +zookeeper.connection.timeout.ms=6000 +zookeeper.session.timeout.ms=20000 +zookeeper.sync.time.ms=2000 +auto.commit.interval.ms=1000 +fetch.message.max.bytes =1000000 +auto.commit.enable=false + +#(backoff*retries > zksessiontimeout) +kafka.rebalance.backoff.ms=10000 +kafka.rebalance.max.retries=6 + + +############################################################################### +## +## Secured Config +## +## Some data stored in the config system is sensitive -- API keys and secrets, +## for example. to protect it, we use an encryption layer for this section +## of the config. +## +## The key is a base64 encode AES key. This must be created/configured for +## each installation. +#cambria.secureConfig.key= +## +## The initialization vector is a 16 byte value specific to the secured store. +## This must be created/configured for each installation. +#cambria.secureConfig.iv= + +## Southfield Sandbox +cambria.secureConfig.key=b/7ouTn9FfEw2PQwL0ov/Q== +cambria.secureConfig.iv=wR9xP5k5vbz/xD0LmtqQLw== +authentication.adminSecret=fe3cCompound +#cambria.secureConfig.key[pc569h]=YT3XPyxEmKCTLI2NK+Sjbw== +#cambria.secureConfig.iv[pc569h]=rMm2jhR3yVnU+u2V9Ugu3Q== + + +############################################################################### +## +## Consumer Caching +## +## Kafka expects live connections from the consumer to the broker, which +## obviously doesn't work over connectionless HTTP requests. The Cambria +## server proxies HTTP requests into Kafka consumer sessions that are kept +## around for later re-use. Not doing so is costly for setup per request, +## which would substantially impact a high volume consumer's performance. +## +## This complicates Cambria server failover, because we often need server +## A to close its connection before server B brings up the replacement. +## + +## The consumer cache is normally enabled. +#cambria.consumer.cache.enabled=true + +## Cached consumers are cleaned up after a period of disuse. The server inspects +## consumers every sweepFreqSeconds and will clean up any connections that are +## dormant for touchFreqMs. +#cambria.consumer.cache.sweepFreqSeconds=15 +cambria.consumer.cache.touchFreqMs=120000 +##stickforallconsumerrequests=false +## The cache is managed through ZK. The default value for the ZK connection +## string is the same as config.zk.servers. +#cambria.consumer.cache.zkConnect=${config.zk.servers} + +## +## Shared cache information is associated with this node's name. The default +## name is the hostname plus the HTTP service port this host runs on. (The +## hostname is determined via InetAddress.getLocalHost ().getCanonicalHostName(), +## which is not always adequate.) You can set this value explicitly here. +## +#cambria.api.node.identifier= + +#cambria.rateLimit.maxEmptyPollsPerMinute=30 +#cambria.rateLimitActual.delay.ms=10 + +############################################################################### +## +## Metrics Reporting +## +## This server can report its metrics periodically on a topic. +## +#metrics.send.cambria.enabled=true +#metrics.send.cambria.topic=cambria.apinode.metrics #msgrtr.apinode.metrics.dmaap +#metrics.send.cambria.sendEverySeconds=60 + +cambria.consumer.cache.zkBasePath=/fe3c/cambria/consumerCache +consumer.timeout=17 + +############################################################################## +#100mb +maxcontentlength=10000 + + +############################################################################## +#AAF Properties +msgRtr.namespace.aaf=org.onap.dmaap.mr.topic +msgRtr.topicfactory.aaf=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic: +enforced.topic.name.AAF=org.onap.dmaap.mr +forceAAF=false +transidUEBtopicreqd=false +defaultNSforUEB=org.onap.dmaap.mr +############################################################################## +#Mirror Maker Agent +msgRtr.mirrormakeradmin.aaf=org.onap.dmaap.mr.mirrormaker|*|admin +msgRtr.mirrormakeruser.aaf=org.onap.dmaap.mr.mirrormaker|*|user +msgRtr.mirrormakeruser.aaf.create=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic: +msgRtr.mirrormaker.timeout=15000 +msgRtr.mirrormaker.topic=org.onap.dmaap.mr.mmagent +msgRtr.mirrormaker.consumergroup=mmagentserver +msgRtr.mirrormaker.consumerid=1 + +kafka.max.poll.interval.ms=300000 +kafka.heartbeat.interval.ms=60000 +kafka.session.timeout.ms=240000 +kafka.max.poll.records=1000 \ No newline at end of file diff --git a/csit/scripts/sdnr/docker-compose/mr/cadi.properties b/csit/scripts/sdnr/docker-compose/mr/cadi.properties new file mode 100644 index 00000000..dca56c82 --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/mr/cadi.properties @@ -0,0 +1,19 @@ +aaf_locate_url=https://aaf-locate.{{ include "common.namespace" . }}:8095 +aaf_url=https://AAF_LOCATE_URL/onap.org.osaaf.aaf.service:2.1 +aaf_env=DEV +aaf_lur=org.onap.aaf.cadi.aaf.v2_0.AAFLurPerm + +cadi_truststore=/appl/dmaapMR1/etc/org.onap.dmaap.mr.trust.jks +cadi_truststore_password=enc:mN6GiIzFQxKGDzAXDOs7b4j8DdIX02QrZ9QOWNRpxV3rD6whPCfizSMZkJwxi_FJ + +cadi_keyfile=/appl/dmaapMR1/etc/org.onap.dmaap.mr.keyfile + +cadi_alias=dmaapmr@mr.dmaap.onap.org +cadi_keystore=/appl/dmaapMR1/etc/org.onap.dmaap.mr.p12 +cadi_keystore_password=enc:_JJT2gAEkRzXla5xfDIHal8pIoIB5iIos3USvZQT6sL-l14LpI5fRFR_QIGUCh5W +cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US + +cadi_loglevel=INFO +cadi_protocols=TLSv1.1,TLSv1.2 +cadi_latitude=37.78187 +cadi_longitude=-122.26147 \ No newline at end of file diff --git a/csit/scripts/sdnr/docker-compose/mr/logback.xml b/csit/scripts/sdnr/docker-compose/mr/logback.xml new file mode 100644 index 00000000..f02a2db7 --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/mr/logback.xml @@ -0,0 +1,208 @@ + + + + ${module.ajsc.namespace.name} + + + + + ERROR + ACCEPT + DENY + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n + + + + + + + INFO + ACCEPT + DENY + + + + + + + "%d [%thread] %-5level %logger{1024} - %msg%n" + + + + class="ch.qos.logback.core.ConsoleAppender"> + + ERROR + ACCEPT + DENY + + + "%d [%thread] %-5level %logger{1024} - %msg%n" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "%d [%thread] %-5level %logger{1024} - %msg%n" + + + + + + + "%d [%thread] %-5level %logger{1024} - %msg%n" + + + + 1000 + 0 + + + + + + + + + + + 1000 + 0 + + + + + + + + + + + + + + + + diff --git a/csit/scripts/sdnr/docker-compose/nts-networkfunctions-launch.sh b/csit/scripts/sdnr/docker-compose/nts-networkfunctions-launch.sh new file mode 100755 index 00000000..3b1e8265 --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/nts-networkfunctions-launch.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# ******************************************************************************* +# * ============LICENSE_START======================================================================== +# * Copyright (C) 2021 highstreet technologies GmbH 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========================================================================== + +set -o xtrace +set +e +csvfile=$1 +export DOCKER_ENGINE_VERSION=$(docker version --format '{{.Server.APIVersion}}') + +CUR_PATH="`dirname \"$0\"`" # relative path +CUR_PATH="`( cd \"$CUR_PATH\" && pwd )`" # absolutized and normalized +if [ -z "$CUR_PATH" ] ; then + echo "Permission error!" + exit 1 +fi + +# define location of workpsace based on where the current script is +WORKSPACE=$(cd $CUR_PATH/../../../ && pwd) +if [ $# -lt 1 ]; then + echo "No arguments provided. Using default 'nts-networkfunctions.csv'" + csvfile="$CUR_PATH/nts-networkfunctions.csv" +fi + +firstline=0 +# read each line of nts-networkfunctions.csv and put in into the corresponding variables +while IFS=',' read NAME NTS_NF_DOCKER_REPOSITORY NTS_NF_IMAGE_NAME NTS_NF_IMAGE_TAG NTS_NF_IP NTS_NF_IPv6 \ + NTS_HOST_NETCONF_SSH_BASE_PORT NTS_HOST_NETCONF_TLS_BASE_PORT NTS_NF_SSH_CONNECTIONS NTS_NF_TLS_CONNECTIONS \ + PORT NETCONF_HOST USER PASSWORD NTS_FUNCTION_TYPE; do + if [ $firstline -eq 0 ]; then + firstline=1 + continue + fi + if [ -n "${NTS_NF_GLOBAL_TAG}" ]; then + NTS_NF_IMAGE_TAG=${NTS_NF_GLOBAL_TAG} + fi + if [[ -z ${USE_DEFAULT_REPO} ]]; then + export NTS_NF_DOCKER_REPOSITORY=$NTS_NF_DOCKER_REPOSITORY + fi + export NAME=$NAME + export NTS_NF_IMAGE_NAME=$NTS_NF_IMAGE_NAME + export NTS_NF_IMAGE_TAG=$NTS_NF_IMAGE_TAG + export NTS_NF_IP=$NTS_NF_IP + export NTS_NF_IPv6=$NTS_NF_IPv6 + export NTS_HOST_NETCONF_SSH_BASE_PORT=$NTS_HOST_NETCONF_SSH_BASE_PORT + export NTS_HOST_NETCONF_TLS_BASE_PORT=$NTS_HOST_NETCONF_TLS_BASE_PORT + export NTS_HOST_NETCONF_SSH_BASE_PORT_PLUS_SSH_CON=$(expr $NTS_HOST_NETCONF_SSH_BASE_PORT + $NTS_NF_SSH_CONNECTIONS - 1) + export NTS_HOST_NETCONF_TLS_BASE_PORT_PLUS_TLS_CON=$(expr $NTS_HOST_NETCONF_TLS_BASE_PORT + $NTS_NF_TLS_CONNECTIONS - 1) + EXPOSE_PORT=830 + export EXPOSE_PORT_SSH=$EXPOSE_PORT + EXPOSE_PORT=$(expr $EXPOSE_PORT + $NTS_NF_SSH_CONNECTIONS) + export EXPOSE_PORT_SSH_PLUS_CON=$(expr $EXPOSE_PORT - 1) + export EXPOSE_PORT_TLS=$EXPOSE_PORT + EXPOSE_PORT=$(expr $EXPOSE_PORT + $NTS_NF_TLS_CONNECTIONS) + export EXPOSE_PORT_TLS_PLUS_CON=$(expr $EXPOSE_PORT - 1) + export NTS_NF_CONTAINER_NAME=$NAME + export NTS_NF_SSH_CONNECTIONS=$NTS_NF_SSH_CONNECTIONS + export NTS_NF_TLS_CONNECTIONS=$NTS_NF_TLS_CONNECTIONS + + SCRIPTDIR=${CUR_PATH}/$NAME/scripts + export SCRIPTDIR=$SCRIPTDIR + + mkdir -p $SCRIPTDIR + + docker-compose -p ${NAME} --env-file $CUR_PATH/.env -f $CUR_PATH/docker-compose-nts-networkfunction.yaml up -d +done <$csvfile +docker ps -a --format "table |{{.Names}}\t|{{.Image}}\t|{{printf \"%.70s\" .Ports}}|"| { head -1; sort --field-separator='|' -k 4;} +set -e diff --git a/csit/scripts/sdnr/docker-compose/sdnr/certs/certs.properties b/csit/scripts/sdnr/docker-compose/sdnr/certs/certs.properties new file mode 100644 index 00000000..32373a4d --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/sdnr/certs/certs.properties @@ -0,0 +1,2 @@ +keys0.zip +*********** diff --git a/csit/scripts/sdnr/docker-compose/sdnr/certs/keys0.zip b/csit/scripts/sdnr/docker-compose/sdnr/certs/keys0.zip new file mode 100644 index 00000000..588315f2 Binary files /dev/null and b/csit/scripts/sdnr/docker-compose/sdnr/certs/keys0.zip differ diff --git a/csit/scripts/sdnr/docker-compose/vesc/collector.properties b/csit/scripts/sdnr/docker-compose/vesc/collector.properties new file mode 100644 index 00000000..fff480cd --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/vesc/collector.properties @@ -0,0 +1,76 @@ +############################################################################### +## +## Collector Server config +## +## - Default values are shown as commented settings. +## +############################################################################### +## +## HTTP(S) service +## +## Normally: +## +## - 8080 is http service +## - https is disabled by default +## +## - At this time, the server always binds to 0.0.0.0 +## +## +#collector.service.port=8080 + +## Authentication is only supported via secure port +## When enabled - require valid keystore defined +collector.service.secure.port=8443 + +# auth.method flags: +# +# noAuth - default option - no security (http) +# certBasicAuth - auth by certificate and basic auth username / password (https) +auth.method=certBasicAuth + +## Combination of userid,hashPassword encoded pwd list to be supported +## userid and pwd comma separated; pipe delimitation between each pair +## Password is generated by crypt-password library using BCrypt algorithm stored in dcaegen2/sdk package +## or https://nexus.onap.org/#nexus-search;quick~crypt-password +header.authlist=sample1,$2a$10$0buh.2WeYwN868YMwnNNEuNEAMNYVU9.FSMJGyIKV3dGET/7oGOi6 + +## The keystore must be setup per installation when secure port is configured +collector.keystore.file.location=etc/keystore +collector.keystore.passwordfile=etc/passwordfile + +collector.cert.subject.matcher=etc/certSubjectMatcher.properties + +## The truststore must be setup per installation when mutual tls support is configured +collector.truststore.file.location=etc/truststore +collector.truststore.passwordfile=etc/trustpasswordfile + +## Schema Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schemafile location must be specified +collector.schema.checkflag=1 +collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\",\"v7\":\"./etc/CommonEventFormat_30.2.1_ONAP.json\"} + +## Schema StndDefinedFields Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schema files locations must be specified, mapping file path must be specified, schema reference path +## in event json must be specified, path to stndDefined data field in event json must be specified +collector.externalSchema.checkflag=1 +collector.externalSchema.schemasLocation=etc/externalRepo/ +collector.externalSchema.mappingFileLocation=etc/externalRepo/schema-map.json +event.externalSchema.schemaRefPath=$.event.stndDefinedFields.schemaReference +event.externalSchema.stndDefinedDataPath=$.event.stndDefinedFields.data + +## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile +collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance|o-ran-sc-du-hello-world-pm-streaming-oas3=ves-o-ran-sc-du-hello-world-pm-streaming-oas3|o1-notify-pnf-registration=ves-o1-notify-pnf-registration +collector.dmaapfile=etc/ves-dmaap-config.json + +## Path to the file containing description of api versions +collector.description.api.version.location=etc/api_version_description.json + +## Event transformation Flag - when set expects configurable transformation +## defined under ./etc/eventTransform.json +## Enabled by default; to disable set to 0 +event.transform.flag=0 + +# Describes at what frequency (measured in minutes) should application try to fetch config from CBS +collector.dynamic.config.update.frequency=5 diff --git a/csit/scripts/sdnr/docker-compose/vesc/ves-dmaap-config.json b/csit/scripts/sdnr/docker-compose/vesc/ves-dmaap-config.json new file mode 100644 index 00000000..c928ee55 --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/vesc/ves-dmaap-config.json @@ -0,0 +1,42 @@ +{ + "ves-pnfRegistration": { + "dmaap_info": {"topic_url": "http://onap-dmaap:3904/events/unauthenticated.VES_PNFREG_OUTPUT"}, + "type": "message_router" + }, + "ves-3gpp-fault-supervision": { + "dmaap_info": {"topic_url": "http://onap-dmaap:3904/events/unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT"}, + "type": "message_router" + }, + "ves-notification": { + "dmaap_info": {"topic_url": "http://onap-dmaap:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT"}, + "type": "message_router" + }, + "ves-3gpp-heartbeat": { + "dmaap_info": {"topic_url": "http://onap-dmaap:3904/events/unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT"}, + "type": "message_router" + }, + "ves-3gpp-performance-assurance": { + "dmaap_info": {"topic_url": "http://onap-dmaap:3904/events/unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT"}, + "type": "message_router" + }, + "ves-3gpp-provisioning": { + "dmaap_info": {"topic_url": "http://onap-dmaap:3904/events/unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT"}, + "type": "message_router" + }, + "ves-fault": { + "dmaap_info": {"topic_url": "http://onap-dmaap:3904/events/unauthenticated.SEC_FAULT_OUTPUT"}, + "type": "message_router" + }, + "ves-heartbeat": { + "dmaap_info": {"topic_url": "http://onap-dmaap:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT"}, + "type": "message_router" + }, + "ves-other": { + "dmaap_info": {"topic_url": "http://onap-dmaap:3904/events/unauthenticated.SEC_OTHER_OUTPUT"}, + "type": "message_router" + }, + "ves-measurement": { + "dmaap_info": {"topic_url": "http://onap-dmaap:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT"}, + "type": "message_router" + } +} diff --git a/csit/scripts/sdnr/docker-compose/wait-for-sdnc.sh b/csit/scripts/sdnr/docker-compose/wait-for-sdnc.sh new file mode 100755 index 00000000..26302622 --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/wait-for-sdnc.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# wait-for-sdnc.sh +# ******************************************************************************* +# * ============LICENSE_START======================================================================== +# * Copyright (C) 2023 highstreet technologies GmbH 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========================================================================== +set -e + +url="$1" +shift +cmd="$@" + +while [ "$(curl -s -o /dev/null -w ''%{http_code}'' $url)" != "200" ]; do + >&2 echo "sdnc is not ready - sleeping" + sleep 1 +done + +>&2 echo "sdnc is up - executing command" +exec $cmd + diff --git a/csit/scripts/sdnr/docker-compose/zk/zk_server_jaas.conf b/csit/scripts/sdnr/docker-compose/zk/zk_server_jaas.conf new file mode 100644 index 00000000..26bf4601 --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/zk/zk_server_jaas.conf @@ -0,0 +1,4 @@ +Server { + org.apache.zookeeper.server.auth.DigestLoginModule required + user_kafka=kafka_secret; +}; \ No newline at end of file diff --git a/csit/scripts/sdnr/sdnr-launch.sh b/csit/scripts/sdnr/sdnr-launch.sh new file mode 100755 index 00000000..acc15dee --- /dev/null +++ b/csit/scripts/sdnr/sdnr-launch.sh @@ -0,0 +1,155 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# ONAP : ccsdk feature sdnr wt +# ================================================================================ +# Copyright (C) 2021 highstreet technologies GmbH 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========================================================= +# +docker version +docker-compose version +# update installed docker compose version +sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +sudo chmod +x /usr/local/bin/docker-compose +sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose +which docker-compose +docker version +docker-compose version + +if [[ -z $WORKSPACE ]]; then + CUR_PATH="`dirname \"$0\"`" # relative path + CUR_PATH="`( cd \"$CUR_PATH\" && pwd )`" # absolutized and normalized + if [ -z "$CUR_PATH" ] ; then + echo "Permission error!" + exit 1 + fi + + # define location of workpsace based on where the current script is + WORKSPACE=$(cd $CUR_PATH/../../ && pwd) +fi + +if [[ -z $SCRIPTS ]]; then + SCRIPTS=$(cd $WORKSPACE/scripts && pwd) +fi + +HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $7}') +SDNC_WEB_PORT=${SDNC_WEB_PORT:-8282} +SDNC_PORT=${SDNC_PORT:-8181} + +env_file="--env-file ${SCRIPTS}/sdnr/docker-compose/.env" +echo $env_file + +# Define sdnrdb type +# default: ESDB +# alternative: MARIADB +SDNRDB_TYPE="${SDNRDB_TYPE:-MARIADB}" +if [[ "$SDNRDB_TYPE" == "ESDB" ]]; then + sdnrdb_compose_file="docker-compose-sdnrdb-elasticsearch.yaml" +else + sdnrdb_compose_file="docker-compose-sdnrdb-mariadb.yaml" +fi +docker ps -a + +# Call function with port like: +# check_for_ready_state 1234 +# export SDNC_READY_RETRY_PERIOD and SDNC_READY_TIMEOUT to overwrite default values +function check_for_ready_state() { + sdnc_port=${1} + SDNC_READY_RETRY_PERIOD=${SDNC_READY_RETRY_PERIOD:-15} + SDNC_READY_TIMEOUT=${SDNC_READY_TIMEOUT:-450} + max_retry=$(expr $SDNC_READY_TIMEOUT / $SDNC_READY_RETRY_PERIOD) + for ((i=1; i<=$max_retry; i++)); do + wait_time=$(expr $i \* $SDNC_READY_RETRY_PERIOD) + echo "[INFO] SDNC/R container not yet ready after: $wait_time seconds, Timeout: $SDNC_READY_TIMEOUT seconds" + curl -sS -m 1 -k -D - ${HTTPS_PREFIX}${HOST_IP}:${sdnc_port}/ready | grep 200 && break + if [ $i == $max_retry ]; then + echo "[ERROR] SDNC/R container not ready after ${SDNC_READY_TIMEOUT} seconds!" + export SDNC_READY_STATE_TIME_OUT=true + return + fi + echo sleep ${SDNC_READY_RETRY_PERIOD} + sleep ${SDNC_READY_RETRY_PERIOD} + done + echo "[INFO] SDNC/R container ready after: $wait_time seconds" +} + +function onap_dependent_components_launch() { + docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-onap-addons.yaml pull + docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-onap-addons.yaml up -d +} +function netconfserver_simulator_launch() { + docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-netconfserver-simulator.yaml pull + docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-netconfserver-simulator.yaml up -d +} + +function nts_manager_launch() { + # starts all ntsim managers defined in the csv file + ${SCRIPTS}/sdnr/docker-compose/nts-manager-launch.sh $1 +} + +function nts_networkfunctions_launch() { + # starts all ntsim networkfucntions defined in the csv file + ${SCRIPTS}/sdnr/docker-compose/nts-networkfunctions-launch.sh $1 +} + + +function sdnr_launch() { + #if [ -n "${CALLHOME}" ] ; then + #sdnrwtbootfeatures="-e SDNRWT_BOOTFEATURES=odl-netconf-callhome-ssh,sdnr-wt-feature-aggregator " + #callhomeport="-p ${CALL_HOME_PORT}:6666 " + #fi + if [ "$SDNR_CLUSTER_MODE" == "true" ]; then + sdnr_launch_cluster $1 + else + sdnr_launch_single_node $1 + fi +} + + +function sdnr_launch_single_node() { + + # Use locally build sdnr .. no need to pull + #docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-single-sdnr.yaml \ + # -f ${WORKSPACE}/scripts/sdnr/docker-compose/$sdnrdb_compose_file \ + # pull + docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-single-sdnr.yaml \ + -f ${WORKSPACE}/scripts/sdnr/docker-compose/$sdnrdb_compose_file \ + up -d + check_for_ready_state ${SDNC_PORT} +} + +function sdnr_web_launch() { + # Use locally build sdnr, sdnc-web .. no need to pull + #docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-single-sdnr.yaml \ + # -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-single-sdnr-web.override.yaml \ + # -f ${WORKSPACE}/scripts/sdnr/docker-compose/$sdnrdb_compose_file \ + # pull + docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-single-sdnr.yaml \ + -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-single-sdnr-web.override.yaml \ + -f ${WORKSPACE}/scripts/sdnr/docker-compose/$sdnrdb_compose_file \ + up -d + check_for_ready_state ${SDNC_WEB_PORT} +} + +function sdnr_launch_cluster() { + # source ${SCRIPTS}/sdnr/sdnrEnv_Cluster.sh + SDNRDM="false" + [[ -n "$1" ]] && SDNRDM="true" && echo "SDNRDM arg detected - running in headless mode" + echo "SDNR being launched in Cluster mode" + #docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose/cluster-sdnr.yaml pull + docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose/cluster-sdnr.yaml up -d + check_for_ready_state ${SDNC_WEB_PORT} +} diff --git a/csit/scripts/sdnr/sdnr-teardown.sh b/csit/scripts/sdnr/sdnr-teardown.sh new file mode 100755 index 00000000..f01ab338 --- /dev/null +++ b/csit/scripts/sdnr/sdnr-teardown.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# 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. +# +# Modifications copyright (c) 2018 AT&T Intellectual Property +# Modifications copyright (C) 2022 highstreet technologies GmbH Intellectual Property +# + +if [[ -z $WORKSPACE ]]; then + CUR_PATH="`dirname \"$0\"`" # relative path + CUR_PATH="`( cd \"$CUR_PATH\" && pwd )`" # absolutized and normalized + if [ -z "$CUR_PATH" ] ; then + echo "Permission error!" + exit 1 + fi + + # define location of workpsace based on where the current script is + WORKSPACE=$(cd $CUR_PATH/../../ && pwd) +fi + +if [[ -z $SCRIPTS ]]; then + SCRIPTS=$(cd $WORKSPACE/scripts && pwd) +fi + +source ${SCRIPTS}/sdnr/sdnrEnv_Common.sh +env_file="--env-file ${SCRIPTS}/sdnr/docker-compose/.env" + +function sdnr_teardown() { + running_containers=$(docker ps -a --format "{{.Names}}") + if [ -z "$running_containers" ] + then + echo "No containers to get logs from!" + else + echo "Getting logs from containers!" + running_containers_array=($(echo "$running_containers" | tr ' ' '\n')) + mkdir -p ${WORKSPACE}/archives/getallinfo + for i in "${running_containers_array[@]}" + do + echo "Getting logs from container $i" + docker logs $i >> ${WORKSPACE}/archives/getallinfo/$i.log 2>&1 + done + docker cp sdnr:/opt/opendaylight/data/log/karaf.log ${WORKSPACE}/archives/getallinfo/sdnr_karaf.log + docker cp sdnr:/opt/opendaylight/data/log/installCerts.log ${WORKSPACE}/archives/getallinfo/sdnr_installCerts.log + docker cp sdnr:/opt/opendaylight/etc/custom.properties ${WORKSPACE}/archives/getallinfo/sdnr_custom_properties.log + fi + echo "Starting teardown!" + # removes sdnrdb, sdnr AND all of the rest of the containers (--remove-orphans) + docker rm -f $(docker ps -aq -f name=ntsim*) + docker rm -f $(docker ps -aq -f name=nts-*) + docker rm -f $(docker ps -aq -f name=NTS_Manager*) + docker rm -f $(docker ps -aq -f name=NTS-Manager*) + docker-compose $env_file -f ${WORKSPACE}/scripts/sdnr/docker-compose/docker-compose-single-sdnr.yaml down --remove-orphans + docker network rm integration +} diff --git a/csit/sdnc-csit-robot.env b/csit/sdnc-csit-robot.env new file mode 100755 index 00000000..32ea0558 --- /dev/null +++ b/csit/sdnc-csit-robot.env @@ -0,0 +1,5 @@ +WORKSPACE +ODL_PASSWORD +ODL_USER +REQUEST_DATA_PATH +SDNC_CONTAINER_NAME diff --git a/csit/sdnc-csit.env b/csit/sdnc-csit.env new file mode 100755 index 00000000..cd271f21 --- /dev/null +++ b/csit/sdnc-csit.env @@ -0,0 +1,37 @@ +export SDNC_CONTAINER_NAME=sdnc_controller +export DB_CONTAINER_NAME=mariadb +export SDNC_CERT_PATH=${WORKSPACE}/archives/certs +export NETCONF_PNP_SIM_CONTAINER_NAME=netconf-simulator +export TEMP_DIR_PATH=${WORKSPACE}/tests/netconf_tls_post_deploy/tmp +export REQUEST_DATA_PATH=${WORKSPACE}/config + +export GERRIT_BRANCH=${GERRIT_BRANCH:-master} +export NEXUS_USERNAME=${NEXUS_USERNAME:-docker} +export NEXUS_PASSWD=${NEXUS_PASSWD:-docker} +export NEXUS_DOCKER_REPO=${NEXUS_DOCKER_REPO:-nexus3.onap.org:10001} +export MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-itsASecret} +export MYSQL_USER=${MYSQL_USER:-sdnctl} +export MYSQL_PASSWORD=${MYSQL_PASSWORD:-gamma} +export MYSQL_DATABASE=${MYSQL_DATABASE:-sdnctl} +export ODL_USER=${ODL_USER:-admin} +# export ODL_PASSWORD=${ODL_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} +export ODL_PASSWORD=${ODL_PASSWORD:-admin} +export HONEYCOMB_USER=${HONEYCOMB_USER:-admin} +export HONEYCOMB_PASSWORD=${HONEYCOMB_PASSWORD:-admin} +export TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD:-changeit} +export KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD:-adminadmin} +export SO_USER=${SO_USER:-sdncaBpmn} +export SO_PASSWORD=${SO_PASSWORD:-password1$} +export NENG_USER=${NENG_USER:-ccsdkapps} +export NENG_PASSWORD=${NENG_PASSWORD:-ccsdkapps} +export SQL_CRYPTKEY=${SQL_CRYPTKEY:-crYptKeY} +export DMAAP_TOPIC=AUTO + + +export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) +if [ "$MTU" == "" ]; then + export MTU="1450" +fi +# Define ROBOT_IMAGE to run robot testcases within this container +# skips all robotframework related local python installation +export ROBOT_IMAGE=${ROBOT_IMAGE:-nexus3.onap.org:10001/onap/testsuite:1.12.1} diff --git a/csit/tests/sdnc/__init__.robot b/csit/tests/sdnc/__init__.robot new file mode 100644 index 00000000..d7353060 --- /dev/null +++ b/csit/tests/sdnc/__init__.robot @@ -0,0 +1,2 @@ +1 *** Settings *** +2 Documentation SDNC - keystorecheck diff --git a/csit/tests/sdnc/csr/netconf_pnp_simulator_csr.env b/csit/tests/sdnc/csr/netconf_pnp_simulator_csr.env new file mode 100644 index 00000000..e85ab6cc --- /dev/null +++ b/csit/tests/sdnc/csr/netconf_pnp_simulator_csr.env @@ -0,0 +1,17 @@ +#Client Envs +REQUEST_TIMEOUT=30000 +OUTPUT_PATH=/var/certs +CA_NAME=RA +OUTPUT_TYPE=P12 +KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks +KEYSTORE_PASSWORD=secret +TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks +TRUSTSTORE_PASSWORD=secret +#CSR Config Envs +COMMON_NAME=netconf.pnp.simulator.onap.org +ORGANIZATION=Linux-Foundation +ORGANIZATION_UNIT=ONAP +LOCATION=San-Francisco +STATE=California +COUNTRY=US +SANS=netconf.com:netconfsimulator.com diff --git a/csit/tests/sdnc/csr/sdnc_csr.env b/csit/tests/sdnc/csr/sdnc_csr.env new file mode 100644 index 00000000..5d647de6 --- /dev/null +++ b/csit/tests/sdnc/csr/sdnc_csr.env @@ -0,0 +1,17 @@ +#Client CSR +REQUEST_TIMEOUT=30000 +OUTPUT_PATH=/var/certs +CA_NAME=RA +OUTPUT_TYPE=PEM +KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks +KEYSTORE_PASSWORD=secret +TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks +TRUSTSTORE_PASSWORD=secret +#CSR Config Envs +COMMON_NAME=sdnc.onap.org +ORGANIZATION=Linux-Foundation +ORGANIZATION_UNIT=ONAP +LOCATION=San-Francisco +STATE=California +COUNTRY=US +SANS=example.com:sample.com \ No newline at end of file diff --git a/csit/tests/sdnc/resources/grafiles/network-topology-assign.json b/csit/tests/sdnc/resources/grafiles/network-topology-assign.json new file mode 100644 index 00000000..ea1c2789 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/network-topology-assign.json @@ -0,0 +1,43 @@ +{ + "input": { + "network-information": { + "onap-model-information": { + "model-name": "VcpesvcVbng0412a.bng_mux", + "model-version": "1.0", + "model-customization-uuid": "b0cf3385-a390-488c-b6a0-d879fb4a4825", + "model-uuid": "9b7c1cbe-ddcd-458c-8792-d76391419b72", + "model-invariant-uuid": "206d5e6c-4cba-4c14-b942-5d946c881869" + }, + "network-id": "2e723205-7f96-49a9-bd60-24168fbd9f07" + }, + "network-request-input": { + "aic-cloud-region": "wnv1a", + "cloud-owner": "att-nc", + "tenant": "1795554216e946af8a3c788f195eb813", + "network-name": "vUSP-23804-T-01-wnv1a_int_csdb_net_1" + }, + "request-information": { + "request-action": "CreateNetworkInstance", + "source": "simulator", + "request-id": "testnet1" + }, + "sdnc-request-header": { + "svc-request-id": "svc-testnet1", + "svc-action": "assign" + }, + "service-information": { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/network-topology-unassign.json b/csit/tests/sdnc/resources/grafiles/network-topology-unassign.json new file mode 100644 index 00000000..8617d706 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/network-topology-unassign.json @@ -0,0 +1,46 @@ + +{ + "input": { + "network-information": { + "onap-model-information": { + "model-name": "VcpesvcVbng0412a.bng_mux", + "model-version": "1.0", + "model-customization-uuid": "b0cf3385-a390-488c-b6a0-d879fb4a4825", + "model-uuid": "9b7c1cbe-ddcd-458c-8792-d76391419b72", + "model-invariant-uuid": "206d5e6c-4cba-4c14-b942-5d946c881869" + }, + "network-technology": "", + "network-id": "2e723205-7f96-49a9-bd60-24168fbd9f07", + "network-type": "" + }, + "network-request-input": { + "aic-cloud-region": "wnv1a", + "cloud-owner": "att-nc", + "tenant": "1795554216e946af8a3c788f195eb813", + "network-name": "vUSP-23804-T-01-wnv1a_int_ccfx_net_1" + }, + "request-information": { + "request-action": "DeleteNetworkInstance", + "source": "simulator", + "request-id": "testnet1" + }, + "sdnc-request-header": { + "svc-request-id": "svc-testnet1", + "svc-action": "unassign" + }, + "service-information": { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/preload-network.json b/csit/tests/sdnc/resources/grafiles/preload-network.json new file mode 100644 index 00000000..3819672d --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/preload-network.json @@ -0,0 +1,91 @@ +{ + "input": { + "preload-network-topology-information": { + "host-routes": [ + { + "next-hop": "10.1.12.1", + "route-prefix": "12" + } + ], + "is-external-network": true, + "is-provider-network": true, + "is-shared-network": true, + "network-policy": [ + { + "network-policy-fqdn": "policy-sdnc.onap.org", + "network-policy-id": "123" + } + ], + "network-topology-identifier-structure": { + "eipam-v4-address-plan": "plan9", + "eipam-v6-address-plan": "plan9v6", + "is-trunked": true, + "network-id": "vUSP-23804-T-01-wnv1a_int_csdb_net_1", + "network-instance-group-id": "abc123", + "network-name": "vUSP-23804-T-01-wnv1a_int_csdb_net_1", + "network-role": "secret", + "network-technology": "soupcan", + "network-type": "fake", + "related-networks": { + "related-network": [ + { + "network-id": "skynet", + "network-role": "master", + "vlan-tags": { + "is-private": true, + "lower-tag-id": 0, + "upper-tag-id": 0, + "vlan-interface": "le0" + } + } + ] + }, + "segmentation-id": "seg1" + }, + "physical-network-name": "skynet", + "route-table-reference": [ + { + "route-table-reference-fqdn": "sky.net", + "route-table-reference-id": "ref1" + } + ], + "subnets": [ + { + "addr-from-start": "Y", + "cidr-mask": "255.255.0.0", + "dhcp-enabled": "Y", + "dhcp-end-address": "10.1.2.254", + "dhcp-start-address": "10.1.2.1", + "gateway-address": "10.1.2.255", + "ip-version": "ipv4", + "start-address": "10.1.2.1", + "subnet-name": "subnet1", + "subnet-role": "puppies", + "subnet-sequence": 0 + } + ], + "vpn-bindings": [ + { + "aic-zone": "zone1", + "global-route-target": "string", + "route-target-role": "string", + "vpn-binding-id": "string", + "vpn-name": "string" + } + ] + }, + "request-information": { + "notification-url": "http://dev.null.com", + "order-number": "123456", + "order-version": "2010.06", + "request-action": "CreateNetworkInstance", + "request-id": "REQ123456", + "source": "curl" + }, + "sdnc-request-header": { + "svc-action": "reserve", + "svc-notification-url": "http://dev.null.com", + "svc-request-id": "SVCREQ123456" + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/preload-vf-module.json b/csit/tests/sdnc/resources/grafiles/preload-vf-module.json new file mode 100644 index 00000000..ab67f254 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/preload-vf-module.json @@ -0,0 +1,375 @@ +{ + "input": { + "preload-vf-module-topology-information": { + "vf-module-topology": { + "aic-clli": "AIC12345", + "aic-cloud-region": "rdm61a", + "cloud-owner": "att-nc", + "onap-model-information": { + "model-customization-uuid": "123123123", + "model-invariant-uuid": "123123123", + "model-name": "frankfurt", + "model-uuid": "121212", + "model-version": "frankfurt" + }, + "sdnc-generated-cloud-resources": true, + "tenant": "tenant", + "vf-module-assignments": { + "dhcp-subnet-assignments": { + "dhcp-subnet-assignment": [ + { + "ip-version": "ipv4", + "network-role": "secret", + "neutron-subnet-id": "sub1" + } + ] + }, + "vf-module-status": "Active", + "vlan-vnfc-instance-groups": { + "vlan-vnfc-instance-group": [ + { + "instance-group-function": "function", + "instance-group-id": "groupid", + "vnf-id": "123", + "vnfcs": { + "vnfc": [ + { + "vnfc-name": "vnc1", + "vnic-groups": { + "vnic-group": [ + { + "network-instance-group-function": "func1", + "vlan-assignment-policy-name": "policy1", + "vlan-common-ip-addresses": { + "ip-addresses": { + "ipv4-address": "10.1.2.1" + } + }, + "vlan-tag-index-next": 0, + "vlan-vnics": { + "vlan-vnic": [ + { + "vnic-port-id": "8080", + "vnic-sub-interfaces": { + "sub-interface-network-data": [ + { + "floating-ips": { + "floating-ip-v4": [ + "10.1.2.1" + ] + }, + "network-id": "string", + "network-information-items": { + "network-information-item": [ + { + "ip-count": 0, + "ip-version": "ipv4", + "network-ips": { + "network-ip": [ + "10.1.2.2" + ] + }, + "use-dhcp": "Y" + } + ] + }, + "network-name": 0, + "network-role": "secret", + "network-role-tag": "tag1", + "neutron-network-id": "net1", + "vlan-tag-id": 0 + } + ] + } + } + ] + }, + "vnic-interface-role": "vnicrole1" + } + ] + } + } + ] + } + } + ] + }, + "vms": { + "vm": [ + { + "nfc-naming-code": "name1", + "onap-model-information": { + "model-customization-uuid": "456456456", + "model-invariant-uuid": "456456456", + "model-name": "model2", + "model-uuid": "678678678", + "model-version": "version2" + }, + "vm-count": 0, + "vm-names": { + "vm-name": [ + "vm1" + ], + "vnfc-names": [ + { + "vnfc-name": "vnc1", + "vnfc-networks": { + "vnfc-network-data": [ + { + "connection-point": { + "connection-point-id": "conn1", + "port-id": "8181", + "vlan-data": [ + { + "vlan-role": "role2", + "vlan-tag-description": "tag2", + "vlan-tag-id": "1", + "vlan-uuid": "78789789" + } + ] + }, + "vnfc-network-role": "role3", + "vnfc-ports": { + "vnfc-port": [ + { + "common-sub-interface-role": "subrole1", + "vnfc-port-id": "8787", + "vnic-sub-interfaces": { + "sub-interface-network-data": [ + { + "floating-ips": { + "floating-ip-v4": [ + "10.1.3.10" + ] + }, + "network-id": "net2", + "network-information-items": { + "network-information-item": [ + { + "ip-count": 0, + "ip-version": "ipv4", + "network-ips": { + "network-ip": [ + "10.1.3.4" + ] + }, + "use-dhcp": "Y" + } + ] + }, + "network-name": 0, + "network-role": "secret", + "network-role-tag": "tag5", + "neutron-network-id": "nnet5", + "vlan-tag-id": 0 + } + ] + } + } + ] + }, + "vnfc-subnet": [ + { + "vnfc-ip-assignments": [ + { + "vnfc-address-family": "ipv4", + "vnfc-subnet-dhcp": "Y", + "vnfc-subnet-ip": [ + { + "ip-type": "FIXED", + "vnfc-client-key": "string", + "vnfc-ip-address": "10.1.7.1" + } + ], + "vnfc-subnet-ip-count": 0 + } + ], + "vnfc-subnet-role": "string" + } + ], + "vnfc-type": "string" + } + ] + } + } + ] + }, + "vm-networks": { + "vm-network": [ + { + "floating-ips": { + "floating-ip-v4": [ + "10.1.9.1" + ] + }, + "interface-route-prefixes": { + "interface-route-prefix": [ + "10" + ] + }, + "is-trunked": true, + "mac-addresses": { + "mac-address": [ + "cafe:beef" + ] + }, + "network-information-items": { + "network-information-item": [ + { + "ip-count": 0, + "ip-version": "ipv4", + "network-ips": { + "network-ip": [ + "10.2.3.10" + ] + }, + "use-dhcp": "Y" + } + ] + }, + "network-role": "secret", + "network-role-tag": "tag9", + "related-networks": { + "related-network": [ + { + "network-id": "net9", + "network-role": "secret", + "vlan-tags": { + "is-private": true, + "lower-tag-id": 0, + "upper-tag-id": 0, + "vlan-interface": "vlan0" + } + } + ] + }, + "segmentation-id": "seg1", + "sriov-parameters": { + "application-tags": { + "c-tags": { + "c-tag": [ + "ctag1" + ] + }, + "s-tags": { + "s-tag": [ + "stag1" + ] + } + }, + "heat-vlan-filters": { + "heat-vlan-filter": [ + "10" + ] + } + } + } + ] + }, + "vm-type": "vgmux", + "vm-type-tag": "vgmux" + } + ] + } + }, + "vf-module-parameters": { + "param": [ + { + "name": "vfmodname", + "resource-resolution-data": { + "capability-name": "cap1", + "payload": "payload1", + "resource-key": [ + { + "name": "key1", + "value": "value1" + } + ], + "status": "active" + }, + "value": "value1" + } + ] + }, + "vf-module-topology-identifier": { + "vf-module-id": "vfmodule1", + "vf-module-name": "vfmodule1", + "vf-module-type": "router" + } + }, + "vnf-resource-assignments": { + "availability-zones": { + "availability-zone": [ + "zone1" + ], + "max-count": 0 + }, + "vnf-networks": { + "vnf-network": [ + { + "contrail-network-fqdn": "skynet.net", + "is-trunked": true, + "network-id": "net1", + "network-name": "net1", + "network-role": "secret", + "neutron-id": "neutron1", + "related-networks": { + "related-network": [ + { + "network-id": "net2", + "network-role": "secret", + "vlan-tags": { + "is-private": true, + "lower-tag-id": 0, + "upper-tag-id": 0, + "vlan-interface": "vlan2" + } + } + ] + }, + "segmentation-id": "seg2", + "subnets-data": { + "subnet-data": [ + { + "cidr-mask": "255.255", + "dhcp-enabled": "Y", + "gateway-address": "10.1.2.254", + "ip-version": "ipv4", + "network-start-address": "10.1.2.1", + "sdnc-subnet-id": "sub1", + "subnet-id": "sub1", + "subnet-name": "sub1", + "subnet-role": "subrole1" + } + ] + } + } + ] + }, + "vnf-status": "active" + }, + "vnf-topology-identifier-structure": { + "nf-code": "code1", + "nf-function": "function1", + "nf-role": "role1", + "nf-type": "type1", + "vnf-id": "preload1", + "vnf-name": "vnf1", + "vnf-type": "vnftype1" + } + }, + "request-information": { + "notification-url": "http://dev.null", + "order-number": "order123", + "order-version": "1", + "request-action": "CreateNetworkInstance", + "request-id": "req001", + "source": "curl" + }, + "sdnc-request-header": { + "svc-action": "reserve", + "svc-notification-url": "http://dev.null", + "svc-request-id": "svcreq001" + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/svc-topology-assign.json b/csit/tests/sdnc/resources/grafiles/svc-topology-assign.json new file mode 100644 index 00000000..9fe16ca0 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/svc-topology-assign.json @@ -0,0 +1,34 @@ +{ + "input": { + "request-information": { + "notification-url": "http://dev.null", + "order-number": "123", + "order-version": "version1", + "request-action": "CreateServiceInstance", + "request-id": "testsvc1", + "source": "simulator" + }, + "sdnc-request-header": { + "svc-action": "assign", + "svc-notification-url": "http://dev.null", + "svc-request-id": "svc-testsvc1" + }, + "service-information": { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "service-request-input": { + "service-instance-name": "zrdm61asmsf01_svc" + } + } + } diff --git a/csit/tests/sdnc/resources/grafiles/svc-topology-delete.json b/csit/tests/sdnc/resources/grafiles/svc-topology-delete.json new file mode 100644 index 00000000..4663eea4 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/svc-topology-delete.json @@ -0,0 +1,34 @@ +{ + "input": { + "request-information": { + "notification-url": "http://dev.null", + "order-number": "123", + "order-version": "version1", + "request-action": "DeleteServiceInstance", + "request-id": "testsvc1", + "source": "simulator" + }, + "sdnc-request-header": { + "svc-action": "delete", + "svc-notification-url": "http://dev.null", + "svc-request-id": "svc-testsvc1" + }, + "service-information": { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vcpesvc_vbng_0412a", + "model-uuid": "12eb33fa-b221-4d87-939c-d808b5799a7c", + "model-version": "1933" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "service-request-input": { + "service-instance-name": "zrdm61asmsf01_svc" + } + } + } diff --git a/csit/tests/sdnc/resources/grafiles/vf-module-topology-assign.json b/csit/tests/sdnc/resources/grafiles/vf-module-topology-assign.json new file mode 100644 index 00000000..8e2c7af4 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/vf-module-topology-assign.json @@ -0,0 +1,58 @@ +{ + "input":{ + "request-information" : { + "request-action" : "CreateVfModuleInstance", + "source" : "simulator", + "request-id" : "testvfmodule1" + }, + "sdnc-request-header" : { + "svc-request-id" : "svc-testvfmodule1", + "svc-action" : "assign" + }, + "service-information" : { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "vnf-information" : { + "onap-model-information" : { + "model-name" : "vcpevsp_vgmux_0412 ", + "model-version" : "1.0", + "model-customization-uuid" : "5724fcc8-2ae2-45ce-8d44-795092b85dee", + "model-uuid" : "ba3b8981-9a9c-4945-92aa-486234ec321f", + "model-invariant-uuid" : "b3dc6465-942c-42af-8464-2bf85b6e504b" + }, + "vnf-id" : "afb0dae3-85f0-4804-89a8-063204e61c1c", + "vnf-name" : "zrdm61asmsf01", + "vnf-type" : "SMSF-NC2-578-SVC/SMSF-NC2-578" + }, + "vf-module-information" : { + "onap-model-information" : { + "model-name" : "SmsfNc2578..smsf_base..module-0", + "model-version" : "3", + "model-customization-uuid" : "59ffe5ba-cfaf-4e83-a2f3-159522dcebac", + "model-uuid" : "513cc9fc-fff5-4c46-9728-393437536c4d", + "model-invariant-uuid" : "7ca7567c-f42c-4ed8-bcde-f8971b92d90a" + }, + "vf-module-id" : "45841173-3729-4a1d-a811-a3bde399e22d", + "from-preload" : true, + "vf-module-type" : "SmsfNc2578..smsf_base..module-0" + }, + "vf-module-request-input" : { + "aic-cloud-region" : "rdm61a", + "cloud-owner" : "att-nc", + "tenant" : "4714fe06cc24414c914c51ca0aa1bf84", + "vf-module-name" : "vfmodule1", + "vf-module-input-parameters" : { } + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/vf-module-topology-unassign.json b/csit/tests/sdnc/resources/grafiles/vf-module-topology-unassign.json new file mode 100644 index 00000000..3825f26d --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/vf-module-topology-unassign.json @@ -0,0 +1,58 @@ +{ + "input":{ + "request-information" : { + "request-action" : "DeleteVfModuleInstance", + "source" : "simulator", + "request-id" : "testvfmodule1" + }, + "sdnc-request-header" : { + "svc-request-id" : "svc-testvfmodule1", + "svc-action" : "unassign" + }, + "service-information" : { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "vnf-information" : { + "onap-model-information" : { + "model-name" : "vcpevsp_vgmux_0412 ", + "model-version" : "1.0", + "model-customization-uuid" : "5724fcc8-2ae2-45ce-8d44-795092b85dee", + "model-uuid" : "ba3b8981-9a9c-4945-92aa-486234ec321f", + "model-invariant-uuid" : "b3dc6465-942c-42af-8464-2bf85b6e504b" + }, + "vnf-id" : "afb0dae3-85f0-4804-89a8-063204e61c1c", + "vnf-name" : "zrdm61asmsf01", + "vnf-type" : "SMSF-NC2-578-SVC/SMSF-NC2-578" + }, + "vf-module-information" : { + "onap-model-information" : { + "model-name" : "SmsfNc2578..smsf_base..module-0", + "model-version" : "3", + "model-customization-uuid" : "59ffe5ba-cfaf-4e83-a2f3-159522dcebac", + "model-uuid" : "513cc9fc-fff5-4c46-9728-393437536c4d", + "model-invariant-uuid" : "7ca7567c-f42c-4ed8-bcde-f8971b92d90a" + }, + "vf-module-id" : "45841173-3729-4a1d-a811-a3bde399e22d", + "from-preload" : true, + "vf-module-type" : "SmsfNc2578..smsf_base..module-0" + }, + "vf-module-request-input" : { + "aic-cloud-region" : "rdm61a", + "cloud-owner" : "att-nc", + "tenant" : "4714fe06cc24414c914c51ca0aa1bf84", + "vf-module-name" : "vfmodule1", + "vf-module-input-parameters" : { } + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/vnf-topology-assign.json b/csit/tests/sdnc/resources/grafiles/vnf-topology-assign.json new file mode 100644 index 00000000..33d8c60e --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/vnf-topology-assign.json @@ -0,0 +1,47 @@ +{ + "input":{ + "request-information" : { + "request-action" : "CreateVnfInstance", + "source" : "simulator", + "request-id" : "testvnf1" + }, + "sdnc-request-header" : { + "svc-request-id" : "svc-testvnf1", + "svc-action" : "assign" + }, + "service-information" : { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "vnf-information" : { + "onap-model-information" : { + "model-name" : "vcpevsp_vgmux_0412 ", + "model-version" : "1.0", + "model-customization-uuid" : "5724fcc8-2ae2-45ce-8d44-795092b85dee", + "model-uuid" : "ba3b8981-9a9c-4945-92aa-486234ec321f", + "model-invariant-uuid" : "b3dc6465-942c-42af-8464-2bf85b6e504b" + }, + "vnf-id" : "afb0dae3-85f0-4804-89a8-063204e61c1c", + "vnf-name" : "zrdm61asmsf01", + "vnf-type" : "SMSF-NC2-578-SVC/SMSF-NC2-578" + }, + "vnf-request-input" : { + "aic-cloud-region" : "rdm61a", + "cloud-owner" : "att-nc", + "tenant" : "4714fe06cc24414c914c51ca0aa1bf84", + "vnf-network-instance-group-ids" : [ ], + "vnf-input-parameters" : { }, + "vnf-name" : "zrdm61asmsf01" + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/vnf-topology-unassign.json b/csit/tests/sdnc/resources/grafiles/vnf-topology-unassign.json new file mode 100644 index 00000000..1e3f348b --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/vnf-topology-unassign.json @@ -0,0 +1,48 @@ + +{ + "input":{ + "request-information" : { + "request-action" : "DeleteVnfInstance", + "source" : "simulator", + "request-id" : "testvnf1" + }, + "sdnc-request-header" : { + "svc-request-id" : "svc-testvnf1", + "svc-action" : "unassign" + }, + "service-information" : { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "vnf-information" : { + "onap-model-information" : { + "model-name" : "vcpevsp_vgmux_0412 ", + "model-version" : "1.0", + "model-customization-uuid" : "5724fcc8-2ae2-45ce-8d44-795092b85dee", + "model-uuid" : "ba3b8981-9a9c-4945-92aa-486234ec321f", + "model-invariant-uuid" : "b3dc6465-942c-42af-8464-2bf85b6e504b" + }, + "vnf-id" : "afb0dae3-85f0-4804-89a8-063204e61c1c", + "vnf-name" : "zrdm61asmsf01", + "vnf-type" : "SMSF-NC2-578-SVC/SMSF-NC2-578" + }, + "vnf-request-input" : { + "aic-cloud-region" : "rdm61a", + "cloud-owner" : "att-nc", + "tenant" : "4714fe06cc24414c914c51ca0aa1bf84", + "vnf-network-instance-group-ids" : [ ], + "vnf-input-parameters" : { }, + "vnf-name" : "zrdm61asmsf01" + } + } +} diff --git a/csit/tests/sdnc/resources/sdnc-keywords.robot b/csit/tests/sdnc/resources/sdnc-keywords.robot new file mode 100644 index 00000000..4c4750db --- /dev/null +++ b/csit/tests/sdnc/resources/sdnc-keywords.robot @@ -0,0 +1,64 @@ +*** Settings *** + +Resource ./sdnc-properties.robot + +Library Collections +Library RequestsLibrary +Library OperatingSystem +# Library HttpLibrary.HTTP + + +*** Keywords *** + +Create SDNC RESTCONF Session + [Documentation] Create session to OpenDaylight controller + ${auth}= Create List ${ODL_USER} ${ODL_PASSWORD} + Create Session sdnc_restconf ${SDNC_RESTCONF_URL} auth=${auth} + +Send Post File And Validate Response + [Documentation] POST file contents to OpenDaylight controller + [Arguments] ${url} ${path} ${resp_code} + Create SDNC RESTCONF Session + ${body}= Get File ${path} + &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json + ${resp}= POST On Session sdnc_restconf ${url} headers=${headers} data=${body} expected_status=${resp_code} + + +Send Empty Post Request And Validate Response + [Documentation] POST with no content to OpenDaylight controller + [Arguments] ${url} ${resp_code} + Create SDNC RESTCONF Session + &{headers}= Create Dictionary Content-Type=application/json Content-Length=0 Accept=application/json + ${resp}= POST On Session sdnc_restconf ${url} headers=${headers} expected_status=${resp_code} + +Send Get Request And Validate Response Sdnc + [Documentation] GET from Opendaylight controller and validate received response + [Arguments] ${url} ${resp_code} + CREATE SDNC RESTCONF Session + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= GET On Session sdnc_restconf ${url} headers=${headers} expected_status=${resp_code} + +Send Get Request And Validate TLS Connection Response + [Documentation] Create NETCONF mount and validate TLS connection + [Arguments] ${url} ${resp_code} + Create SDNC RESTCONF Session + ${mount}= Get File ${REQUEST_DATA_PATH}${/}mount.xml + &{headers}= Create Dictionary Content-Type=application/xml Accept=application/xml + ${resp}= PUT On Session sdnc_restconf ${url} data=${mount} headers=${headers} expected_status=201 + Sleep 120 + &{headers1}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp1}= GET On Session sdnc_restconf ${PNFSIM_MOUNT_PATH} headers=${headers1} expected_status=${resp_code} + + +Send Delete Request And Validate PNF Mount Deleted + [Documentation] Disconnect NETCONT mount and validate + [Arguments] ${url} ${resp_code} + Create SDNC RESTCONF Session + ${mount}= Get File ${REQUEST_DATA_PATH}${/}mount.xml + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${deleteresponse}= DELETE On Session sdnc_restconf ${url} data=${mount} headers=${headers} expected_status=${resp_code} + Sleep 30 + ${del_topology}= DELETE On Session sdnc_restconf ${SDNC_NETWORK_TOPOLOGY} expected_status=${resp_code} + ${del_keystore}= DELETE On Session sdnc_restconf ${SDNC_KEYSTORE_CONFIG_PATH} + + diff --git a/csit/tests/sdnc/resources/sdnc-properties.robot b/csit/tests/sdnc/resources/sdnc-properties.robot new file mode 100644 index 00000000..1480d67e --- /dev/null +++ b/csit/tests/sdnc/resources/sdnc-properties.robot @@ -0,0 +1,24 @@ +*** Variables *** +# SDNC Configuration +${ODL_USER} %{ODL_USER} +${ODL_PASSWORD} %{ODL_PASSWORD} +${REQUEST_DATA_PATH} %{REQUEST_DATA_PATH} +${SDNC_CONTAINER_NAME} %{SDNC_CONTAINER_NAME} +${GRA_DATA_DIRECTORY} %{WORKSPACE}/tests/sdnc/resources/grafiles +# ${SDNC_RESTCONF_URL} http://localhost:8282/restconf +${SDNC_RESTCONF_URL} http://localhost:8282/rests +${SDNC_HEALTHCHECK} /operations/SLI-API:healthcheck +# ${SDNC_KEYSTORE_CONFIG_PATH} /config/netconf-keystore:keystore +# ${SDNC_NETWORK_TOPOLOGY} /config/network-topology:network-topology +# ${SDNC_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo +# ${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/turing-machine:turing-machine +${SDNC_KEYSTORE_CONFIG_PATH} /data/netconf-keystore:keystore?content=config +${SDNC_NETWORK_TOPOLOGY} /data/network-topology:network-topology?content=config +${SDNC_MOUNT_PATH} /data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo +${PNFSIM_MOUNT_PATH} /data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine?content=config +${GRA_PRELOAD_NETWORK} /operations/GENERIC-RESOURCE-API:preload-network-topology-operation +${GRA_PRELOAD_VFMODULE} /operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation +${GRA_SERVICE_TOPOLOGY} /operations/GENERIC-RESOURCE-API:service-topology-operation +${GRA_NETWORK_TOPOLOGY} /operations/GENERIC-RESOURCE-API:network-topology-operation +${GRA_VNF_TOPOLOGY} /operations/GENERIC-RESOURCE-API:vnf-topology-operation +${GRA_VFMODULE_TOPOLOGY} /operations/GENERIC-RESOURCE-API:vf-module-topology-operation diff --git a/csit/tests/sdnc/sdnc_csit.robot b/csit/tests/sdnc/sdnc_csit.robot new file mode 100644 index 00000000..bcd2f013 --- /dev/null +++ b/csit/tests/sdnc/sdnc_csit.robot @@ -0,0 +1,73 @@ +*** Settings *** + +Documentation SDNC, Netconf-Pnp-Simulator E2E Test Case Scenarios + +Library RequestsLibrary +Resource ./resources/sdnc-keywords.robot + + +*** Test Cases *** +Check SDNC health + [Tags] SDNC-healthcheck + [Documentation] Sending healthcheck + Send Empty Post Request And Validate Response ${SDNC_HEALTHCHECK} 200 + +Check SDNC Keystore For PNF Simulator Certificates + [Tags] SDNC-PNFSIM-CERT-DEPLOYMENT + [Documentation] Checking Keystore after SDNC installation + Send Get Request And Validate Response Sdnc ${SDNC_KEYSTORE_CONFIG_PATH} 200 + + +Check SDNC NETCONF/TLS Connection to PNF Simulator + [Tags] SDNC-PNFSIM-TLS-CONNECTION-CHECK + [Documentation] Checking NETCONF/TLS connection to PNF Simulator + Send Get Request And Validate TLS Connection Response ${SDNC_MOUNT_PATH} 200 + +Check Dropping NETCONF/TLS Connection + [Tags] SDNC-PNFSIM-TLS-DISCONNECT-CHECK + [Documentation] Checking PNF Simulator Mount Delete from SDNC + Send Delete Request And Validate PNF Mount Deleted ${SDNC_MOUNT_PATH} 204 + +Load network preload data + [Tags] SDNC-GRA-PRELOAD-NETWORK + [Documentation] Loading network preload data + Send Post File And Validate Response ${GRA_PRELOAD_NETWORK} ${GRA_DATA_DIRECTORY}/preload-network.json 200 +Load vf-module preload data + [Tags] SDNC-GRA-PRELOAD-VF-MODULE + [Documentation] Loading vf-module preload data + Send Post File And Validate Response ${GRA_PRELOAD_VFMODULE} ${GRA_DATA_DIRECTORY}/preload-vf-module.json 200 +Check GRA service assign + [Tags] SDNC-GRA-SERVICE-ASSIGN + [Documentation] Testing GRA service assign + Send Post File And Validate Response ${GRA_SERVICE_TOPOLOGY} ${GRA_DATA_DIRECTORY}/svc-topology-assign.json 200 +Check GRA network assign + [Tags] SDNC-GRA-NETWORK-ASSIGN + [Documentation] Testing GRA network assign + Send Post File And Validate Response ${GRA_NETWORK_TOPOLOGY} ${GRA_DATA_DIRECTORY}/network-topology-assign.json 200 +Check GRA vnf assign + [Tags] SDNC-GRA-VNF-ASSIGN + [Documentation] Testing GRA vnf assign + Send Post File And Validate Response ${GRA_VNF_TOPOLOGY} ${GRA_DATA_DIRECTORY}/vnf-topology-assign.json 200 +Check GRA vf-module assign + [Tags] SDNC-GRA-VF-MODULE-ASSIGN + [Documentation] Testing GRA vf-module assign + Send Post File And Validate Response ${GRA_VFMODULE_TOPOLOGY} ${GRA_DATA_DIRECTORY}/vf-module-topology-assign.json 200 +Check GRA vf-module unassign + [Tags] SDNC-GRA-VF-MODULE-UNASSIGN + [Documentation] Testing GRA vf-module unassign + Send Post File And Validate Response ${GRA_VFMODULE_TOPOLOGY} ${GRA_DATA_DIRECTORY}/vf-module-topology-unassign.json 200 +Check GRA vnf unassign + [Tags] SDNC-GRA-VNF-UNASSIGN + [Documentation] Testing GRA vnf unassign + Send Post File And Validate Response ${GRA_VNF_TOPOLOGY} ${GRA_DATA_DIRECTORY}/vnf-topology-unassign.json 200 +Check GRA network unassign + [Tags] SDNC-GRA-NETWORK-UNASSIGN + [Documentation] Testing GRA network unassign + Send Post File And Validate Response ${GRA_NETWORK_TOPOLOGY} ${GRA_DATA_DIRECTORY}/network-topology-unassign.json 200 +Check GRA service delete + [Tags] SDNC-GRA-SERVICE-DELETE + [Documentation] Testing GRA service delete + Send Post File And Validate Response ${GRA_SERVICE_TOPOLOGY} ${GRA_DATA_DIRECTORY}/svc-topology-delete.json 200 + + + diff --git a/csit/tests/sdnr/debug/10_dummy.robot b/csit/tests/sdnr/debug/10_dummy.robot new file mode 100644 index 00000000..7ae55d3a --- /dev/null +++ b/csit/tests/sdnr/debug/10_dummy.robot @@ -0,0 +1,11 @@ +*** Settings *** +Documentation Dummy test case for debugging purposes +... This test is doing nothing and can be put into testplan.txt +... to debug production and deployment without running sdnr robot tests. + +Library BuiltIn + + +*** Test Cases *** +Dummy Test + Pass Execution Dummy Test for Debugging purposes \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/10_lifecycleNetconfSsh/devicemanagerlifecycle_netconf.robot b/csit/tests/sdnr/functional/devicemanager/_templates/10_lifecycleNetconfSsh/devicemanagerlifecycle_netconf.robot new file mode 100644 index 00000000..885e1954 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/10_lifecycleNetconfSsh/devicemanagerlifecycle_netconf.robot @@ -0,0 +1,495 @@ +*** Settings *** +Documentation devicemanager lifecycle via netconf only +... Verify network element connection +... Actions are triggered via server interface as used by ODLUX +... Status verifcation is done by dataprovider interface and restconf mdsal +... to detect asynchron connection status entries +Default Tags dm-lifecycle netconf ssh + +Library ConnectLibrary +Library SDNCBaseLibrary +Library SDNCDataProvider +Library SDNCRestconfLibrary +Library ConnectApp +Library FaultManagementApp +Library FaultManagementAppBackend +Library Collections +Library DateTime +Library utility + +Suite Setup global suite setup &{GLOBAL_SUITE_SETUP_CONFIG} +Suite Teardown global suite teardown + + + +*** Variables *** +${DEVICE_TYPE} DEFINE_IN_INIT +${DEVICE_NAME} robot-${DEVICE_TYPE}-sim-lifecycle +${HOST} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][NETCONF_HOST] +${PORT} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][BASE_PORT] +${USERNAME} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][USER] +${PASSWORD} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][PASSWORD] +${HOST_NOK} 192.168.240.240 +${PORT_NOK} ${4711} +${USERNAME_NOK} wrong-username +${PASSWORD_NOK} wrong-password +${CORE_MODEL} Unsupported +${UNDEFINED} undefined +${DEVICE_TO_DELETE} devices + +# set log level https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html + + +*** Test Cases *** + +Add network element connection + [Documentation] Add network-function to device manager + ... verify correct detection of specific device manager + ... verify correct entries in connection log + [Tags] smoke + + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-ok + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Log To Console ${start_time} + ConnectApp.Add network element connection device_name=${DEVICE_NAME_TEST} is_required=${True} + ... host=${HOST} port=${PORT} username=${USERNAME} password=${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connected + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connected time_in_sec=${10} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + ... status=Connected + ... host=${HOST} + ... port=${PORT} + ... device-type=${DEVICE_TYPE_GUI} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Connected ${1} + ... msg=wrong connection log entries for Connected state + Dictionary Should Contain Item ${conn_status_list_stats} Mounted ${1} msg=wrong connection log entries for Mounted state + +Retrieve yang capabilities from network element + [Documentation] get yang capabilities from network element and compare with reference file + [Tags] smoke netconf yang + + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-ok + ${yang_capabilities} = get_yang_capabilities_as_list node_id=${DEVICE_NAME_TEST} + Log ${yang_capabilities} + ${is_yang_correct} = compare_yang_capability_list_to_file ${yang_capabilities} ${YANG_CAPABILITIES_FILE} + Should be True ${is_yang_correct} msg=Yang capabilities are different from expected list + +Remove network element connection + [Documentation] remove network element connection from device manager + ... verify if all ressources are removed + ... verify correct entries in connection log + [Tags] smoke + + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-ok + ConnectApp.Remove network element connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${DEVICE_NAME_TEST} not existing + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 6s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Dictionary Should Contain Item ${conn_status_list_stats} Unmounted ${1} msg=wrong connection log entries for Unmounted state + +Add network element connection wrong port + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-port-nok + ConnectApp.Add network element connection device_name=${DEVICE_NAME_TEST} is_required=${True} host=${HOST} + ... port=${PORT_NOK} username=${USERNAME} password=${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connecting + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connecting time_in_sec=${10} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + ... status=Connecting + ... host=${HOST} + ... port=${PORT_NOK} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted ${1} msg=wrong connection log entries for Mounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Dictionary Should Not Contain Key ${conn_status_list_stats} Unmounted + +Remove network element connection wrong port + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-port-nok + ConnectApp.Remove network element connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${DEVICE_NAME_TEST} not existing + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Unmounted ${1} msg=wrong connection log entries for Unmounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted + +Add network element connection wrong ip + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-ip-nok + ConnectApp.Add network element connection device_name=${DEVICE_NAME_TEST} is_required=${True} host=${HOST_NOK} + ... port=${PORT} username=${USERNAME} password=${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connecting + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connecting time_in_sec=${10} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + ... status=Connecting + ... host=${HOST_NOK} + ... port=${PORT} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted ${1} msg=wrong connection log entries for Mounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Dictionary Should Not Contain Key ${conn_status_list_stats} Unmounted + +Remove network element connection wrong ip + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-ip-nok + ConnectApp.Remove network element connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${DEVICE_NAME_TEST} not existing + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Unmounted ${1} msg=wrong connection log entries for Unmounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted + +Add network element connection and change is required to false + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required + ConnectApp.Add network element connection device_name=${DEVICE_NAME_TEST} is_required=${True} host=${HOST} + ... port=${PORT} username=${USERNAME} password=${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connected + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connected time_in_sec=${10} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + + ConnectApp.edit network element connection ${DEVICE_NAME_TEST} ${False} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${False} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Connected ${1} msg=wrong connection log entries for Connected state + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted ${1} msg=wrong connection log entries for Mounted state + +Edit network element connection: is required to true + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required + ConnectApp.edit network element connection ${DEVICE_NAME_TEST} ${True} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Unmounted + #Dictionary Should Not Contain Key ${conn_status_list_stats} Connecting + +Unmount network element + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required + ConnectApp.unmount_network_element ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Disconnected + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Unmounted ${1} msg=wrong connection log entries for Unmounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted + #Dictionary Should Not Contain Key ${conn_status_list_stats} Connecting + + +Mount network element + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required + ConnectApp.mount_network_element ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connected + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connected time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Connected ${1} msg=wrong connection log entries for Connected state + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted ${1} msg=wrong connection log entries for Mounted state + +Mount Nts Network Function with VALID TLS Key ID + IF 'DOCKER_TLS_PORT' in ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']} + Run Keyword And Continue On Failure Add Network Element Connection device_name=${DEVICE_NAME}_sim_key_0 + ... is_required=${True} + ... host=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['IP']} + ... port=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['DOCKER_TLS_PORT']} + ... username=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['USER']} + ... tls_key=ODL_private_key_0 + ... check_connection_status=Connected + ... time_to_wait=60 + ConnectApp.remove_network_element_connection ${DEVICE_NAME}_sim_key_0 + END + +Remove network element connection + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required + ConnectApp.remove network element connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} not existing + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 5s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Unmounted ${1} msg=wrong connection log entries for Unmounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted + #Dictionary Should Not Contain Key ${conn_status_list_stats} Connecting + +Remove unmounted network element connection + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required-true + ConnectApp.Add network element connection device_name=${DEVICE_NAME_TEST} is_required=${True} host=${HOST} + ... port=${PORT} username=${USERNAME} password=${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connected + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connected time_in_sec=${10} + + ConnectApp.unmount_network_element ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Disconnected + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + ConnectApp.remove_network_element_connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} not existing + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted ${1} msg=wrong connection log entries for Mounted state + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Connected ${1} msg=wrong connection log entries for Connected state + Run Keyword And Continue On Failure Dictionary Should Contain Key ${conn_status_list_stats} Unmounted msg=no connection log entries for Unmounted state + ConnectApp.Remove Network Element Connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + +Add network element connection and remount + [Tags] smoke + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-remount + Log To Console ${start_time} + ConnectApp.Add network element connection device_name=${DEVICE_NAME_TEST} is_required=${True} + ... host=${HOST} port=${PORT} username=${USERNAME} password=${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connected + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connected time_in_sec=${10} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + ... status=Connected + ... host=${HOST} + ... port=${PORT} + ... device-type=${DEVICE_TYPE_GUI} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Connected ${1} msg=wrong connection log entries for Connected state + Dictionary Should Contain Item ${conn_status_list_stats} Mounted ${1} msg=wrong connection log entries for Mounted state + + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + # perform a mount on a alredy connected device + ConnectApp.mount_network_element ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connected + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connected time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Connected ${1} msg=wrong connection log entries for Connected state + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted ${1} msg=wrong connection log entries for Mounted state + +Remove remounted network element connection + [Tags] smoke + Sleep 3s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 3s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-remount + ConnectApp.Remove network element connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${DEVICE_NAME_TEST} not existing + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Unmounted ${1} msg=wrong connection log entries for Unmounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/20_pnfRegistration/pnfRegistration.robot b/csit/tests/sdnr/functional/devicemanager/_templates/20_pnfRegistration/pnfRegistration.robot new file mode 100644 index 00000000..6adf5f12 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/20_pnfRegistration/pnfRegistration.robot @@ -0,0 +1,116 @@ +*** Settings *** +Documentation Set VES collector endpoint details in NTS manager +... VES endpooint Details and NTS manager information are stored in test environemnt variable file +... as dictionary NETWORK_FUNCTIONS = {}, VESCOLLECTOR ={} +... change number devices on command line with --variable DEVICE_TYPE:ORAN +... + +Library ConnectLibrary +Library String +Library SDNCBaseLibrary +Library SDNCRestconfLibrary +Library NTSimManagerNG +Library SDNCDataProvider +Library ConnectApp + +Suite Setup global suite setup &{GLOBAL_SUITE_SETUP_CONFIG} +Suite Teardown global suite teardown + + +*** Variables *** +${DEVICE_TYPE} DEFINE_IN_INIT +${SIM_COUNT} 1 +${CORE_MODEL} DEFINE_IN_INIT +${DEVICE_TYPE_GUI} DEFINE_IN_INIT +${PNF_REGISTRATION_TIMEOUT} 180 + + +*** Test Cases *** +Setup NTS function + [Tags] nts bringup + [Documentation] configure NTS manager to support restconf registration + Add Network Element Connection device_name=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} is_required=${True} + ... host=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['IP']} port=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PORT']} + ... username=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['USER']} password=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PASSWORD']} + ... check_connection_status=Connected + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} Connected + +Start pnf ves registration from NTS function + [Tags] nts bringup + [Documentation] scales number of simulated devices per device type to '0' + ... set details for VES endpoint + ... scales number of simulated devices per device type + Stop Network Function Feature ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} ves-pnf-registration # stopping feature not necessary + NTSimManagerNG.set_ves_endpoint_details_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ... ves-endpoint-protocol=${VESCOLLECTOR}[SCHEME] + ... ves-endpoint-ip=${VESCOLLECTOR}[IP] + ... ves-endpoint-port=${VESCOLLECTOR}[PORT] + ... ves-endpoint-auth-method=${VESCOLLECTOR}[AUTHMETHOD] + ... ves-endpoint-username=${VESCOLLECTOR}[USERNAME] + ... ves-endpoint-password=${VESCOLLECTOR}[PASSWORD] + Start Network Function Feature ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} ves-pnf-registration + NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ... pnf-registration=${True} + sleep 10s reason=Wait before start network function +# Log console=True message=Wait some time ${PNF_REGISTRATION_TIMEOUT} till request sent by NTSim +# ConnectApp.should_be_equal_connection_status_until_time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} Connected ${180} + + +Verify connection status SSH + [Tags] pnfregistration dm-lifecycle SSH + sleep 5s reason=Wait for processing of simulated device + @{pnf_list}= NTSimManagerNG.get_simulated_pnfs_nf ${DEVICE_TYPE} protocol=SSH + ${length} = Get Length ${pnf_list} + Should Not Be Equal As Integers ${length} 0 msg=No network functions created + + Log to console ${pnf_list} + FOR ${device} IN @{pnf_list} + ${node_id}= set variable ${device["node-id"]} + ${port}= set variable ${device["port"]} + Log console=True message=Verify connection status: ${node_id} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time + ... ${node_id} Connected ${PNF_REGISTRATION_TIMEOUT} + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${node_id} connected ${5} + ConnectApp.should_be_equal_network_element_connection_details ${node_id} + ... node-id=${node_id} + ... is-required=${False} + ... status=Connected + ... port=${port} + ... device-type=${DEVICE_TYPE_GUI} + END + +Verify connection status TLS + [Tags] pnfregistration dm-lifecycle TLS + @{pnf_list}= NTSimManagerNG.get_simulated_pnfs_nf ${DEVICE_TYPE} protocol=TLS + Log to console ${pnf_list} + ${length} = Get Length ${pnf_list} + Should Not Be Equal As Integers ${length} 0 msg=No network functions created + + FOR ${device} IN @{pnf_list} + ${node_id}= set variable ${device["node-id"]} + ${port}= set variable ${device["port"]} + Log console=True message=Verify connection status: ${node_id} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time + ... ${node_id} Connected ${PNF_REGISTRATION_TIMEOUT} + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${node_id} connected ${5} + ConnectApp.should_be_equal_network_element_connection_details ${node_id} + ... node-id=${node_id} + ... is-required=${False} + ... status=Connected + ... port=${port} + ... device-type=${DEVICE_TYPE_GUI} + END + +Remove all networkelement connections + [Documentation] Delete all network element connections, should not fail if the connection is not there + [Tags] restconf dm-lifecycle + Stop Network Function Feature ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} ves-pnf-registration + @{pnf_list}= NTSimManagerNG.get_simulated_pnfs_nf ${DEVICE_TYPE} + FOR ${device} IN @{pnf_list} + ${node_id}= set variable ${device["node-id"]} + Run Keyword And Ignore Error ConnectApp.remove network element connection filtered node-id=${node_id} + END + NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ... pnf-registration=${False} + ConnectApp.Remove Network Element Connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/21_alarmNotificationVES/alarmNotificationVes.robot b/csit/tests/sdnr/functional/devicemanager/_templates/21_alarmNotificationVES/alarmNotificationVes.robot new file mode 100644 index 00000000..7b4574dd --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/21_alarmNotificationVES/alarmNotificationVes.robot @@ -0,0 +1,136 @@ +*** Settings *** +Documentation Connects NTSim of specific device type +... NTSim information are stored in test environment variable file +... as dictionary NETWORK_FUNCTIONS = {} +... change device type on command line with e.g. --variable DEVICE_TYPE:O_RAN_FH +... Enable alarms by setting fault-notification-delay-period and validate the alarms published by NTSim +... received by SDNR via VES use case +Default Tags fm ves + +Library ConnectLibrary +Library SDNCRestconfLibrary +Library SDNCBaseLibrary +Library ConnectApp +Library NTSimManagerNG +Library FaultManagementApp +Library FaultManagementAppBackend +Library utility +Library DateTime +Library Collections + +Suite Setup global suite setup &{GLOBAL_SUITE_SETUP_CONFIG} +Suite Teardown global suite teardown + + +*** Variables *** +${DEVICE_TYPE} _FILL_HERE_ +${FAULT_DELAY} 10 +${TIME_PERIOD_SEND_NOTIFY} 22s +${PROCESS_TIME_NOTIF} 30s +&{ALARM_SEVERITY_DEFAULT} Critical=${0} Major=${0} Minor=${0} Warning=${0} NonAlarmed=${0} + + +*** Test Cases *** +Setup NTS function + [Tags] nts bringup + [Documentation] add network function to trigger alarm notification via VES in next tests + Add Network Element Connection device_name=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} is_required=${True} + ... host=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['IP']} port=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PORT']} + ... username=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['USER']} password=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PASSWORD']} + ... check_connection_status=Connected + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} Connected + +Set alarm notification + [Tags] smoke + NTSimManagerNG.clear_alarm_count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} faults-enabled=${True} + ${vesAlarmGenerated} = NTSimManagerNG.Get Alarm Count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Global Variable ${start_time} + ${alarm_status_start} = FaultManagementApp.get_alarm_status + Set Global Variable ${alarm_status_start} + NTSimManagerNG.set_fault_delay_list_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} delay-period=${fault_delay} + Log Send notification every ${FAULT_DELAY} sec for ${TIME_PERIOD_SEND_NOTIFY} level=INFO console=True + Sleep ${TIME_PERIOD_SEND_NOTIFY} + +UnSet alarm notification + [Documentation] stops alarm generation and create dictionary ${vesAlarmGenerated} + ... for further checks + [Tags] smoke + NTSimManagerNG.set_fault_delay_list_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} delay-period=${0} + #NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + #... faults-enabled=${False} + Log Wait ${PROCESS_TIME_NOTIF} to process notifications level=INFO console=True + Sleep ${PROCESS_TIME_NOTIF} + # get generated alarms + ${vesAlarmGenerated} = NTSimManagerNG.Get Alarm Count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ${alarmsGenerated} = Get Dictionary Values ${vesAlarmGenerated} + Log ${alarmsGenerated} + ${numAlarmsGenerated} = evaluate sum(${alarmsGenerated}) + Log ${numAlarmsGenerated} + Should Not Be Equal As Integers ${numAlarmsGenerated} 0 msg=no alarm notifications generated + Set Global Variable ${vesAlarmGenerated} + + +Verify alarm log + [Documentation] NTSim sends alarm notification for all simulated devices + ... Verification is done for all simulated devices of the simulator + [Tags] smoke fm ves + + @{pnf_list}= NTSimManagerNG.get_simulated_pnfs_nf_as_node_id_list ${DEVICE_TYPE} + ${length} = Get Length ${pnf_list} + Should Not Be Equal As Integers ${length} 0 msg=No network functions created + Log to console ${pnf_list} + FOR ${device} IN @{pnf_list} + ${alarm_log_list_debug_backend} = FaultManagementAppBackend.get_alarm_log_list source-type=Ves + ... timestamp=>=${start_time} + ... node-id=${device} + Log ${alarm_log_list_debug_backend} + ${alarm_log_list} = FaultManagementApp.get_alarm_log_list source-type=Ves + ... timestamp=>=${start_time} + ... node-id=${device} + ${alarm_log_list_stats} = get_counts_from_list ${alarm_log_list} severity ${ALARM_SEVERITY_DEFAULT} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Critical ${vesAlarmGenerated}[critical] msg=Value of dictionary key 'Critical' does not match not match expected value '${vesAlarmGenerated}[critical]'. Current: ${alarm_log_list_stats["Critical"]} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Major ${vesAlarmGenerated}[major] msg=Value of dictionary key 'Critical' does not match not match expected value '${vesAlarmGenerated}[major]'. Current: ${alarm_log_list_stats["Major"]} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Minor ${vesAlarmGenerated}[minor] msg=Value of dictionary key 'Critical' does not match not match expected value '${vesAlarmGenerated}[minor]'. Current: ${alarm_log_list_stats["Minor"]} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Warning ${vesAlarmGenerated}[warning] msg=Value of dictionary key 'Critical' does not match not match expected value '${vesAlarmGenerated}[warning]'. Current: ${alarm_log_list_stats["Warning"]} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} NonAlarmed ${vesAlarmGenerated}[normal] msg=Value of dictionary key 'Critical' does not match not match expected value '${vesAlarmGenerated}[normal]'. Current: ${alarm_log_list_stats["NonAlarmed"]} + END + +Verify current problem list + [Tags] smoke + ${alarm_log_list} = FaultManagementApp.get_alarm_log_list timestamp=>=${start_time} + ${current_problem_list_calculated}= FaultManagementApp.calculate_current_alarm_list ${alarm_log_list} + Log ${current_problem_list_calculated} + ${current_problem_list}= FaultManagementApp.get_current_problem_list timestamp=>=${start_time} + Log ${current_problem_list} + ${current_problem_list_debug}= FaultManagementApp.get_current_problem_list + Log ${current_problem_list_debug} + ${current_problem_list_debug_backend}= FaultManagementAppBackend.get_current_problem_list timestamp=>=${start_time} + Log ${current_problem_list_debug_backend} + ${current_problem_list_calculated_stats}= get_counts_from_list ${current_problem_list_calculated} severity ${ALARM_SEVERITY_DEFAULT} + ${current_problem_list_stats}= get_counts_from_list ${current_problem_list} severity ${ALARM_SEVERITY_DEFAULT} + Log Dictionary ${current_problem_list_calculated_stats} + Log Dictionary ${current_problem_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Critical ${current_problem_list_calculated_stats}[Critical] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Major ${current_problem_list_calculated_stats}[Major] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Minor ${current_problem_list_calculated_stats}[Minor] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Warning ${current_problem_list_calculated_stats}[Warning] + +Verify alarm status bar + [Tags] smoke + Sleep 10s reason=wait update alarmstatus + ${alarm_status_end} = FaultManagementApp.get_alarm_status + Log Dictionary ${alarm_status_start} + Log Dictionary ${alarm_status_end} + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[criticals]-${alarm_status_start}[criticals] == ${vesAlarmGenerated}[critical] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[majors]-${alarm_status_start}[majors] == ${vesAlarmGenerated}[major] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[minors]-${alarm_status_start}[minors] == ${vesAlarmGenerated}[minor] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[warnings]-${alarm_status_start}[warnings] == ${vesAlarmGenerated}[warning] + +Remove networkelement connection + ConnectApp.Remove network element connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} not existing + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} not existing diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/22_alarmNotificationNETCONF/alarmNotificationNetconf.robot b/csit/tests/sdnr/functional/devicemanager/_templates/22_alarmNotificationNETCONF/alarmNotificationNetconf.robot new file mode 100644 index 00000000..460a7d73 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/22_alarmNotificationNETCONF/alarmNotificationNetconf.robot @@ -0,0 +1,156 @@ +*** Settings *** +Documentation Connects NTSim of specific device type +... NTSim information are stored in test environment variable file +... as dictionary NETWORK_FUNCTIONS = {} +... change device type on command line with e.g. --variable DEVICE_TYPE:O_RAN_FH +... Enable alarms by setting fault-notification-delay-period and validate the alarms raised by NTS +... received by SDNR via netconf +Default Tags fm ves + +Library ConnectLibrary +Library SDNCBaseLibrary +Library SDNCRestconfLibrary +Library ConnectApp +Library NTSimManagerNG +Library FaultManagementApp +Library FaultManagementAppBackend +Library utility +Library DateTime +Library Collections + +Suite Setup global suite setup &{GLOBAL_SUITE_SETUP_CONFIG} +Suite Teardown global suite teardown + + +*** Variables *** +${DEVICE_TYPE} DEFINE_IN_INIT +${HOST} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][NETCONF_HOST] +${PORT} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][BASE_PORT] +${USERNAME} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][USER] +${PASSWORD} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][PASSWORD] +${HOST_NOK} 192.168.240.240 +${PORT_NOK} ${4711} +${USERNAME_NOK} wrong-username +${PASSWORD_NOK} wrong-password +${CORE_MODEL} Unsupported +${UNDEFINED} undefined +${FAULT_DELAY} 10 +${TIME_PERIOD_SEND_NOTIF} 22s +&{ALARM_SEVERITY_DEFAULT} Critical=${0} Major=${0} Minor=${0} Warning=${0} NonAlarmed=${0} + + +*** Test Cases *** +Setup NTS function + [Tags] nts bringup + [Documentation] configure NTS manager to support restconf registration + Add Network Element Connection device_name=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} is_required=${True} + ... host=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['IP']} port=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PORT']} + ... username=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['USER']} password=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PASSWORD']} + ... check_connection_status=Connected + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} Connected + +Set alarm notification + [Tags] smoke + NTSimManagerNG.clear_alarm_count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + NTSimManagerNG.Set Netconf Config Nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} faults-enabled=${True} + ${vesAlarmGenerated} = NTSimManagerNG.Get Alarm Count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Global Variable ${start_time} + ${current_problem_list}= FaultManagementApp.Get Current Problem List + Log ${current_problem_list} + ${alarm_status_start} = FaultManagementApp.get_alarm_status + Set Global Variable ${alarm_status_start} + NTSimManagerNG.set_fault_delay_list_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} delay-period=${fault_delay} + + Log Send notification every ${FAULT_DELAY} sec for ${TIME_PERIOD_SEND_NOTIF} level=INFO console=True + Sleep ${TIME_PERIOD_SEND_NOTIF} + +UnSet alarm notification + [Documentation] stops alarm generation and create dictionary ${netconfAlarmGenerated} + ... for further checks + [Tags] smoke + NTSimManagerNG.set_fault_delay_list_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} delay-period=${0} + NTSimManagerNG.Set Netconf Config Nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} faults-enabled=${False} + ${netconfAlarmGenerated} = NTSimManagerNG.Get Alarm Count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + # get generated alarms + ${alarmsGenerated} = Get Dictionary Values ${netconfAlarmGenerated} + Log ${alarmsGenerated} + ${numAlarmsGenerated} = evaluate sum(${alarmsGenerated}) + Log ${numAlarmsGenerated} + Should Not Be Equal As Integers ${numAlarmsGenerated} 0 msg=no alarm notifications generated + Set Global Variable ${netconfAlarmGenerated} + + +Verify alarm log + [Tags] smoke + + ${alarm_log_list} = FaultManagementApp.get_alarm_log_list source-type=Netconf + ... timestamp=>=${start_time} + ... node-id=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ${alarm_log_list_stats} = get_counts_from_list ${alarm_log_list} severity ${ALARM_SEVERITY_DEFAULT} + Log Dictionary ${alarm_log_list_stats} + ${alarm_log_list_debug} = FaultManagementApp.get_alarm_log_list source-type=Netconf + Log ${alarm_log_list_debug} + ${alarm_log_list_debug_backend} = FaultManagementAppBackend.get_alarm_log_list source-type=Netconf + ... timestamp=>=${start_time} + Log ${alarm_log_list_debug_backend} + + ${critical_count} Set Variable ${alarm_log_list_stats}[Critical] + ${major_count} Set Variable ${alarm_log_list_stats}[Major] + ${minor_count} Set Variable ${alarm_log_list_stats}[Minor] + ${warning_count} Set Variable ${alarm_log_list_stats}[Warning] + ${nonalarmed_count} Set Variable ${alarm_log_list_stats}[NonAlarmed] + + ${netconf_critical_count} Set Variable ${netconfAlarmGenerated}[critical] + ${netconf_major_count} Set Variable ${netconfAlarmGenerated}[major] + ${netconf_minor_count} Set Variable ${netconfAlarmGenerated}[minor] + ${netconf_warning_count} Set Variable ${netconfAlarmGenerated}[warning] + ${netconf_nonalarmed_count} Set Variable ${netconfAlarmGenerated}[normal] + + Should Be True ${critical_count} >= ${netconf_critical_count} + Should Be True ${major_count} >= ${netconf_major_count} + Should Be True ${minor_count} >= ${netconf_minor_count} + Should Be True ${warning_count} >= ${netconf_warning_count} + Should Be True ${nonalarmed_count} >= ${netconf_nonalarmed_count} + + +Verify current problem list + [Tags] smoke + # fails immediatly if netconfAlarmGenerated is not set + Log ${netconfAlarmGenerated} + ${alarm_log_list} = FaultManagementApp.get_alarm_log_list timestamp=>=${start_time} + ${current_problem_list_calculated}= FaultManagementApp.calculate_current_alarm_list ${alarm_log_list} + Log ${current_problem_list_calculated} + ${current_problem_list}= FaultManagementApp.get_current_problem_list timestamp=>=${start_time} + Log ${current_problem_list} + ${current_problem_list_debug}= FaultManagementApp.get_current_problem_list + Log ${current_problem_list_debug} + ${current_problem_list_debug_backend}= FaultManagementAppBackend.get_current_problem_list timestamp=>=${start_time} + Log ${current_problem_list_debug_backend} + ${current_problem_list_calculated_stats} = get_counts_from_list ${current_problem_list_calculated} severity ${ALARM_SEVERITY_DEFAULT} + ${current_problem_list_stats} = get_counts_from_list ${current_problem_list} severity ${ALARM_SEVERITY_DEFAULT} + Log Dictionary ${current_problem_list_calculated_stats} + Log Dictionary ${current_problem_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Critical ${current_problem_list_calculated_stats}[Critical] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Major ${current_problem_list_calculated_stats}[Major] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Minor ${current_problem_list_calculated_stats}[Minor] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Warning ${current_problem_list_calculated_stats}[Warning] + +Verify alarm status bar + [Tags] smoke + Sleep 10s reason=wait update alarmstatus + ${alarm_status_end} = FaultManagementApp.get_alarm_status + Log Dictionary ${alarm_status_start} + Log Dictionary ${alarm_status_end} + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[criticals]-${alarm_status_start}[criticals] == ${netconfAlarmGenerated}[critical] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[majors]-${alarm_status_start}[majors] == ${netconfAlarmGenerated}[major] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[minors]-${alarm_status_start}[minors] == ${netconfAlarmGenerated}[minor] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[warnings]-${alarm_status_start}[warnings] == ${netconfAlarmGenerated}[warning] + +Remove networkelement connection + ConnectApp.Remove network element connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} not existing + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} not existing + diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/90_resetSimulatedDevices/90_resetSimulatedDevices.robot b/csit/tests/sdnr/functional/devicemanager/_templates/90_resetSimulatedDevices/90_resetSimulatedDevices.robot new file mode 100644 index 00000000..e9db7405 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/90_resetSimulatedDevices/90_resetSimulatedDevices.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Set number of simulated devices of all device types +... NTS manager information are stored in test environemnt variable file +... as dictionary NTS_MANAGER = {} +... change number devices on command line with --variable SIM_COUNT:10 --variable DEVICE_TYPE:ORAN + +Library ConnectLibrary +Library SDNCBaseLibrary +Library NTSimManagerNG +Library ConnectApp + +Suite Setup global_suite_setup +Suite Teardown global suite teardown + + +*** Variables *** +${DEVICE_TYPE} DEFINE_IN_INIT +${SIM_COUNT} 0 + + +*** Test Cases *** +Reset simulated devices + [Tags] nts-manager bringup + [Documentation] scales number of simulated devices per device type + remove network element connection filtered node-id=* diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/__init__.robot b/csit/tests/sdnr/functional/devicemanager/_templates/__init__.robot new file mode 100644 index 00000000..0011fbc5 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/__init__.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Test suite for _FILL_HERE_ devices +Suite Setup My Setup +Force Tags _FILL_HERE_ +#Library SomeLibrary + +*** Variables *** + + +*** Keywords *** +My Setup + Set Suite Variable ${DEVICE_TYPE} _FILL_HERE_ children=true + Set Suite Variable ${CORE_MODEL} _FILL_HERE_ children=true + Set Suite Variable ${DEVICE_TYPE_GUI} _FILL_HERE_ children=true + + diff --git a/csit/tests/sdnr/functional/devicemanager/o-ran-basic/20_pnfRegistration b/csit/tests/sdnr/functional/devicemanager/o-ran-basic/20_pnfRegistration new file mode 120000 index 00000000..2c1e5752 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/o-ran-basic/20_pnfRegistration @@ -0,0 +1 @@ +../_templates/20_pnfRegistration \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/o-ran-basic/21_alarmNotificationVES b/csit/tests/sdnr/functional/devicemanager/o-ran-basic/21_alarmNotificationVES new file mode 120000 index 00000000..80f9ccaa --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/o-ran-basic/21_alarmNotificationVES @@ -0,0 +1 @@ +../_templates/21_alarmNotificationVES \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/o-ran-basic/90_resetSimulatedDevices b/csit/tests/sdnr/functional/devicemanager/o-ran-basic/90_resetSimulatedDevices new file mode 120000 index 00000000..86f3cad3 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/o-ran-basic/90_resetSimulatedDevices @@ -0,0 +1 @@ +../_templates/90_resetSimulatedDevices \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/o-ran-basic/__init__.robot b/csit/tests/sdnr/functional/devicemanager/o-ran-basic/__init__.robot new file mode 100644 index 00000000..36cbca9f --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/o-ran-basic/__init__.robot @@ -0,0 +1,18 @@ +*** Settings *** +Documentation Test suite for o-ran devices +Suite Setup My Setup +Force Tags o-ran +Library OperatingSystem + +*** Variables *** + + +*** Keywords *** +My Setup + Set Suite Variable ${DEVICE_TYPE} O_RAN_FH children=true + Set Suite Variable ${CORE_MODEL} Unsupported children=true + Set Suite Variable ${DEVICE_TYPE_GUI} O-RAN children=true + ${yang_file} = Get File ${CURDIR}/yangCapabilities.txt + Set Suite Variable ${YANG_CAPABILITIES_FILE} ${yang_file} children=true + + diff --git a/csit/tests/sdnr/functional/devicemanager/o-ran-basic/yangCapabilities.txt b/csit/tests/sdnr/functional/devicemanager/o-ran-basic/yangCapabilities.txt new file mode 100644 index 00000000..33e7abb7 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/o-ran-basic/yangCapabilities.txt @@ -0,0 +1,70 @@ +[["o-ran-compression-factors", "2019-07-03"], + ["ietf-crypto-types", "2019-07-02"], + ["ietf-netconf", "2013-09-29"], + ["o-ran-alarm-id", "2019-02-04"], + ["o-ran-hardware", "2019-07-03"], + ["nc-notifications", "2008-07-14"], + ["ietf-inet-types", "2013-07-15"], + ["o-ran-antenna-calibration", "2019-07-03"], + ["o-ran-interfaces", "2019-07-03"], + ["ietf-ip", "2018-02-22"], + ["ietf-tcp-server", "2019-07-02"], + ["ietf-netconf-monitoring", "2010-10-04"], + ["iana-hardware", "2018-03-13"], + ["iana-if-type", "2017-01-19"], + ["ietf-netconf-acm", "2018-02-14"], + ["ietf-origin", "2018-02-14"], + ["o-ran-lbm", "2019-02-04"], + ["ietf-yang-metadata", "2016-08-05"], + ["o-ran-operations", "2019-07-03"], + ["o-ran-fan", "2019-07-03"], + ["o-ran-module-cap", "2019-07-03"], + ["ietf-tls-common", "2019-07-02"], + ["ietf-netconf-server", "2019-07-02"], + ["ietf-yang-types", "2013-07-15"], + ["ietf-ssh-common", "2019-07-02"], + ["o-ran-delay-management", "2019-07-03"], + ["ietf-ssh-server", "2019-07-02"], + ["ietf-system", "2014-08-06"], + ["o-ran-trace", "2019-07-03"], + ["o-ran-ald-port", "2019-07-03"], + ["ietf-netconf-notifications", "2012-02-06"], + ["ietf-tls-server", "2019-07-02"], + ["ietf-tcp-client", "2019-07-02"], + ["o-ran-fm", "2019-02-04"], + ["o-ran-laa-operations", "2019-07-03"], + ["onap-system", "2020-10-26"], + ["o-ran-supervision", "2019-07-03"], + ["o-ran-file-management", "2019-07-03"], + ["o-ran-performance-management", "2019-07-03"], + ["nts-common", "2021-06-08"], + ["o-ran-ecpri-delay", "2019-02-04"], + ["o-ran-laa", "2019-07-03"], + ["ietf-dhcpv6-types", "2018-01-30"], + ["o-ran-usermgmt", "2019-07-03"], + ["yang", "2017-02-20"], + ["o-ran-transceiver", "2019-07-03"], + ["ietf-keystore", "2019-07-02"], + ["ietf-netconf-with-defaults", "2011-06-01"], + ["o-ran-processing-element", "2019-07-03"], + ["ietf-yang-library", "2019-01-04"], + ["ietf-x509-cert-to-name", "2014-12-10"], + ["notifications", "2008-07-14"], + ["ietf-hardware", "2018-03-13"], + ["ietf-tcp-common", "2019-07-02"], + ["ietf-truststore", "2019-07-02"], + ["o-ran-uplane-conf", "2019-07-03"], + ["o-ran-ald", "2019-07-03"], + ["ietf-interfaces", "2018-02-20"], + ["o-ran-troubleshooting", "2019-02-04"], + ["o-ran-beamforming", "2019-07-03"], + ["o-ran-software-management", "2019-07-03"], + ["o-ran-externalio", "2019-07-03"], + ["o-ran-mplane-int", "2019-07-03"], + ["o-ran-sync", "2019-07-03"], + ["ietf-datastores", "2018-02-14"], + ["o-ran-dhcp", "2019-07-03"], + ["ietf-netconf-nmda", "2019-01-07"], + ["nts-network-function", "2021-06-18"], + ["o-ran-udp-echo", "2019-02-04"], + ["iana-crypt-hash", "2014-08-06"]] \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/10_lifecycleNetconfSsh b/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/10_lifecycleNetconfSsh new file mode 120000 index 00000000..639f57e8 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/10_lifecycleNetconfSsh @@ -0,0 +1 @@ +../_templates/10_lifecycleNetconfSsh/ \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/22_alarmNotificationNETCONF b/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/22_alarmNotificationNETCONF new file mode 120000 index 00000000..60a2a791 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/22_alarmNotificationNETCONF @@ -0,0 +1 @@ +../_templates/22_alarmNotificationNETCONF/ \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/90_resetSimulatedDevices b/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/90_resetSimulatedDevices new file mode 120000 index 00000000..d2624a66 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/90_resetSimulatedDevices @@ -0,0 +1 @@ +../_templates/90_resetSimulatedDevices/ \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/__init__.robot b/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/__init__.robot new file mode 100644 index 00000000..2fbbea3e --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/__init__.robot @@ -0,0 +1,19 @@ +*** Settings *** +Documentation Test suite for onf core 1.2 devices +Suite Setup My Setup +Force Tags onf-core-12 +Library OperatingSystem + +*** Variables *** + + +*** Keywords *** +My Setup + Set Suite Variable ${DEVICE_TYPE} ONF_CORE_1_2 children=true + Set Suite Variable ${CORE_MODEL} 2017-03-20 children=true + Set Suite Variable ${DEVICE_TYPE_GUI} Wireless children=true + ${yang_file} = Get File ${CURDIR}/yangCapabilities.txt + Set Suite Variable ${YANG_CAPABILITIES_FILE} ${yang_file} children=true + Set Suite Variable ${IS_SUPERVISION_ALARM} ${True} + + diff --git a/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/yangCapabilities.txt b/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/yangCapabilities.txt new file mode 100644 index 00000000..6f82f463 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/onfcore12-basic/yangCapabilities.txt @@ -0,0 +1,35 @@ +[["core-model", "2017-03-20"], +["onap-system", "2020-10-26"], +["ietf-crypto-types", "2019-07-02"], +["ietf-netconf-monitoring", "2010-10-04"], +["nts-common", "2021-06-08"], +["ietf-tcp-server", "2019-07-02"], +["ietf-yang-metadata", "2016-08-05"], +["ietf-keystore", "2019-07-02"], +["ietf-inet-types", "2013-07-15"], +["ietf-netconf-acm", "2018-02-14"], +["ietf-x509-cert-to-name", "2014-12-10"], +["ietf-yang-library", "2019-01-04"], +["ietf-netconf-with-defaults", "2011-06-01"], +["ietf-origin", "2018-02-14"], +["ietf-tcp-common", "2019-07-02"], +["nc-notifications", "2008-07-14"], +["ietf-truststore", "2019-07-02"], +["yang", "2017-02-20"], +["ietf-tls-common", "2019-07-02"], +["microwave-model", "2018-10-10"], +["ietf-netconf-server", "2019-07-02"], +["ietf-netconf", "2013-09-29"], +["g.874.1-model", "2017-03-20"], +["ietf-ssh-common", "2019-07-02"], +["notifications", "2008-07-14"], +["ietf-yang-types", "2013-07-15"], +["ietf-ssh-server", "2019-07-02"], +["ietf-datastores", "2018-02-14"], +["ietf-system", "2014-08-06"], +["ietf-netconf-nmda", "2019-01-07"], +["iana-crypt-hash", "2014-08-06"], +["nts-network-function", "2021-06-18"], +["ietf-netconf-notifications", "2012-02-06"], +["ietf-tls-server", "2019-07-02"], +["ietf-tcp-client", "2019-07-02"]] \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/10_lifecycleNetconfSsh b/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/10_lifecycleNetconfSsh new file mode 120000 index 00000000..8f1d75b0 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/10_lifecycleNetconfSsh @@ -0,0 +1 @@ +../_templates/10_lifecycleNetconfSsh \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/22_alarmNotificationNETCONF b/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/22_alarmNotificationNETCONF new file mode 120000 index 00000000..8b7b5170 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/22_alarmNotificationNETCONF @@ -0,0 +1 @@ +../_templates/22_alarmNotificationNETCONF \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/90_resetSimulatedDevices b/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/90_resetSimulatedDevices new file mode 120000 index 00000000..86f3cad3 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/90_resetSimulatedDevices @@ -0,0 +1 @@ +../_templates/90_resetSimulatedDevices \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/__init__.robot b/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/__init__.robot new file mode 100644 index 00000000..4def8cd4 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/__init__.robot @@ -0,0 +1,19 @@ +*** Settings *** +Documentation Test suite for onf core 1.4 devices +Suite Setup My Setup +Force Tags onf-core-14 +Library OperatingSystem + +*** Variables *** + + +*** Keywords *** +My Setup + Set Suite Variable ${DEVICE_TYPE} ONF_CORE_1_4 children=true + Set Suite Variable ${CORE_MODEL} 2019-11-27 children=true + Set Suite Variable ${DEVICE_TYPE_GUI} Wireless children=true + ${yang_file} = Get File ${CURDIR}/yangCapabilities.txt + Set Suite Variable ${YANG_CAPABILITIES_FILE} ${yang_file} children=true + Set Suite Variable ${IS_SUPERVISION_ALARM} ${True} + + diff --git a/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/yangCapabilities.txt b/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/yangCapabilities.txt new file mode 100644 index 00000000..ddc11cca --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/onfcore14-basic/yangCapabilities.txt @@ -0,0 +1,51 @@ +[["ethernet-container-2-0", "2020-01-21"], + ["ietf-crypto-types", "2019-07-02"], + ["ietf-netconf-notifications", "2012-02-06"], + ["ietf-yang-types", "2013-07-15"], + ["vlan-fd-1-0", "2021-01-05"], + ["ietf-tcp-server", "2019-07-02"], + ["yang", "2017-02-20"], + ["notifications", "2008-07-14"], + ["iana-crypt-hash", "2014-08-06"], + ["ietf-origin", "2018-02-14"], + ["wred-profile-1-0", "2020-01-24"], + ["ietf-netconf-monitoring", "2010-10-04"], + ["ietf-tls-common", "2019-07-02"], + ["ietf-netconf-server", "2019-07-02"], + ["mac-fd-1-0", "2020-08-26"], + ["wire-interface-2-0", "2020-01-23"], + ["ietf-ssh-common", "2019-07-02"], + ["qos-profile-1-0", "2020-01-24"], + ["mac-interface-1-0", "2020-01-23"], + ["ietf-ssh-server", "2019-07-02"], + ["ietf-netconf-with-defaults", "2011-06-01"], + ["ietf-tls-server", "2019-07-02"], + ["ietf-tcp-client", "2019-07-02"], + ["onap-system", "2020-10-26"], + ["l-3vpn-profile-1-0", "2020-01-27"], + ["ietf-netconf", "2013-09-29"], + ["nts-common", "2021-06-08"], + ["mac-fc-1-0", "2020-08-26"], + ["ltp-augment-1-0", "2020-07-30"], + ["ietf-keystore", "2019-07-02"], + ["co-channel-profile-1-0", "2020-01-27"], + ["vlan-interface-1-0", "2021-01-04"], + ["ietf-yang-library", "2019-01-04"], + ["ietf-netconf-acm", "2018-02-14"], + ["ietf-x509-cert-to-name", "2014-12-10"], + ["ietf-tcp-common", "2019-07-02"], + ["tdm-container-2-0", "2020-01-23"], + ["vlan-fc-1-0", "2021-01-05"], + ["ietf-truststore", "2019-07-02"], + ["pure-ethernet-structure-2-0", "2020-01-22"], + ["ietf-system", "2014-08-06"], + ["core-model-1-4", "2019-11-27"], + ["hybrid-mw-structure-2-0", "2020-01-22"], + ["air-interface-2-0", "2020-01-21"], + ["ietf-yang-metadata", "2016-08-05"], + ["ietf-datastores", "2018-02-14"], + ["nc-notifications", "2008-07-14"], + ["ietf-netconf-nmda", "2019-01-07"], + ["ip-interface-1-0", "2020-01-24"], + ["ietf-inet-types", "2013-07-15"], + ["nts-network-function", "2021-06-18"]] \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/openroadm-basic/10_lifecycleNetconfSsh b/csit/tests/sdnr/functional/devicemanager/openroadm-basic/10_lifecycleNetconfSsh new file mode 120000 index 00000000..639f57e8 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/openroadm-basic/10_lifecycleNetconfSsh @@ -0,0 +1 @@ +../_templates/10_lifecycleNetconfSsh/ \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/openroadm-basic/22_alarmNotificationNETCONF b/csit/tests/sdnr/functional/devicemanager/openroadm-basic/22_alarmNotificationNETCONF new file mode 120000 index 00000000..60a2a791 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/openroadm-basic/22_alarmNotificationNETCONF @@ -0,0 +1 @@ +../_templates/22_alarmNotificationNETCONF/ \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/openroadm-basic/90_resetSimulatedDevices b/csit/tests/sdnr/functional/devicemanager/openroadm-basic/90_resetSimulatedDevices new file mode 120000 index 00000000..d2624a66 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/openroadm-basic/90_resetSimulatedDevices @@ -0,0 +1 @@ +../_templates/90_resetSimulatedDevices/ \ No newline at end of file diff --git a/csit/tests/sdnr/functional/devicemanager/openroadm-basic/__init__.robot b/csit/tests/sdnr/functional/devicemanager/openroadm-basic/__init__.robot new file mode 100644 index 00000000..a335edcf --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/openroadm-basic/__init__.robot @@ -0,0 +1,18 @@ +*** Settings *** +Documentation Test suite for open-roadm devices +Suite Setup My Setup +Force Tags openroadm +Library OperatingSystem + +*** Variables *** + + +*** Keywords *** +My Setup + Set Suite Variable ${DEVICE_TYPE} OPENROADM_6_1_0 children=true + Set Suite Variable ${CORE_MODEL} Unsupported children=true + Set Suite Variable ${DEVICE_TYPE_GUI} O-ROADM children=true + ${yang_file} = Get File ${CURDIR}/yangCapabilities.txt + Set Suite Variable ${YANG_CAPABILITIES_FILE} ${yang_file} children=true + + diff --git a/csit/tests/sdnr/functional/devicemanager/openroadm-basic/yangCapabilities.txt b/csit/tests/sdnr/functional/devicemanager/openroadm-basic/yangCapabilities.txt new file mode 100644 index 00000000..7efb5c0c --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/openroadm-basic/yangCapabilities.txt @@ -0,0 +1,102 @@ +[["org-openroadm-common-attributes", "2019-11-29"], +["ietf-netconf", "2011-06-01"], +["ietf-netconf-notifications", "2012-02-06"], +["org-openroadm-swdl", "2019-11-29"], +["org-openroadm-common-types", "2019-11-29"], +["ietf-tcp-server", "2019-07-02"], +["org-openroadm-switching-pool-types", "2019-11-29"], +["org-openroadm-rstp", "2019-11-29"], +["org-openroadm-pm", "2019-11-29"], +["org-openroadm-common-node-types", "2019-11-29"], +["ietf-origin", "2018-02-14"], +["iana-crypt-hash", "2014-08-06"], +["org-openroadm-interfaces", "2019-11-29"], +["org-openroadm-otn-otu-interfaces", "2019-11-29"], +["ietf-tls-common", "2019-07-02"], +["org-openroadm-common-amplifier-types", "2019-11-29"], +["org-openroadm-ppp-interfaces", "2019-11-29"], +["org-openroadm-resource", "2019-11-29"], +["openconfig-telemetry-types", "2017-08-24"], +["org-openroadm-device-types", "2019-11-29"], +["org-openroadm-ethernet-interfaces", "2019-11-29"], +["org-openroadm-pm-types", "2019-11-29"], +["ietf-tls-server", "2019-07-02"], +["ietf-netconf", "2013-09-29"], +["onap-system", "2020-10-26"], +["org-openroadm-optical-tributary-signal-interfaces", "2019-11-29"], +["nts-common", "2021-06-08"], +["org-openroadm-gcc-interfaces", "2019-11-29"], +["org-openroadm-syslog", "2019-11-29"], +["org-openroadm-common-alarm-pm-types", "2019-11-29"], +["ietf-yang-library", "2019-01-04"], +["org-openroadm-security", "2019-11-29"], +["ietf-x509-cert-to-name", "2014-12-10"], +["openconfig-telemetry", "2017-08-24"], +["org-openroadm-ip", "2019-11-29"], +["org-openroadm-optical-channel-interfaces", "2019-11-29"], +["org-openroadm-fwdl", "2019-11-29"], +["org-openroadm-dhcp", "2019-11-29"], +["org-openroadm-tca", "2019-11-29"], +["org-openroadm-manifest-file", "2019-11-29"], +["org-openroadm-flexo-interfaces", "2019-11-29"], +["org-openroadm-alarm", "2019-11-29"], +["ietf-netconf-nmda", "2019-01-07"], +["nts-network-function", "2021-06-18"], +["iana-afn-safi", "2013-07-04"], +["org-openroadm-common-state-types", "2019-11-29"], +["org-openroadm-media-channel-interfaces", "2019-11-29"], +["org-openroadm-key-chain", "2019-11-29"], +["org-openroadm-common-equipment-types", "2019-11-29"], +["ietf-crypto-types", "2019-07-02"], +["org-openroadm-network-resource", "2019-11-29"], +["openconfig-extensions", "2017-04-11"], +["ietf-netconf-with-defaults", "2011-06-01"], +["org-openroadm-otn-odu-interfaces", "2019-11-29"], +["yang", "2017-02-20"], +["org-openroadm-optical-operational-interfaces", "2019-11-29"], +["org-openroadm-user-mgmt", "2019-11-29"], +["notifications", "2008-07-14"], +["org-openroadm-wavelength-map", "2019-11-29"], +["org-openroadm-common-optical-channel-types", "2019-11-29"], +["org-openroadm-physical-types", "2019-11-29"], +["org-openroadm-telemetry-types", "2019-11-29"], +["org-openroadm-otsi-group-interfaces", "2019-11-29"], +["ietf-netconf-server", "2019-07-02"], +["org-openroadm-otsigroup-capability", "2019-11-29"], +["ietf-ssh-common", "2019-07-02"], +["ietf-ssh-server", "2019-07-02"], +["org-openroadm-maintenance-loopback", "2019-11-29"], +["org-openroadm-port-capability", "2019-11-29"], +["org-openroadm-network-media-channel-interfaces", "2019-11-29"], +["ietf-tcp-client", "2019-07-02"], +["org-openroadm-gnmi", "2019-11-29"], +["org-openroadm-layerRate", "2019-11-29"], +["org-openroadm-common-link-types", "2019-11-29"], +["org-openroadm-probable-cause", "2019-11-29"], +["org-openroadm-otn-common", "2019-11-29"], +["nc-notifications", "2008-07-14"], +["org-openroadm-de-operations", "2019-11-29"], +["org-openroadm-file-transfer", "2019-11-29"], +["org-openroadm-maintenance-testsignal", "2019-11-29"], +["org-openroadm-port-types", "2019-11-29"], +["org-openroadm-database", "2019-11-29"], +["ietf-keystore", "2019-07-02"], +["ietf-netconf-monitoring", "2010-10-04"], +["org-openroadm-optical-transport-interfaces", "2019-11-29"], +["ietf-system", "2014-08-06"], +["ietf-tcp-common", "2019-07-02"], +["ietf-netconf-acm", "2018-02-14"], +["ietf-truststore", "2019-07-02"], +["ietf-yang-metadata", "2016-08-05"], +["org-openroadm-prot-otn-linear-aps", "2019-11-29"], +["openconfig-inet-types", "2017-08-24"], +["org-openroadm-lldp", "2019-11-29"], +["org-openroadm-otn-common-types", "2019-11-29"], +["org-openroadm-flexogroup-interfaces", "2019-11-29"], +["org-openroadm-service-format", "2019-11-29"], +["ietf-yang-types", "2013-07-15"], +["ietf-inet-types", "2013-07-15"], +["org-openroadm-equipment-states-types", "2019-11-29"], +["org-openroadm-device", "2019-11-29"], +["ietf-datastores", "2018-02-14"], +["org-openroadm-resource-types", "2019-11-29"]] diff --git a/csit/tests/sdnr/functional/devicemanager/readme.md b/csit/tests/sdnr/functional/devicemanager/readme.md new file mode 100644 index 00000000..cd655220 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/readme.md @@ -0,0 +1,5 @@ +all test suites to verify FCAPS device manager functionality +_templates dir provides basic test cases for different functions +device-xyz directory contains: + __init__.robot with specific suitevariables + links to dedictaed testsuites or test cases provided by _templates dir \ No newline at end of file diff --git a/csit/tests/sdnr/healthcheck/20_healthcheckSUT.robot b/csit/tests/sdnr/healthcheck/20_healthcheckSUT.robot new file mode 100644 index 00000000..7eee7ad7 --- /dev/null +++ b/csit/tests/sdnr/healthcheck/20_healthcheckSUT.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation healthcheck of system under test: sdnc server, sdnrdb are available +Library ConnectLibrary +Library SDNCBaseLibrary +Library Collections +Library SDNRDBLib +Library ConnectApp +Library RequestsLibrary + +Suite Setup global suite setup &{GLOBAL_SUITE_SETUP_CONFIG} +Suite Teardown global suite teardown + +*** Variables *** +&{headers} Content-Type=application/json Authorization=Basic +*** Test Cases *** +Test Is SDNR Node Available + ${server_status}= Server Is Ready + should be true ${server_status} + +Test Is SDNRDB Available + ${es_version_info}= Get Sdnrdb Version Info As Dict + ${length_of_response}= Get Length ${es_version_info} + should be true ${length_of_response}>${0} + +Test Is SDNRDB Initialized + ${res}= Check Aliases + Log ${res} level=INFO + +Test Is VES Collector available + # curl -k -u sample1:sample1 https://172.40.0.1:8443 + ${auth}= Create List ${VESCOLLECTOR}[USERNAME] ${VESCOLLECTOR}[PASSWORD] + ${IPV6_ENABLED}= Get Variable Value ${ENABLE_IPV6} ${False} + Log To Console ${VESCOLLECTOR}[SCHEME]://[${VESCOLLECTOR}[IP]]:${VESCOLLECTOR}[PORT] + IF ${IPV6_ENABLED} != ${True} + RequestsLibrary.Create Session alias=ves url=${VESCOLLECTOR}[SCHEME]://${VESCOLLECTOR}[IP]:${VESCOLLECTOR}[PORT] headers=${headers} auth=${auth} + ELSE + RequestsLibrary.Create Session alias=ves url=${VESCOLLECTOR}[SCHEME]://[${VESCOLLECTOR}[IP]]:${VESCOLLECTOR}[PORT] headers=${headers} auth=${auth} + END + ${resp}= RequestsLibrary.GET On Session ves / + Should Be Equal As Strings ${resp.text} Welcome to VESCollector + Should Be Equal As Strings ${resp.status_code} 200 + RequestsLibrary.Delete All Sessions + +Test Version Info Contains Correct release + ${VERSION_INFO_DICT}= get_version_info_as_dict + ${release}= Get From Dictionary ${VERSION_INFO_DICT["""version-info"""]} Opendaylight-release + Should Contain ${release} ${RELEASE_VERSION} + diff --git a/csit/tests/sdnr/healthcheck/30_pipeCleanerPNFReg.robot b/csit/tests/sdnr/healthcheck/30_pipeCleanerPNFReg.robot new file mode 100644 index 00000000..0024fb4e --- /dev/null +++ b/csit/tests/sdnr/healthcheck/30_pipeCleanerPNFReg.robot @@ -0,0 +1,63 @@ +*** Settings *** +Documentation In a new deployment of sdnc, ves collector and message router +... the first pnf registration request fails. +... Therefore some requets are send to ensure proper working of the use case +... VES endpoint details test environemnt variable file .py +... as dictionary NETWORK_FUNCTIONS = {}, VESCOLLECTOR ={} + + +Library ConnectLibrary +Library SDNCBaseLibrary +Library NTSimManagerNG +Library ConnectApp + + +Suite Setup global suite setup &{GLOBAL_SUITE_SETUP_CONFIG} +Suite Teardown global suite teardown + + +*** Variables *** +${DEVICE_TYPE} O_RAN_FH +${CHECK_CONNECTION_STATUS} Connected +${SIM_COUNT} 1 +${PNF_REGISTRATION_TIMEOUT} 60s +${FAULT_DELAY} 5 +${TIME_PERIOD_SEND_NOTIF} 30s + +*** Test Cases *** +Add Network Function O-RAN-FH in connectApp + [Tags] healthcheck sim + [Documentation] add nf as network element connection and verifies connection status + + ConnectApp.add_network_element_connection_from_dict ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']} check_connection_status=${CHECK_CONNECTION_STATUS} + +Send pnf registration request to VES collector + [Tags] healthcheck sim + [Documentation] set details for VES endpoint details and + ... send pnf registration requests + + NTSimManagerNG.set_ves_endpoint_details_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ... ves-endpoint-ip=${VESCOLLECTOR}[IP] + ... ves-endpoint-port=${VESCOLLECTOR}[PORT] + ... ves-endpoint-auth-method=${VESCOLLECTOR}[AUTHMETHOD] + ... ves-endpoint-username=${VESCOLLECTOR}[USERNAME] + ... ves-endpoint-password=${VESCOLLECTOR}[PASSWORD] + NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ... pnf-registration=${True} + +Send VES notifications + [Tags] healthcheck sim + [Documentation] send some notifications for VES messages + NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} faults-enabled=${True} + NTSimManagerNG.set_fault_delay_list_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} delay-period=${FAULT_DELAY} + Log Send notification every ${FAULT_DELAY} sec for ${TIME_PERIOD_SEND_NOTIF} level=INFO html=False console=True repr=False + Sleep ${TIME_PERIOD_SEND_NOTIF} + NTSimManagerNG.set_fault_delay_list_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} delay-period=${0} + NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} faults-enabled=${False} + +Remove mounted devices + [Documentation] cleanup all mounted devices + [Tags] healthcheck sim + NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ... pnf-registration=${False} + ConnectApp.remove_network_element_connection_filtered validate=${True} node-id=.* diff --git a/csit/tests/sdnr/odlux/50_side_bar_elements_ODLUX_check.robot b/csit/tests/sdnr/odlux/50_side_bar_elements_ODLUX_check.robot new file mode 100644 index 00000000..7b3116bd --- /dev/null +++ b/csit/tests/sdnr/odlux/50_side_bar_elements_ODLUX_check.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Test to verify the existence and functionality of the ODLUX Side-Bar Elements. + ... Opens ODLUX and clicks on each Side-Bar Element (Data-driven), given in the SIDE_BAR_ELEMENT + ... column. Once clicking on the Side-Bar Element has been successful, a clickable web-element + ... given by the locator in the CHECK_CLICKABLE_BUTTON_VALUE column, will be checked for existence. + ... The web-element's By strategy to find the element, given by the CHECK_CLICKABLE_BUTTON_BY column, + ... (either Xpath or CSS_SELECTOR) has to be provided and is depended on the variable locator. + ... The test will Pass if both the Side-Bar Element and the clickable web-element exist, else Fail. +Library UILib +Library Collections + +Test Template Check Side Bar Elements + +*** Variables *** +${MAKE_SCREENSHOTS} ${True} +${ELEMENT_COUNT} ${0} + +*** Test Cases *** SIDE_BAR_ELEMENT CHECK_WEBELEMENT_BY CHECK_WEBELEMENT_VALUE CLICK_ON_WEB_ELEMET +Check if Side Bar Element Home exists Home CSS_SELECTOR ODLUX_WELCOME_TO_ODLUX_LABEL False +Check if Side Bar Element Connect exists Connect CSS_SELECTOR ODLUX_NETWORK_ELEMENTS_LIST_TAB_LABEL False +Check if Side Bar Element Fault exists Fault CSS_SELECTOR ODLUX_CURRENT_ALARMS_TABLE_LABEL False +Check if Side Bar Element Maintenance exists Maintenance CSS_SELECTOR ODLUX_MAINTENANCE_TABLE_FILTER_LIST_BUTTON_LABEL False +Check if Side Bar Element Configuration exists Configuration CSS_SELECTOR ODLUX_TABLE_FILTER_LIST_BUTTON_LABEL False +Check if Side Bar Element Performance exists Performance CSS_SELECTOR ODLUX_PERFORMANCE_TABLE_FILTER_LIST_BUTTON_LABEL False +Check if Side Bar Element Inventory exists Inventory CSS_SELECTOR ODLUX_INVENTORY_TABLE_LABEL False +Check if Side Bar Element Event_Log exists Event_Log CSS_SELECTOR ODLUX_EVENT_LOG_TABLE_FILTER_LIST_BUTTON_LABEL False +Check if Side Bar Element Help exists Help CSS_SELECTOR ODLUX_HELP_AND_FAQ_LABEL False +Check if Side Bar Element About exists About CSS_SELECTOR ODLUX_ABOUT_COPY_TO_CLIPBOARD_LABEL False + +Sidebar Elements Count + [Template] Check Side Bar Elements Count + ${ELEMENT_COUNT} + +*** Keywords *** +Check Side Bar Elements + [Arguments] ${side_bar_element} ${check_webelement_by} ${check_webelement_value} ${click_on_web_element} + ${ELEMENT_COUNT}= Set Variable ${${ELEMENT_COUNT}+${1}} + Set Suite Variable ${ELEMENT_COUNT} + Refresh Current Browser Tab + Log ${side_bar_element} + UILib.Click On Site Bar Element side_bar_element=${side_bar_element} + ${is_exist}= Check If Web Element Exists by=${check_webelement_by} value=${check_webelement_value} + ... click_on_web_element=${click_on_web_element} + Should Be True ${is_exist} + +Check Sidebar Elements Count + [Arguments] ${elements_count} + ${sidebar_elements}= Get All Sidebar Elements + Log ${sidebar_elements} + ${current_sidebar_elements_count}= Get Length ${sidebar_elements} + Should Be Equal As Integers ${elements_count} ${current_sidebar_elements_count} + + diff --git a/csit/tests/sdnr/odlux/onfcore14-basic-odlux/10_lifecycleNetconfSsh b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/10_lifecycleNetconfSsh new file mode 120000 index 00000000..fe272974 --- /dev/null +++ b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/10_lifecycleNetconfSsh @@ -0,0 +1 @@ +../../functional/devicemanager/_templates/10_lifecycleNetconfSsh \ No newline at end of file diff --git a/csit/tests/sdnr/odlux/onfcore14-basic-odlux/22_alarmNotificationNETCONF b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/22_alarmNotificationNETCONF new file mode 120000 index 00000000..4a3946f9 --- /dev/null +++ b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/22_alarmNotificationNETCONF @@ -0,0 +1 @@ +../../functional/devicemanager/_templates/22_alarmNotificationNETCONF \ No newline at end of file diff --git a/csit/tests/sdnr/odlux/onfcore14-basic-odlux/90_resetSimulatedDevices b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/90_resetSimulatedDevices new file mode 120000 index 00000000..423c96aa --- /dev/null +++ b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/90_resetSimulatedDevices @@ -0,0 +1 @@ +../../functional/devicemanager/_templates/90_resetSimulatedDevices/ \ No newline at end of file diff --git a/csit/tests/sdnr/odlux/onfcore14-basic-odlux/__init__.robot b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/__init__.robot new file mode 100644 index 00000000..15e6f2ef --- /dev/null +++ b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/__init__.robot @@ -0,0 +1,20 @@ +*** Settings *** +Documentation Test suite for onf core 1.4 devices via odlux +Suite Setup My Setup +Force Tags onf-core-14 +Library OperatingSystem + +*** Variables *** + + +*** Keywords *** +My Setup + Set Suite Variable ${USE_SELENIUM} ${True} + Set Suite Variable ${DEVICE_TYPE} ONF_CORE_1_4 children=true + Set Suite Variable ${CORE_MODEL} 2019-11-27 children=true + Set Suite Variable ${DEVICE_TYPE_GUI} Wireless children=true + ${yang_file} = Get File ${CURDIR}/yangCapabilities.txt + Set Suite Variable ${YANG_CAPABILITIES_FILE} ${yang_file} children=true + Set Suite Variable ${IS_SUPERVISION_ALARM} ${True} + + diff --git a/csit/tests/sdnr/odlux/onfcore14-basic-odlux/yangCapabilities.txt b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/yangCapabilities.txt new file mode 100644 index 00000000..ddc11cca --- /dev/null +++ b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/yangCapabilities.txt @@ -0,0 +1,51 @@ +[["ethernet-container-2-0", "2020-01-21"], + ["ietf-crypto-types", "2019-07-02"], + ["ietf-netconf-notifications", "2012-02-06"], + ["ietf-yang-types", "2013-07-15"], + ["vlan-fd-1-0", "2021-01-05"], + ["ietf-tcp-server", "2019-07-02"], + ["yang", "2017-02-20"], + ["notifications", "2008-07-14"], + ["iana-crypt-hash", "2014-08-06"], + ["ietf-origin", "2018-02-14"], + ["wred-profile-1-0", "2020-01-24"], + ["ietf-netconf-monitoring", "2010-10-04"], + ["ietf-tls-common", "2019-07-02"], + ["ietf-netconf-server", "2019-07-02"], + ["mac-fd-1-0", "2020-08-26"], + ["wire-interface-2-0", "2020-01-23"], + ["ietf-ssh-common", "2019-07-02"], + ["qos-profile-1-0", "2020-01-24"], + ["mac-interface-1-0", "2020-01-23"], + ["ietf-ssh-server", "2019-07-02"], + ["ietf-netconf-with-defaults", "2011-06-01"], + ["ietf-tls-server", "2019-07-02"], + ["ietf-tcp-client", "2019-07-02"], + ["onap-system", "2020-10-26"], + ["l-3vpn-profile-1-0", "2020-01-27"], + ["ietf-netconf", "2013-09-29"], + ["nts-common", "2021-06-08"], + ["mac-fc-1-0", "2020-08-26"], + ["ltp-augment-1-0", "2020-07-30"], + ["ietf-keystore", "2019-07-02"], + ["co-channel-profile-1-0", "2020-01-27"], + ["vlan-interface-1-0", "2021-01-04"], + ["ietf-yang-library", "2019-01-04"], + ["ietf-netconf-acm", "2018-02-14"], + ["ietf-x509-cert-to-name", "2014-12-10"], + ["ietf-tcp-common", "2019-07-02"], + ["tdm-container-2-0", "2020-01-23"], + ["vlan-fc-1-0", "2021-01-05"], + ["ietf-truststore", "2019-07-02"], + ["pure-ethernet-structure-2-0", "2020-01-22"], + ["ietf-system", "2014-08-06"], + ["core-model-1-4", "2019-11-27"], + ["hybrid-mw-structure-2-0", "2020-01-22"], + ["air-interface-2-0", "2020-01-21"], + ["ietf-yang-metadata", "2016-08-05"], + ["ietf-datastores", "2018-02-14"], + ["nc-notifications", "2008-07-14"], + ["ietf-netconf-nmda", "2019-01-07"], + ["ip-interface-1-0", "2020-01-24"], + ["ietf-inet-types", "2013-07-15"], + ["nts-network-function", "2021-06-18"]] \ No newline at end of file diff --git a/data-migrator/pom.xml b/data-migrator/pom.xml deleted file mode 100644 index f9470a0c..00000000 --- a/data-migrator/pom.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - 4.0.0 - - - org.onap.sdnc.oam - sdnc-oam - 2.0.0-SNAPSHOT - - - org.onap.sdnc.oam - data-migrator - 2.0.0-SNAPSHOT - jar - - sdnc-oam :: data-migrator - MDSAL Data Migrator - - - 2.9.4 - 2.0 - true - yyyyMMdd'T'HHmmss'Z' - ${maven.build.timestamp} - ${project.version}-${build.number} - - - - - - - - - - org.slf4j - slf4j-api - 1.7.21 - - - org.slf4j - slf4j-log4j12 - 1.6.1 - compile - - - log4j - log4j - 1.2.17 - - - junit - junit - ${junit.version} - test - - - com.google.code.gson - gson - 2.8.5 - - - org.apache.commons - commons-lang3 - 3.5 - - - org.reflections - reflections - 0.9.9-RC1 - - - com.beust - jcommander - 1.48 - - - com.github.tomakehurst - wiremock-standalone - 2.18.0 - test - - - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - true - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-jar-plugin - 2.6 - - - - true - org.onap.sdnc.oam.datamigrator.DataMigration - - - - - - maven-assembly-plugin - 2.6 - - - create-zip - - single - - package - - true - ${project.artifactId}.${project.version} - true - - src/assembly/assemble_zip.xml - - false - - - - - - - - diff --git a/data-migrator/src/assembly/assemble_zip.xml b/data-migrator/src/assembly/assemble_zip.xml deleted file mode 100644 index 604adf30..00000000 --- a/data-migrator/src/assembly/assemble_zip.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - assemble_zip - - zip - - - false - - - - src/main/scripts - bin - - - target - lib - - *.jar - - - - src/main/resources - properties - - *.properties - - - - - - lib - true - runtime - - - diff --git a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/DataMigration.java b/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/DataMigration.java deleted file mode 100644 index ac53f448..00000000 --- a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/DataMigration.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DataMigration { - - private static final Logger LOG = LoggerFactory.getLogger(DataMigration.class); - - public static void main(String[] args) { - try { - DataMigrationInternal dataMigrationInternal = new DataMigrationInternal(LOG); - dataMigrationInternal.run(args); - }catch (Exception e){ - e.printStackTrace(); - LOG.error("Error in DataMigration" + e.getMessage()); - } - return; - } -} diff --git a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/DataMigrationInternal.java b/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/DataMigrationInternal.java deleted file mode 100644 index ae497235..00000000 --- a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/DataMigrationInternal.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator; - -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Strings; -import org.onap.sdnc.oam.datamigrator.common.Description; -import org.onap.sdnc.oam.datamigrator.common.MigratorConfiguration; -import org.onap.sdnc.oam.datamigrator.common.Operation; -import org.onap.sdnc.oam.datamigrator.migrators.Migrator; -import org.reflections.Reflections; -import org.slf4j.Logger; - -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -public class DataMigrationInternal { - - private final Logger log; - - public DataMigrationInternal(Logger log) { - this.log = log; - } - - private void logAndPrint(String msg) { - System.out.println(msg); - log.info(msg); - } - - public void run(String[] args){ - CommandLineArgs cArgs = new CommandLineArgs(); - JCommander jCommander = new JCommander(cArgs, args); - jCommander.setProgramName(DataMigration.class.getSimpleName()); - - if (cArgs.help) { - jCommander.usage(); - return; - } - - Set> migratorList = getMigratorList(); - if(cArgs.scripts.size() > 0){ - migratorList = migratorList.stream().filter(aClass -> cArgs.scripts.contains(aClass.getSimpleName())).collect(Collectors.toSet()); - } - if(cArgs.excludeClasses.size() > 0){ - migratorList = migratorList.stream().filter(aClass -> !cArgs.excludeClasses.contains(aClass.getSimpleName())).collect(Collectors.toSet()); - } - - if(migratorList.size()>0) { - logAndPrint("Total number of available migrations: " + migratorList.size()); - if(cArgs.list) { - logAndPrint("List of available migrations:"); - for (Class migrator : migratorList) { - if(migrator.getAnnotation(Description.class) != null && !migrator.getAnnotation(Description.class).value().isEmpty()) { - logAndPrint(migrator.getSimpleName()+ ": " + migrator.getAnnotation(Description.class).value() ); - }else { - logAndPrint(migrator.getSimpleName()); - } - } - }else { - Operation operation; - try { - operation = Operation.valueOf(cArgs.operation.toUpperCase()); - logAndPrint("Starting operation: " + operation.name()); - }catch (IllegalArgumentException e) { - logAndPrint("Invalid operation: " + cArgs.operation +". Supported operations are: Migrate, Backup, Restore."); - return; - } - boolean success = true; - MigratorConfiguration config; - if(!Strings.isStringEmpty(cArgs.config)){ - config = new MigratorConfiguration(cArgs.config); - }else { - logAndPrint("No external configuration provided. Initializing Default configuration."); - config = new MigratorConfiguration(); - } - for (Class migratorClass : migratorList) { - logAndPrint("Started executing migrator: "+ migratorClass.getSimpleName()); - try { - Migrator migrator = migratorClass.newInstance(); - migrator.init(config); - migrator.run(operation); - success = success && migrator.isSuccess(); - } catch (InstantiationException | IllegalAccessException e) { - logAndPrint("Error instantiating migrator: " + migratorClass); - success=false; - } - logAndPrint("Completed execution for migrator "+ migratorClass.getSimpleName() +" with status: " + success); - } - if(success){ - logAndPrint(operation.name()+ " operation completed Successfully."); - }else{ - logAndPrint("Error during "+ operation.name() +" operation. Check logs for details."); - } - } - }else{ - logAndPrint("No migrations available."); - } - } - - private Set> getMigratorList() { - Reflections reflections = new Reflections("org.onap.sdnc.oam.datamigrator.migrators"); - return reflections.getSubTypesOf(Migrator.class).stream().filter(aClass -> !Modifier.isAbstract(aClass.getModifiers())).collect(Collectors.toSet()); - } - - class CommandLineArgs { - - @Parameter(names = "--h", help = true) - public boolean help; - - @Parameter(names = "-o", description = "Operation to be performed. Default is Migrate. Supported operations: Migrate , Backup , Restore.") - public String operation = "Migrate"; - - @Parameter(names = "-c", description = "Configuration File path / directory") - public String config; - - @Parameter(names = "-m", description = "Names of migration scripts to run") - public List scripts = new ArrayList<>(); - - @Parameter(names = "-l", description = "List the available of migrations") - public boolean list = false; - - @Parameter(names = "-e", description = "Exclude list of migrator classes") - public List excludeClasses = new ArrayList<>(); - } - - -} diff --git a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/Description.java b/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/Description.java deleted file mode 100644 index 3eaf562d..00000000 --- a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/Description.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator.common; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface Description { - String value() default ""; -} diff --git a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/MigratorConfiguration.java b/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/MigratorConfiguration.java deleted file mode 100644 index 40a1b920..00000000 --- a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/MigratorConfiguration.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator.common; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.URL; -import java.util.Properties; - -public class MigratorConfiguration { - - private String sourceHost ; - private String sourceUser ; - private String sourcePassword ; - private String targetHost ; - private String targetUser ; - private String targetPassword ; - private String dataPath; - - private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; - private static final Logger LOG = LoggerFactory - .getLogger(MigratorConfiguration.class); - - public MigratorConfiguration (){ - String propDir = System.getenv(SDNC_CONFIG_DIR); - if (propDir == null) { - propDir = "/opt/sdnc/data/properties"; - } - try { - init(propDir); - } catch (Exception e) { - LOG.error("Cannot initialize MigratorConfiguration", e); - } - } - - public MigratorConfiguration (String propDir){ - try { - init(propDir); - } catch (Exception e) { - LOG.error("Cannot initialize MigratorConfiguration", e); - } - } - - public void init(String propDir) throws IOException { - String propPath = propDir + "/data-migrator.properties"; - URL propPathUrl= getClass().getClassLoader().getResource(propPath); - File propFile = (propPathUrl != null) ? new File(propPathUrl.getFile()) : new File(propPath); - if (!propFile.exists()) { - throw new FileNotFoundException( - "Missing configuration properties file : " - + propFile); - } - - Properties props = new Properties(); - props.load(new FileInputStream(propFile)); - this.sourceHost = props.getProperty("org.onap.sdnc.datamigrator.source.host"); - this.sourceUser = props.getProperty("org.onap.sdnc.datamigrator.source.user"); - this.sourcePassword = props.getProperty("org.onap.sdnc.datamigrator.source.password"); - this.targetHost = props.getProperty("org.onap.sdnc.datamigrator.target.host"); - this.targetUser = props.getProperty("org.onap.sdnc.datamigrator.target.user"); - this.targetPassword = props.getProperty("org.onap.sdnc.datamigrator.target.password"); - this.dataPath = props.getProperty("org.onap.sdnc.datamigrator.data.path"); - } - - public String getSourceHost() { - return sourceHost; - } - - public String getSourceUser() { - return sourceUser; - } - - public String getSourcePassword() { - return sourcePassword; - } - - public String getTargetHost() { - return targetHost; - } - - public String getTargetUser() { - return targetUser; - } - - public String getTargetPassword() { - return targetPassword; - } - - public String getDataPath() { - return dataPath; - } - - public void setDataPath(String dataPath) { - this.dataPath = dataPath; - } -} diff --git a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/Operation.java b/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/Operation.java deleted file mode 100644 index df6cd00a..00000000 --- a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/Operation.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator.common; - -public enum Operation { - RESTORE,MIGRATE,BACKUP -} diff --git a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/RestconfClient.java b/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/RestconfClient.java deleted file mode 100644 index b7722b6d..00000000 --- a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/common/RestconfClient.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator.common; - -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.onap.sdnc.oam.datamigrator.exceptions.RestconfException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import java.io.BufferedReader; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.Authenticator; -import java.net.HttpURLConnection; -import java.net.PasswordAuthentication; -import java.net.URL; -import java.util.Base64; - -public class RestconfClient { - - private HttpURLConnection httpConn = null; - private final String host ; - private final String user ; - private final String password ; - private static final String CONFIG_PATH = "/restconf/config/"; - private static final String CONTENT_TYPE_JSON = "application/json"; - private final Logger log = LoggerFactory.getLogger(RestconfClient.class); - - public RestconfClient (String host , String user , String password){ - this.host = host; - this.user = user; - this.password = password; - } - - private class SdncAuthenticator extends Authenticator { - - private final String user; - private final String passwd; - - SdncAuthenticator(String user, String passwd) { - this.user = user; - this.passwd = passwd; - } - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(user, passwd.toCharArray()); - } - } - - public JsonObject get(String path) throws RestconfException { - String getResponse = send(path,"GET",CONTENT_TYPE_JSON,""); - JsonParser parser = new JsonParser(); - return parser.parse(getResponse).getAsJsonObject(); - } - - public void put(String path, String data) throws RestconfException { - send(path,"PUT",CONTENT_TYPE_JSON, data ); - } - - private String send(String path,String method, String contentType, String msg) throws RestconfException { - Authenticator.setDefault(new SdncAuthenticator(user, password)); - String url = host + CONFIG_PATH + path; - try { - URL sdncUrl = new URL(url); - log.info("SDNC url: " + url); - log.info("Method: " + method); - this.httpConn = (HttpURLConnection) sdncUrl.openConnection(); - String authStr = user + ":" + password; - String encodedAuthStr = new String(Base64.getEncoder().encode(authStr.getBytes())); - httpConn.addRequestProperty("Authentication", "Basic " + encodedAuthStr); - - httpConn.setRequestMethod(method); - httpConn.setRequestProperty("Content-Type", contentType); - httpConn.setRequestProperty("Accept", contentType); - - httpConn.setDoInput(true); - httpConn.setDoOutput(true); - httpConn.setUseCaches(false); - - if (httpConn instanceof HttpsURLConnection) { - HostnameVerifier hostnameVerifier = (hostname, session) -> true; - ((HttpsURLConnection) httpConn).setHostnameVerifier(hostnameVerifier); - } - if (!method.equals("GET")) { - log.info("Request payload: " + msg); - httpConn.setRequestProperty("Content-Length", "" + msg.length()); - DataOutputStream outStr = new DataOutputStream(httpConn.getOutputStream()); - outStr.write(msg.getBytes()); - outStr.close(); - } - - BufferedReader respRdr; - log.info("Response: " + httpConn.getResponseCode() + " " + httpConn.getResponseMessage()); - - if (httpConn.getResponseCode() < 300) { - respRdr = new BufferedReader(new InputStreamReader(httpConn.getInputStream())); - } else { - respRdr = new BufferedReader(new InputStreamReader(httpConn.getErrorStream())); - log.error("Error during restconf operation: "+ method + ". URL:" + sdncUrl.toString()+". Response:"+respRdr); - throw new RestconfException(httpConn.getResponseCode(),"Error during restconf operation: "+ method +". Response:"+respRdr); - } - - StringBuilder respBuff = new StringBuilder(); - String respLn; - while ((respLn = respRdr.readLine()) != null) { - respBuff.append(respLn).append("\n"); - } - respRdr.close(); - String respString = respBuff.toString(); - - log.info("Response body :\n" + respString); - return respString; - }catch (IOException e){ - throw new RestconfException(500,e.getMessage(),e); - }finally { - if (httpConn != null) { - httpConn.disconnect(); - } - } - } - - -} diff --git a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/exceptions/RestconfException.java b/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/exceptions/RestconfException.java deleted file mode 100644 index 6b714c29..00000000 --- a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/exceptions/RestconfException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator.exceptions; - -public class RestconfException extends Exception{ - - private final int errorCode; - private final String errorMessage; - - public RestconfException(int errorCode, String errorMessage) { - super(errorMessage); - this.errorCode = errorCode; - this.errorMessage = errorMessage; - } - - public RestconfException(int errorCode, String errorMessage, Throwable e) { - super(errorMessage,e); - this.errorCode = errorCode; - this.errorMessage = errorMessage; - } - - public int getErrorCode() { - return errorCode; - } - - public String getErrorMessage() { - return errorMessage; - } -} diff --git a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/migrators/Migrator.java b/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/migrators/Migrator.java deleted file mode 100644 index e44a2c73..00000000 --- a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/migrators/Migrator.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator.migrators; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import org.onap.sdnc.oam.datamigrator.common.MigratorConfiguration; -import org.onap.sdnc.oam.datamigrator.common.Operation; -import org.onap.sdnc.oam.datamigrator.common.RestconfClient; -import org.onap.sdnc.oam.datamigrator.exceptions.RestconfException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; - -public abstract class Migrator { - - protected RestconfClient sourceClient; - protected RestconfClient targetClient; - protected boolean success = true; - private MigratorConfiguration config; - private final Logger log = LoggerFactory.getLogger(PreloadInformationMigrator.class); - - - public void run(Operation operation){ - { - JsonObject sourceData; - if(operation != Operation.RESTORE) { - - try { - sourceData = sourceClient.get(getYangModuleName()+":"+ getSourcePath()); - if(operation == Operation.BACKUP){ - String fileName = getFileName(); - try { - BufferedWriter writer = new BufferedWriter(new FileWriter(fileName)); - writer.write(sourceData.toString()); - writer.close(); - } catch (IOException e) { - log.error("Error writing data to file : " + fileName, e); - success = false; - return; - } - return; - } - } catch (RestconfException e) { - if(e.getErrorCode() == 404){ - log.error("No data available for migration. Returning silent success.", e); - success = true; - }else { - log.error("Error retrieving data from MD-SAL store. Error code: " + e.getErrorCode() + ". Error message:" + e.getErrorMessage(), e); - success = false; - } - return; - } - }else { - String fileName = getFileName(); - try { - Gson gson = new Gson(); - sourceData = gson.fromJson(new BufferedReader(new FileReader(fileName)),JsonObject.class); - } catch (IOException e) { - log.error("Error Reading data from file : " + fileName, e); - success = false; - return; - } - } - try { - String targetData = convertData(sourceData); - targetClient.put(getYangModuleName()+":"+ getTargetPath(),targetData); - } catch (RestconfException e) { - log.error("Error loading data to MD-SAL store. Error code: "+e.getErrorCode()+". Error message:"+e.getErrorMessage(),e); - success=false; - } - } - } - - private String getFileName() { - return config.getDataPath()+ "/" + getYangModuleName()+ "_"+ getSourcePath()+"_"+ getTargetPath() + ".json"; - } - - protected abstract String convertData(JsonObject sourceData); - - public abstract String getYangModuleName(); - public abstract String getSourcePath(); - public abstract String getTargetPath(); - - public void init(MigratorConfiguration config){ - this.config = config; - sourceClient = new RestconfClient(config.getSourceHost(),config.getSourceUser(),config.getSourcePassword()); - targetClient = new RestconfClient(config.getTargetHost(),config.getTargetUser(),config.getTargetPassword()); - } - - public RestconfClient getSourceClient() { - return sourceClient; - } - - public void setSourceClient(RestconfClient sourceClient) { - this.sourceClient = sourceClient; - } - - public RestconfClient getTargetClient() { - return targetClient; - } - - public void setTargetClient(RestconfClient targetClient) { - this.targetClient = targetClient; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } -} - diff --git a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/migrators/PreloadInformationMigrator.java b/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/migrators/PreloadInformationMigrator.java deleted file mode 100644 index d259c216..00000000 --- a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/migrators/PreloadInformationMigrator.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator.migrators; - -import org.onap.sdnc.oam.datamigrator.common.Description; - -import java.util.HashMap; -import java.util.HashSet; - -@Description("Migrator for container 'preload-vnf' in GENERIC-RESOURCE-API.yang") -public class PreloadInformationMigrator extends RenameDeleteLeafMigrator { - - private static final String YANG_MODULE = "GENERIC-RESOURCE-API"; - - static{ - deletedFields = new HashSet<>(); - deletedFields.add("preload-vnfs.vnf-preload-list.preload-data.vnf-topology-information"); - deletedFields.add("preload-vnfs.vnf-preload-list.preload-data.network-topology-information.network-topology-identifier.service-type"); - deletedFields.add("preload-vnfs.vnf-preload-list.preload-data.oper-status.last-action"); - renamedFields = new HashMap<>(); - renamedFields.put("preload-vnfs","preload-information"); - renamedFields.put("preload-vnfs.vnf-preload-list","preload-list"); - renamedFields.put("preload-vnfs.vnf-preload-list.vnf-type","preload-type"); - renamedFields.put("preload-vnfs.vnf-preload-list.vnf-name","preload-id"); - renamedFields.put("preload-vnfs.vnf-preload-list.preload-data.oper-status","preload-oper-status"); - renamedFields.put("preload-vnfs.vnf-preload-list.preload-data.network-topology-information","preload-network-topology-information"); - renamedFields.put("preload-vnfs.vnf-preload-list.preload-data.network-topology-information.network-topology-identifier","network-topology-identifier-structure"); - } - - @Override - public String getYangModuleName() { - return YANG_MODULE; - } - - @Override - public String getSourcePath() { - return "preload-vnfs"; - } - - @Override - public String getTargetPath() { - return "preload-information"; - } -} diff --git a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/migrators/RenameDeleteLeafMigrator.java b/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/migrators/RenameDeleteLeafMigrator.java deleted file mode 100644 index 8c0adc0c..00000000 --- a/data-migrator/src/main/java/org/onap/sdnc/oam/datamigrator/migrators/RenameDeleteLeafMigrator.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator.migrators; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import org.apache.commons.lang3.StringUtils; -import java.util.Map; -import java.util.Set; - -public abstract class RenameDeleteLeafMigrator extends Migrator { - - protected static Map renamedFields ; - protected static Set deletedFields ; - - @Override - protected String convertData(JsonObject sourceData) { - JsonObject target = convert(sourceData,""); - return target.toString(); - } - - protected JsonObject convert(JsonObject source,String parent) { - JsonObject target = new JsonObject(); - for (String key : source.keySet()){ - String prefixKey = StringUtils.isNotEmpty(parent) ? parent + "."+key : key; - if(!deletedFields.contains(prefixKey)) { - JsonElement value = source.get(key); - if (value.isJsonPrimitive()) { - target.add(renamedFields.getOrDefault(prefixKey,key), value); - } else if(value.isJsonArray()){ - JsonArray targetList = new JsonArray(); - JsonArray sourceArray = value.getAsJsonArray(); - for(JsonElement e : sourceArray){ - targetList.add(convert(e.getAsJsonObject(),prefixKey)); - } - target.add(renamedFields.getOrDefault(prefixKey,key), targetList); - } else{ - target.add(renamedFields.getOrDefault(prefixKey,key), convert(value.getAsJsonObject(),prefixKey)); - } - } - } - return target; - } -} diff --git a/data-migrator/src/main/resources/log4j.properties b/data-migrator/src/main/resources/log4j.properties deleted file mode 100644 index d53dc5a8..00000000 --- a/data-migrator/src/main/resources/log4j.properties +++ /dev/null @@ -1,37 +0,0 @@ -### -# ============LICENSE_START======================================================= -# openECOMP : SDN-C -# ================================================================================ -# Copyright (C) 2019 AMDOCS -# ================================================================================ -# 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========================================================= -### - -log4j.rootLogger=DEBUG,CONSOLE,LOGFILE - -# CONSOLE is set to be a ConsoleAppender using a PatternLayout. -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.Threshold=DEBUG -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n - - -# LOGFILE is set to be a File appender using a PatternLayout. -log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender -log4j.appender.LOGFILE.File=/opt/app/data-migrator/data-migrator.log -log4j.appender.LOGFILE.Append=true -log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.LOGFILE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n -log4j.appender.LOGFILE.MaxFileSize=10MB -log4j.appender.LOGFILE.MaxBackupIndex=10 diff --git a/data-migrator/src/main/scripts/runMigration.sh b/data-migrator/src/main/scripts/runMigration.sh deleted file mode 100644 index e763acbe..00000000 --- a/data-migrator/src/main/scripts/runMigration.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -### -# ============LICENSE_START======================================================= -# openECOMP : SDN-C -# ================================================================================ -# Copyright (C) 2019 AMDOCS -# ================================================================================ -# 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========================================================= -### - -PROPERTY_DIR=${PROPERTY_DIR:-/opt/onap/sdnc/data/properties} -MIGRATION=data-migrator -MIGRATION_ROOT=${MIGRATION_ROOT:-/opt/onap/sdnc/data-migrator} -JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-8-oracle} -JAVA_OPTS=${JAVA_OPTS:--Dhttps.protocols=TLSv1.1,TLSv1.2} -JAVA=${JAVA:-${JAVA_HOME}/bin/java} - -# Redirect output from script to MIGRATION.out -exec >> ${MIGRATION_ROOT}/logs/$MIGRATION.out -exec 2>&1 - -if [ ! -d ${MIGRATION_ROOT}/logs ] -then - mkdir ${MIGRATION_ROOT}/logs -fi - -for file in ${MIGRATION_ROOT}/lib/*.jar -do - CLASSPATH=$CLASSPATH:$file -done - -${JAVA} ${JAVA_OPTS} -Dlog4j.configuration=file:${MIGRATION_ROOT}/properties/log4j.properties -cp ${CLASSPATH} org.onap.sdnc.oam.datamigrator.DataMigration $@ - -echo $! - -exit 0 diff --git a/data-migrator/src/test/java/org/onap/sdnc/oam/datamigrator/DataMigrationInternalTest.java b/data-migrator/src/test/java/org/onap/sdnc/oam/datamigrator/DataMigrationInternalTest.java deleted file mode 100644 index 18cd662f..00000000 --- a/data-migrator/src/test/java/org/onap/sdnc/oam/datamigrator/DataMigrationInternalTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator; - -import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; -import org.junit.Rule; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintStream; -import java.net.URISyntaxException; -import java.nio.file.Files; -import java.nio.file.Paths; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.put; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static org.hamcrest.MatcherAssert.assertThat; - -public class DataMigrationInternalTest { - - @Rule - public WireMockRule source = new WireMockRule(8081); - @Rule - public WireMockRule target = new WireMockRule(8082); - - private static final Logger LOG = LoggerFactory.getLogger(DataMigrationInternal.class); - DataMigrationInternal dataMigrationInternal = new DataMigrationInternal(LOG); - private ClassLoader classLoader = getClass().getClassLoader(); - private String preloadVnfResponseJson = new String(Files.readAllBytes(Paths.get(classLoader.getResource("wiremock/preloadVnfResponse.json").toURI()))); - private String preloadInformationRequestJson = new String(Files.readAllBytes(Paths.get(classLoader.getResource("wiremock/preloadInformationRequest.json").toURI()))); - - public DataMigrationInternalTest() throws IOException, URISyntaxException { - } - - @Test - public void runPositiveTest() { - String [] args = {"-c","migration/props"}; - PrintStream oldOutputStream = System.out; - final ByteArrayOutputStream myOut = new ByteArrayOutputStream(); - System.setOut(new PrintStream(myOut)); - source.stubFor(get(urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-vnfs")).willReturn( - aResponse() - .withStatus(200) - .withBody(preloadVnfResponseJson))); - target.stubFor(put(urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-information")).withRequestBody(WireMock.equalTo(preloadInformationRequestJson)).willReturn( - aResponse() - .withStatus(200))); - dataMigrationInternal.run(args); - String content = myOut.toString(); - assertThat("Migration failed", content.contains("MIGRATE operation completed Successfully.")); - System.setOut(oldOutputStream); - } - - @Test - public void runTestWithNoData() { - String [] args = {"-c","migration/props"}; - PrintStream oldOutputStream = System.out; - final ByteArrayOutputStream myOut = new ByteArrayOutputStream(); - System.setOut(new PrintStream(myOut)); - source.stubFor(get(urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-vnfs")) - .willReturn(aResponse().withStatus(404))); - target.stubFor(put(urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-information")) - .withRequestBody(WireMock.equalTo(preloadInformationRequestJson)).willReturn(aResponse().withStatus(200))); - dataMigrationInternal.run(args); - String content = myOut.toString(); - assertThat("Migration failed", content.contains("MIGRATE operation completed Successfully.")); - System.setOut(oldOutputStream); - } -} \ No newline at end of file diff --git a/data-migrator/src/test/java/org/onap/sdnc/oam/datamigrator/common/RestconfClientTest.java b/data-migrator/src/test/java/org/onap/sdnc/oam/datamigrator/common/RestconfClientTest.java deleted file mode 100644 index bbffd608..00000000 --- a/data-migrator/src/test/java/org/onap/sdnc/oam/datamigrator/common/RestconfClientTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator.common; - -import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.junit.Rule; -import org.junit.Test; -import org.onap.sdnc.oam.datamigrator.exceptions.RestconfException; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Files; -import java.nio.file.Paths; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.put; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -public class RestconfClientTest { - - @Rule - public WireMockRule service = new WireMockRule(8081); - private RestconfClient restconfClient = new RestconfClient("http://localhost:8081","admin","Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"); - private ClassLoader classLoader = getClass().getClassLoader(); - private String preloadVnfResponseJson = new String(Files.readAllBytes(Paths.get(classLoader.getResource("wiremock/preloadVnfResponse.json").toURI()))); - private String preloadInformationRequestJson = new String(Files.readAllBytes(Paths.get(classLoader.getResource("wiremock/preloadInformationRequest.json").toURI()))); - - - JsonObject expectedJsonObject = new JsonParser().parse(preloadVnfResponseJson).getAsJsonObject(); - - public RestconfClientTest() throws IOException, URISyntaxException { - } - - @Test - public void getPositiveTest() { - service.stubFor(get(urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-vnfs")) - .willReturn(aResponse().withStatus(200).withBody(preloadVnfResponseJson))); - JsonObject actualResponse=null; - try { - actualResponse = restconfClient.get("GENERIC-RESOURCE-API:preload-vnfs"); - } catch (RestconfException e) { - e.printStackTrace(); - } - assertEquals(expectedJsonObject,actualResponse); - } - - @Test - public void getNegativeTest() { - service.stubFor(get(urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-vnfs")) - .willReturn(aResponse().withStatus(404))); - JsonObject actualResponse=null; - try { - actualResponse = restconfClient.get("GENERIC-RESOURCE-API:preload-vnfs"); - } catch (RestconfException e) { - e.printStackTrace(); - } - assertNull(actualResponse); - } - - @Test - public void putPositiveTest() { - service.stubFor(put(urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-information")) - .withRequestBody(WireMock.equalTo(preloadInformationRequestJson)).willReturn(aResponse().withStatus(200))); - Exception ex = null; - try { - restconfClient.put("GENERIC-RESOURCE-API:preload-information", preloadInformationRequestJson); - } catch (RestconfException e) { - ex =e; - } - assertNull(ex); - } - - @Test - public void putNegativeTest() { - service.stubFor(put(urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-information")) - .withRequestBody(WireMock.equalTo(preloadInformationRequestJson)).willReturn(aResponse().withStatus(500))); - try { - restconfClient.put("GENERIC-RESOURCE-API:preload-information", preloadInformationRequestJson); - } catch (RestconfException e) { - assertTrue(e.getErrorMessage().contains("Error during restconf operation: PUT.")); - } - } -} \ No newline at end of file diff --git a/data-migrator/src/test/java/org/onap/sdnc/oam/datamigrator/datamigrator/PreloadInformationMigratorTest.java b/data-migrator/src/test/java/org/onap/sdnc/oam/datamigrator/datamigrator/PreloadInformationMigratorTest.java deleted file mode 100644 index 7972b7ab..00000000 --- a/data-migrator/src/test/java/org/onap/sdnc/oam/datamigrator/datamigrator/PreloadInformationMigratorTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : SDNC - * ================================================================================ - * Copyright 2019 AMDOCS - *================================================================================= - * 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========================================================= - */ -package org.onap.sdnc.oam.datamigrator.datamigrator; - -import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; -import org.junit.Rule; -import org.junit.Test; -import org.onap.sdnc.oam.datamigrator.common.Operation; -import org.onap.sdnc.oam.datamigrator.common.RestconfClient; -import org.onap.sdnc.oam.datamigrator.migrators.PreloadInformationMigrator; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Files; -import java.nio.file.Paths; - -public class PreloadInformationMigratorTest { - - @Rule - public WireMockRule service1 = new WireMockRule(8081); - - @Rule - public WireMockRule service2 = new WireMockRule(8082); - PreloadInformationMigrator migrator = new PreloadInformationMigrator(); - private ClassLoader classLoader = getClass().getClassLoader(); - private String preloadVnfResponseJson = new String(Files.readAllBytes(Paths.get(classLoader.getResource("wiremock/preloadVnfResponse.json").toURI()))); - private String preloadInformationRequestJson = new String(Files.readAllBytes(Paths.get(classLoader.getResource("wiremock/preloadInformationRequest.json").toURI()))); - - public PreloadInformationMigratorTest() throws IOException, URISyntaxException { - } - - @Test - public void testRun (){ - service1.stubFor(WireMock.get(WireMock.urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-vnfs")).willReturn( - WireMock.aResponse() - .withStatus(200) - .withBody(preloadVnfResponseJson))); - service2.stubFor(WireMock.put(WireMock.urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-information")).withRequestBody(WireMock.equalTo(preloadInformationRequestJson)).willReturn( - WireMock.aResponse() - .withStatus(200))); - RestconfClient sourceClient = new RestconfClient("http://localhost:8081","admin","Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"); - migrator.setSourceClient(sourceClient); - RestconfClient targetClient = new RestconfClient("http://localhost:8082","admin","Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"); - migrator.setTargetClient(targetClient); - migrator.run(Operation.MIGRATE); - } - - @Test - public void testRunNoData (){ - service1.stubFor(WireMock.get(WireMock.urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-vnfs")).willReturn( - WireMock.aResponse() - .withStatus(404))); - service2.stubFor(WireMock.put(WireMock.urlEqualTo("/restconf/config/GENERIC-RESOURCE-API:preload-information")).withRequestBody(WireMock.equalTo(preloadInformationRequestJson)).willReturn( - WireMock.aResponse() - .withStatus(200))); - RestconfClient sourceClient = new RestconfClient("http://localhost:8081","admin","Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"); - migrator.setSourceClient(sourceClient); - RestconfClient targetClient = new RestconfClient("http://localhost:8082","admin","Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"); - migrator.setTargetClient(targetClient); - migrator.run(Operation.MIGRATE); - } -} diff --git a/data-migrator/src/test/resources/wiremock/preloadInformationRequest.json b/data-migrator/src/test/resources/wiremock/preloadInformationRequest.json deleted file mode 100644 index 82df627b..00000000 --- a/data-migrator/src/test/resources/wiremock/preloadInformationRequest.json +++ /dev/null @@ -1 +0,0 @@ -{"preload-information":{"preload-list":[{"preload-type":"vnf-type","preload-id":"vnf-name","preload-data":{"preload-oper-status":{"modify-timestamp":"Some modify-timestamp","create-timestamp":"Some create-timestamp","last-order-status":"Active","order-status":"Active","maintenance-indicator":"Y","last-svc-request-id":"Some last-svc-request-id"},"preload-network-topology-information":{"is-provider-network":true,"network-topology-identifier-structure":{"network-role":"Some network-role","network-technology":"Some network-technology","network-type":"Some network-type","network-name":"Some network-name"},"route-table-reference":[{"route-table-reference-fqdn":"Some route-table-reference-fqdn","route-table-reference-id":"Some route-table-reference-id"}],"network-policy":[{"network-policy-fqdn":"Some network-policy-fqdn","network-policy-id":"Some network-policy-id"}],"subnets":[{"start-address":"1.1.11.2","gateway-address":"8.0.25.2","cidr-mask":"Some cidr-mask","dhcp-end-address":"Some dhcp-end-address","subnet-name":"Some subnet-name","dhcp-start-address":"Some dhcp-start-address","ip-version":"Some ip-version","dhcp-enabled":"Y"}],"vpn-bindings":[{"vpn-binding-id":"Some vpn-binding-id","global-route-target":"Some global-route-target"}],"is-external-network":true,"is-shared-network":true,"physical-network-name":"Some physical-network-name"}}}]}} \ No newline at end of file diff --git a/data-migrator/src/test/resources/wiremock/preloadVnfResponse.json b/data-migrator/src/test/resources/wiremock/preloadVnfResponse.json deleted file mode 100644 index 006d62f7..00000000 --- a/data-migrator/src/test/resources/wiremock/preloadVnfResponse.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "preload-vnfs": { - "vnf-preload-list": [ - { - "vnf-type": "vnf-type", - "vnf-name": "vnf-name", - "preload-data": { - "oper-status": { - "last-action": "VNFActivateRequest", - "modify-timestamp": "Some modify-timestamp", - "create-timestamp": "Some create-timestamp", - "last-order-status": "Active", - "order-status": "Active", - "maintenance-indicator": "Y", - "last-svc-request-id": "Some last-svc-request-id" - }, - "vnf-topology-information": { - "vnf-topology-identifier": { - "service-type": "Some service-type", - "service-id": "Some service-id", - "generic-vnf-name": "Some generic-vnf-name", - "generic-vnf-id": "Some generic-vnf-id", - "generic-vnf-type": "Some generic-vnf-type", - "vnf-type": "vnf-type", - "vnf-name": "vnf-name" - }, - "vnf-parameters": [ - { - "vnf-parameter-name": "Some vnf-parameter-name", - "vnf-parameter-value": "Some vnf-parameter-value" - } - ], - "vnf-assignments": { - "vnf-vms": [ - { - "vm-type": "Some vm-type", - "vm-count": 0, - "vm-names": [ - {"vm-name": "Some vm-name"} - ], - "vm-networks": [ - { - "network-role": "Some network-role", - "use-dhcp": "Y", - "floating-ip": "2.12.250.0", - "network-macs": [ - {"mac-address": "Some mac-address"} - ], - "network-ips": [ - {"ip-address": "13.2.219.8"} - ], - "interface-route-prefixes": [ - { - "interface-route-prefix-cidr": "Some interface-route-prefix-cidr", - "interface-route-prefix": "24.0.45.1" - } - ], - "ip-count": 0 - } - ] - } - ], - "vnf-status": "Some vnf-status", - "vnf-networks": [ - { - "network-role": "Some network-role", - "network-id": "Some network-id", - "ipv6-subnet-id": "Some ipv6-subnet-id", - "ipv6-subnet-name": "Some ipv6-subnet-name", - "subnet-name": "Some subnet-name", - "contrail-network-fqdn": "Some contrail-network-fqdn", - "subnet-id": "Some subnet-id", - "sriov-vlan-filter-list": [ - {"sriov-vlan-filter": "Some sriov-vlan-filter"} - ], - "network-name": "Some network-name", - "neutron-id": "Some neutron-id" - } - ], - "availability-zones": [ - {"availability-zone": "Some availability-zone"} - ] - } - }, - "network-topology-information": { - "is-provider-network": true, - "network-topology-identifier": { - "service-type": "Some service-type", - "network-role": "Some network-role", - "network-technology": "Some network-technology", - "network-type": "Some network-type", - "network-name": "Some network-name" - }, - "route-table-reference": [ - { - "route-table-reference-fqdn": "Some route-table-reference-fqdn", - "route-table-reference-id": "Some route-table-reference-id" - } - ], - "network-policy": [ - { - "network-policy-fqdn": "Some network-policy-fqdn", - "network-policy-id": "Some network-policy-id" - } - ], - "subnets": [ - { - "start-address": "1.1.11.2", - "gateway-address": "8.0.25.2", - "cidr-mask": "Some cidr-mask", - "dhcp-end-address": "Some dhcp-end-address", - "subnet-name": "Some subnet-name", - "dhcp-start-address": "Some dhcp-start-address", - "ip-version": "Some ip-version", - "dhcp-enabled": "Y" - } - ], - "vpn-bindings": [ - { - "vpn-binding-id": "Some vpn-binding-id", - "global-route-target": "Some global-route-target" - } - ], - "is-external-network": true, - "is-shared-network": true, - "physical-network-name": "Some physical-network-name" - } - } - } - ] - } -} \ No newline at end of file diff --git a/docs/_static/css/ribbon.css b/docs/_static/css/ribbon.css index 6008cb1a..d03a26b2 100644 --- a/docs/_static/css/ribbon.css +++ b/docs/_static/css/ribbon.css @@ -1,63 +1,63 @@ .ribbon { - z-index: 1000; - background-color: #a00; - overflow: hidden; - white-space: nowrap; - position: fixed; - top: 25px; - right: -50px; - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); - -webkit-box-shadow: 0 0 10px #888; - -moz-box-shadow: 0 0 10px #888; - box-shadow: 0 0 10px #888; - -} - -.ribbon a { - border: 1px solid #faa; - color: #fff; - display: block; - font: bold 81.25% 'Helvetica Neue', Helvetica, Arial, sans-serif; - margin: 1px 0; - padding: 10px 50px; - text-align: center; - text-decoration: none; - text-shadow: 0 0 5px #444; - transition: 0.5s; -} - -.ribbon a:hover { - background: #c11; - color: #fff; -} - - -/* override table width restrictions */ -@media screen and (min-width: 767px) { - - .wy-table-responsive table td, .wy-table-responsive table th { - /* !important prevents the common CSS stylesheets from overriding - this as on RTD they are loaded after this stylesheet */ - white-space: normal !important; - } - - .wy-table-responsive { - overflow: visible !important; - } -} - -@media screen and (max-width: 767px) { - .wy-table-responsive table td { - white-space: nowrap; + z-index: 1000; + background-color: #a00; + overflow: hidden; + white-space: nowrap; + position: fixed; + top: 25px; + right: -50px; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-box-shadow: 0 0 10px #888; + -moz-box-shadow: 0 0 10px #888; + box-shadow: 0 0 10px #888; + + } + + .ribbon a { + border: 1px solid #faa; + color: #fff; + display: block; + font: bold 81.25% 'Helvetica Neue', Helvetica, Arial, sans-serif; + margin: 1px 0; + padding: 10px 50px; + text-align: center; + text-decoration: none; + text-shadow: 0 0 5px #444; + transition: 0.5s; + } + + .ribbon a:hover { + background: #c11; + color: #fff; + } + + + /* override table width restrictions */ + @media screen and (min-width: 767px) { + + .wy-table-responsive table td, .wy-table-responsive table th { + /* !important prevents the common CSS stylesheets from overriding + this as on RTD they are loaded after this stylesheet */ + white-space: normal !important; } -} - -/* fix width of the screen */ - -.wy-nav-content { - max-width: none; -} + + .wy-table-responsive { + overflow: visible !important; + } + } + + @media screen and (max-width: 767px) { + .wy-table-responsive table td { + white-space: nowrap; + } + } + + /* fix width of the screen */ + + .wy-nav-content { + max-width: 800px; + } \ No newline at end of file diff --git a/docs/apis/genericresource.rst b/docs/apis/genericresource.rst index 3b3afef5..c1968389 100644 --- a/docs/apis/genericresource.rst +++ b/docs/apis/genericresource.rst @@ -1,4 +1,4 @@ -GENERIC-RESOURCE-API(2017-08-24) -================================ +GENERIC-RESOURCE-API +==================== -.. swaggerv2doc:: https://gerrit.onap.org/r/gitweb?p=sdnc/northbound.git;a=blob_plain;f=generic-resource-api/model/src/main/resources/generic-resource-api.20170824.json +.. swaggerv2doc:: https://gerrit.onap.org/r/gitweb?p=sdnc/northbound.git;a=blob_plain;f=generic-resource-api/model/swagger/src/main/json/generic-resource.json;h=1b7454b5dddb37e4c8540f3f8f241747500a36c1;hb=refs/heads/guilin diff --git a/docs/apis/vnfapi.rst b/docs/apis/vnfapi.rst deleted file mode 100644 index 5ecdf3d8..00000000 --- a/docs/apis/vnfapi.rst +++ /dev/null @@ -1,4 +0,0 @@ -VNF-API(2015-07-20) -=================== - -.. swaggerv2doc:: https://gerrit.onap.org/r/gitweb?p=sdnc/northbound.git;a=blob_plain;f=vnfapi/model/src/main/resources/vnf-api.20150720.json diff --git a/docs/cert_installation.rst b/docs/cert_installation.rst index 221d5fea..bb03f0ac 100644 --- a/docs/cert_installation.rst +++ b/docs/cert_installation.rst @@ -95,12 +95,13 @@ Once you have this downloaded you need to go the following location. */oam/installation/src/main/yaml* -Once you are there you need to edit the docker-compose.yaml file to include your directory where you have the zip file and certs.properties located. +Once you are there you need to edit the docker-compose.yaml file to map the zip file and certs.properties file into the container. You need to add in the following lines into the yaml file just below *container_name: sdnc_controller_container* in the file:: volumes: - - :/opt/opendaylight/current/certs + - /certs.properties:/opt/opendaylight/certs/certs.properties + - /keys0.zip:/opt/opendaylight/certs/keys0.zip Once you have the mount path for your files added into the yaml file you can run the following command:: @@ -172,6 +173,8 @@ Confirmation of this functionality can be performed in OOM using the Contrib pro Firstly, CertService will need to be deployed. This will require the global flag *global.cmpv2Enabled* to be set to true in *kubernetes/onap/resources/overrides/aaf-cert-service-environment.yaml* +There is also an additional module that will need to be deployed named platform. This is required for secret creation. + To deploy the EJBCA server the global flag *global.addTestingComponents* in *kubernetes/onap/values.yaml* will need to be set to true. This flag will load the test configuration from *kubernetes/aaf/charts/aaf-cert-service/resources/test/cmpServers.json* diff --git a/docs/conf.py b/docs/conf.py index e9db1616..ad186323 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,16 +1,58 @@ -from docs_conf.conf import * +project = "onap" +release = "master" +version = "master" -branch = 'latest' -master_doc = 'index' +author = "Open Network Automation Platform" +# yamllint disable-line rule:line-length +copyright = "ONAP. Licensed under Creative Commons Attribution 4.0 International License" -linkcheck_ignore = [ - 'http://localhost', +pygments_style = "sphinx" +html_theme = "sphinx_rtd_theme" +html_theme_options = { + "style_nav_header_background": "white", + "sticky_navigation": "False" } +html_logo = "_static/logo_onap_2017.png" +html_favicon = "_static/favicon.ico" +html_static_path = ["_static"] +html_show_sphinx = False + +extensions = [ + 'sphinx.ext.intersphinx', + 'sphinx.ext.graphviz', + 'sphinxcontrib.blockdiag', + 'sphinxcontrib.seqdiag', + 'sphinxcontrib.swaggerdoc', + 'sphinxcontrib.plantuml' ] +# +# Map to 'latest' if this file is used in 'latest' (master) 'doc' branch. +# Change to {releasename} after you have created the new 'doc' branch. +# + +branch = 'latest' + intersphinx_mapping = {} +doc_url = 'https://docs.onap.org/projects' +master_doc = 'index' + +exclude_patterns = ['.tox'] + +spelling_word_list_filename='spelling_wordlist.txt' +spelling_lang = "en_GB" + +# +# Example: +# intersphinx_mapping['onap-aai-aai-common'] = ('{}/onap-aai-aai-common/en/%s'.format(doc_url) % branch, None) +# html_last_updated_fmt = '%d-%b-%y %H:%M' def setup(app): app.add_css_file("css/ribbon.css") - app.add_css_file("css/theme_overrides.css") + +linkcheck_ignore = [ + r'http://localhost:\d+/' +] + + diff --git a/docs/conf.yaml b/docs/conf.yaml deleted file mode 100644 index ab592813..00000000 --- a/docs/conf.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -project_cfg: onap -project: onap - -# Change this to ReleaseBranchName to modify the header -default-version: latest -# diff --git a/docs/offeredapis.rst b/docs/offeredapis.rst index d2e82ff8..778ab9ca 100644 --- a/docs/offeredapis.rst +++ b/docs/offeredapis.rst @@ -8,4 +8,3 @@ Offered APIs :maxdepth: 1 apis/genericresource.rst - apis/vnfapi.rst diff --git a/docs/release-notes.rst b/docs/release-notes.rst index eb6e0d00..ca97e299 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -12,14 +12,14 @@ SDNC Release Notes Abstract ======== -This document provides the release notes for the Frankfurt release of the Software Defined +This document provides the release notes for the London release of the Software Defined Network Controller (SDNC) Summary ======= -The Frankfurt release of SDNC introduces new functionality to support PNFs (Physical Network Functions), extends support -for Netconf/TLS to support CMPv2, and adds support for the Multi Domain Optical Network Service use case. +The London release of SDNC includes enhancements network slicing as well as a major OpenDaylight release +upgrade (to Chlorine). @@ -32,10 +32,7 @@ Release Data +-------------------------+-------------------------------------------+ | **Docker images** | See :ref:`dockercontainers` section below | +-------------------------+-------------------------------------------+ -| **Release designation** | Frankfurt | -| | | -+-------------------------+-------------------------------------------+ -| **Release date** | 06/04/2020 | +| **Release designation** | London | | | | +-------------------------+-------------------------------------------+ @@ -43,42 +40,25 @@ Release Data New features ------------ -The SDNC Frankfurt release includes the following features: - -* ORAN-compliant A1 adaptor (Jira `SDNC-965 `_) -* Multi-Domain Optical Service (Jira `SDNC-928 `_) -* Python 2 -> Python 3 migration (Jira `SDNC-967 `_) -* Upgrade to new Policy lifecycle API (Jira `SDNC-968 `_) +The SDNC London release includes the following features, which are inherited from CCSDK: +* Upgrade to OpenDaylight Chlorine Release (Jira `CCSDK-3812 `_) -For the complete list of `SDNC Frankfurt release epics `_ and -`SDNC Frankfurt release user stories `_ , please see the `ONAP Jira`_. +For the complete list of `CCSDK London release epics `_ and +`CCSDK London release user stories `_ , please see the `ONAP Jira`_. **Bug fixes** -The full list of `bugs fixed in the SDNC Frankfurt release `_ is maintained on the `ONAP Jira`_. -**Known Issues** +The full list of `bugs fixed in the SDNC London release `_ is maintained on the `ONAP Jira`_. -The full list of `known issues in SDNC `_ is maintained on the `ONAP Jira`_. - - -Deprecated Features -------------------- - -** SDNC portal ** +**Known Issues** -The SDNC portal is considered deprecated in the Frankfurt release, due -to resource contraints. This functionality is delivered dormant -in Frankfurt (i.e. it is disabled in the Frankfurt helm charts) and we -plan to remove the code entirely in the Guilin release. +* Impacts of PAX/JETTY V9 to oauth and websockets in SDNR (Jira `SDNC-1809 `_) -** VNF-API ** +The full list of `known issues in SDNC `_ is maintained on the `ONAP Jira`_. -The functionality provided by the VNF-API is now provided as part -of the GENERIC-RESOURCE-API. Therefore, the VNF-API is deprecated -in Frankfurt and will be removed in Guilin. Deliverables @@ -92,31 +72,29 @@ Software Deliverables Docker Containers ````````````````` -The following table lists the docker containers comprising the SDNC Frankfurt -release along with the current stable Frankfurt version/tag. Each of these is +The following table lists the docker containers comprising the SDNC London +release along with the current stable London version/tag. Each of these is available on the ONAP nexus3 site (https://nexus3.onap.org) and can be downloaded with the following command:: docker pull nexus3.onap.org:10001/{image-name}:{version} -Note: users that want to use the latest in-development Frankfurt version may use the -tag 0.7-STAGING-latest to pull the latest daily Frankfurt build +--------------------------------+-----------------------------------------------------+---------+ | Image name | Description | Version | +================================+=====================================================+=========+ -| onap/sdnc-aaf-image | SDNC controller image, integrated with AAF for RBAC | 1.8.3 | +| onap/sdnc-aaf-image | SDNC controller image, integrated with AAF for RBAC | 2.5.4 | +--------------------------------+-----------------------------------------------------+---------+ -| onap/sdnc-ansible-server-image | Ansible server | 1.8.3 | +| onap/sdnc-ansible-server-image | Ansible server | 2.5.4 | +--------------------------------+-----------------------------------------------------+---------+ -| onap/sdnc-dmaap-listener-image | DMaaP listener | 1.8.3 | +| onap/sdnc-dmaap-listener-image | DMaaP listener | 2.5.4 | +--------------------------------+-----------------------------------------------------+---------+ -| onap/sdnc-image | SDNC controller image, without AAF integration | 1.8.3 | +| onap/sdnc-image | SDNC controller image, without AAF integration | 2.5.4 | +--------------------------------+-----------------------------------------------------+---------+ -| onap/sdnc-ueb-listener-image | SDC listener | 1.8.3 | +| onap/sdnc-ueb-listener-image | SDC listener | 2.5.4 | +--------------------------------+-----------------------------------------------------+---------+ -| onap/sdnc-web-image | Web tier (currently only used by SDN-R persona) | 1.8.3 | +| onap/sdnc-web-image | Web tier (currently only used by SDN-R persona) | 2.5.4 | +--------------------------------+-----------------------------------------------------+---------+ @@ -138,7 +116,7 @@ Known Vulnerabilities --------------------- Any known vulnerabilities for ONAP are tracked in the `ONAP Jira`_ in the OJSI project. Any outstanding OJSI issues that -pertain to SDNC are listed in the :ref:`secissues` section below. +pertain to SDNC are listed in the "Known Security Issues" section below. Workarounds @@ -150,38 +128,11 @@ Not applicable. Security Notes -------------- -Fixed Security Issues -~~~~~~~~~~~~~~~~~~~~~ - -The following security issues have been addressed in the Frankfurt SDNC release: - -* `OSJI-34 `_ : Multiple SQL Injection issues in SDNC -* `OSJI-40 `_ : SDNC service allows for arbitrary code execution -* `OSJI-41 `_ : SDNC service allows for arbitrary code execution in sla/dgUpload form (CVE-2019-12132) -* `OSJI-42 `_ : SDNC service allows for arbitrary code execution in sla/printAsXml form (CVE-2019-12123) -* `OSJI-43 `_ : SDNC service allows for arbitrary code execution in sla/printAsGv form (CVE-2019-12113) -* `OSJI-199 `_ : SDNC service allows for arbitrary code execution in sla/upload form (CVE-2019-12112) -* `SDNC-1145 `_ : Pods still run as root -* `SDNC-970 `_ : Password removal from OOM Helm charts - -.. _secissues : Known Security Issues ~~~~~~~~~~~~~~~~~~~~~ -There is currently one known SDNC security issue, related to the SDNC portal - -* `OJSI-91 `_ : SDNC exposes unprotected API for user creation - -The current implementation of the SDNC portal - which was intended purely -as a test tool - has a self-subscription model - so anyone can create an -account by going to the setup link. This is not appropriate for production -deployment and we strongly recommend that the SDNC portal NOT be used in -production. - -The SDNC portal is disabled in the Frankfurt helm charts and will be removed -entirely in the Guilin release. - +There are no known outstanding security issues related to SDNC London. Test Results @@ -192,7 +143,7 @@ Not applicable References ========== -For more information on the ONAP Frankfurt release, please see: +For more information on the ONAP London release, please see: #. `ONAP Home Page`_ #. `ONAP Documentation`_ @@ -205,4 +156,4 @@ For more information on the ONAP Frankfurt release, please see: .. _`ONAP Documentation`: https://docs.onap.org .. _`ONAP Release Downloads`: https://git.onap.org .. _`ONAP Jira`: https://jira.onap.org -.. _`SDN Controller for Radio user guide`: https://docs.onap.org/en/frankfurt/submodules/ccsdk/features.git/docs/guides/onap-user/home.html +.. _`SDN Controller for Radio user guide`: https://docs.onap.org/projects/onap-ccsdk-features/en/latest/guides/onap-user/home.html diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt index b3188ddd..097282b9 100644 --- a/docs/requirements-docs.txt +++ b/docs/requirements-docs.txt @@ -1,15 +1,8 @@ -tox -Sphinx -doc8 -docutils -setuptools -six -sphinx_rtd_theme>=0.4.3 -sphinxcontrib-blockdiag -sphinxcontrib-needs>=0.2.3 -sphinxcontrib-nwdiag -sphinxcontrib-seqdiag +sphinx>=4.2.0 # BSD +sphinx-rtd-theme>=1.0.0 # MIT +sphinxcontrib-blockdiag # BSD +sphinxcontrib-seqdiag # BSD sphinxcontrib-swaggerdoc +sphinxcontrib-spelling sphinxcontrib-plantuml -sphinx_bootstrap_theme -lfdocs-conf +six diff --git a/docs/tox.ini b/docs/tox.ini index edac8c35..5200df4f 100644 --- a/docs/tox.ini +++ b/docs/tox.ini @@ -4,19 +4,32 @@ envlist = docs, skipsdist = true [testenv:docs] -basepython = python3 -deps = -r{toxinidir}/requirements-docs.txt +basepython = python3.8 +deps = + -r{toxinidir}/requirements-docs.txt + -chttps://releases.openstack.org/constraints/upper/yoga + -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt commands = - sphinx-build -b html -n -d {envtmpdir}/doctrees ./ {toxinidir}/_build/html + sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./ {toxinidir}/_build/html echo "Generated docs available in {toxinidir}/_build/html" -whitelist_externals = +allowlist_externals = echo git sh [testenv:docs-linkcheck] -basepython = python3 +basepython = python3.8 #deps = -r{toxinidir}/requirements-docs.txt commands = echo "Link Checking not enforced" -#commands = sphinx-build -b linkcheck -d {envtmpdir}/doctrees ./ {toxinidir}/_build/linkcheck -whitelist_externals = echo +#commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./ {toxinidir}/_build/linkcheck +allowlist_externals = echo + +[testenv:docs-spellcheck] +basepython = python3.8 +deps = + -r{toxinidir}/requirements-docs.txt + -chttps://releases.openstack.org/constraints/upper/yoga + -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt?h=master +commands = + sphinx-build -W -q -b spelling -d {envtmpdir}/doctrees {toxinidir} {toxinidir}/_build/spellcheck + diff --git a/installation/admportal/pom.xml b/installation/admportal/pom.xml index 9d72dd8a..33133555 100644 --- a/installation/admportal/pom.xml +++ b/installation/admportal/pom.xml @@ -1,36 +1,39 @@ - + + 4.0.0 - org.onap.ccsdk.parent - odlparent-lite - 2.0.0-SNAPSHOT + org.onap.sdnc.oam + installation + 2.2.0-SNAPSHOT - 4.0.0 - pom org.onap.sdnc.oam installation-admportal - 2.0.0-SNAPSHOT + 2.2.0-SNAPSHOT + pom sdnc-oam :: installation :: ${project.artifactId} Creates admportal Docker container + + openECOMP + onap/admportal-sdnc-image ${project.version} ${maven.build.timestamp} - 0.7-STAGING-latest + ${ccsdk.docker.ubuntu.version} yyyyMMdd'T'HHmmss'Z' - - org.codehaus.groovy.maven - gmaven-plugin + org.codehaus.gmaven + groovy-maven-plugin + 2.1.1 validate @@ -151,8 +154,8 @@ - exec-maven-plugin org.codehaus.mojo + exec-maven-plugin 1.5.0 @@ -227,9 +230,5 @@ - - - openECOMP - diff --git a/installation/ansible-server/pom.xml b/installation/ansible-server/pom.xml index 93ad5191..fb595cd2 100644 --- a/installation/ansible-server/pom.xml +++ b/installation/ansible-server/pom.xml @@ -1,35 +1,37 @@ - + + 4.0.0 - org.onap.ccsdk.parent - odlparent-lite - 2.0.0-SNAPSHOT + org.onap.sdnc.oam + installation + 2.7.0-SNAPSHOT - 4.0.0 - pom - org.onap.sdnc.oam + installation-ansible-server - 2.0.0-SNAPSHOT + pom sdnc-oam :: installation :: ${project.artifactId} Creates ansible-server Docker container + + ONAP + onap/sdnc-ansible-server-image ${project.version} ${maven.build.timestamp} - 0.7-STAGING-latest + ${ccsdk.docker.ansible.server.version} ${https_proxy} yyyyMMdd'T'HHmmss'Z' - - org.codehaus.groovy.maven - gmaven-plugin + org.codehaus.gmaven + groovy-maven-plugin + 2.1.1 validate @@ -61,7 +63,7 @@ **/* - false + true @@ -79,7 +81,7 @@ io.fabric8 docker-maven-plugin - 0.28.0 + 0.34.0 false @@ -87,7 +89,8 @@ ${image.name} try - ${basedir}/target/docker-stage + true + ${basedir}/target/docker-stage Dockerfile ${project.docker.latestminortag.version} @@ -97,19 +100,12 @@ + ${docker.verbose} + ${docker.skip.push} - generate-images - package - - build - - - - - push-images - deploy + build-push-images build push @@ -121,7 +117,4 @@ - - ONAP - diff --git a/installation/ansible-server/src/main/dc/docker-compose.yaml b/installation/ansible-server/src/main/dc/docker-compose.yaml new file mode 100644 index 00000000..371aabde --- /dev/null +++ b/installation/ansible-server/src/main/dc/docker-compose.yaml @@ -0,0 +1,52 @@ +version: '2.1' + +networks: + default: + driver: bridge + driver_opts: + com.docker.network.driver.mtu: ${MTU} + + +services: + + db: + image: mariadb:10.5 + container_name: sdnc_db_container + ports: + - "23306:3306" + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_ROOT_HOST=% + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + + ansible: + image: onap/sdnc-ansible-server-image:latest + depends_on : + - db + container_name: sdnc_ansible_container + entrypoint: ["/opt/ansible-server/startAnsibleServer.sh"] + ports: + - "8000" + links: + - db:dbhost + - db:sdnctldb01 + - db:sdnctldb02 + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - ANSIBLE_TRUSTSTORE_PASSWORD=${ANSIBLE_TRUSTSTORE_PASSWORD} + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + diff --git a/installation/dmaap-listener/pom.xml b/installation/dmaap-listener/pom.xml index e25f6f16..a0f6458a 100644 --- a/installation/dmaap-listener/pom.xml +++ b/installation/dmaap-listener/pom.xml @@ -1,37 +1,51 @@ - + + 4.0.0 - org.onap.ccsdk.parent - odlparent-lite - 2.0.0-SNAPSHOT + org.onap.sdnc.oam + installation + 2.7.0-SNAPSHOT - 4.0.0 - pom - org.onap.sdnc.oam + installation-dmaap-listener - 2.0.0-SNAPSHOT + pom sdnc-oam :: installation :: ${project.artifactId} Creates dmaap-listener Docker container + + ONAP + onap/sdnc-dmaap-listener-image ${project.version} ${maven.build.timestamp} - 0.7-STAGING-latest + ${ccsdk.docker.alpine.j11.version} ${https_proxy} yyyyMMdd'T'HHmmss'Z' + + + org.onap.ccsdk.sli.northbound + dmaap-listener + zip + ${ccsdk.sli.northbound.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + - - - org.codehaus.groovy.maven - gmaven-plugin + org.codehaus.gmaven + groovy-maven-plugin + 2.1.1 validate @@ -44,9 +58,6 @@ - - - maven-resources-plugin 2.6 @@ -70,7 +81,6 @@ - copy-scripts @@ -85,12 +95,11 @@ *.sh - false + true - copy-properties @@ -105,12 +114,11 @@ * - false + true - @@ -120,18 +128,10 @@ unpack - unpack + unpack-dependencies initialize - - - org.onap.ccsdk.sli.northbound - dmaap-listener - zip - ${ccsdk.sli.northbound.version} - - ${basedir}/target/docker-stage/opt/onap/sdnc/dmaap-listener bin/**,**/*-javadoc.jar,**/*-sources.jar true @@ -140,39 +140,26 @@ - - exec-maven-plugin - org.codehaus.mojo - 1.5.0 + org.apache.maven.plugins + maven-antrun-plugin + 1.8 - - - - change shell permissions + change-shell-permissions process-sources - - exec - - /usr/bin/find - - ${basedir}/target/docker-stage/opt/onap/sdnc - -name - *.sh - -exec - chmod - +x - {} - ; - + + + + + run + - @@ -183,7 +170,7 @@ io.fabric8 docker-maven-plugin - 0.28.0 + 0.34.0 false @@ -191,7 +178,8 @@ ${image.name} try - ${basedir}/target/docker-stage + true + ${basedir}/target/docker-stage Dockerfile ${project.docker.latestminortag.version} @@ -201,19 +189,12 @@ + ${docker.verbose} + ${docker.skip.push} - generate-images - package - - build - - - - - push-images - deploy + build-push-images build push @@ -225,7 +206,4 @@ - - ONAP - diff --git a/installation/dmaap-listener/src/main/docker/Dockerfile b/installation/dmaap-listener/src/main/docker/Dockerfile index df444e0a..51ae3ad1 100644 --- a/installation/dmaap-listener/src/main/docker/Dockerfile +++ b/installation/dmaap-listener/src/main/docker/Dockerfile @@ -1,40 +1,30 @@ # Base ubuntu with added packages needed for open ecomp -FROM alpine:3.8 AS stage0 - -ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk +FROM onap/ccsdk-alpine-j17-image:${ccsdk.docker.version} AS stage0 +USER root ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties # copy deliverables to opt COPY opt /opt +# Remediate log4shell vuln +RUN apk add zip +RUN zip -q -d /opt/onap/sdnc/dmaap-listener/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class + # End of stage 0 -FROM alpine:3.8 +FROM onap/ccsdk-alpine-j17-image:${ccsdk.docker.version} MAINTAINER SDNC Team (onap-sdnc@lists.onap.org) -ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties USER root -RUN apk update && apk add \ - bash \ - git \ - openjdk8 \ - maven \ - mysql-client \ - nodejs \ - py-pip \ - graphviz \ - unzip \ - rsync - # Create sdnc user RUN addgroup -S sdnc && adduser -S sdnc -G sdnc - # Copy /opt and change owner/group to sdnc COPY --from=stage0 --chown=sdnc:sdnc /opt /opt -USER sdnc \ No newline at end of file + +USER sdnc diff --git a/installation/dmaap-listener/src/main/properties/aai.properties b/installation/dmaap-listener/src/main/properties/aai.properties index 186efa99..4f6bd5c8 100755 --- a/installation/dmaap-listener/src/main/properties/aai.properties +++ b/installation/dmaap-listener/src/main/properties/aai.properties @@ -9,10 +9,10 @@ routeOffer=MR1 SubContextPath =/ Protocol =http MethodType =GET -username =admin -password =admin +username =${DMAAP_USER} +password =${DMAAP_PASSWORD} contenttype =application/json -authKey=fxoW4jZrO7mdLWWa:f4KxkoBtToyoEG7suMoV8KhnkwM= +authKey=${DMAAP_AUTHKEY} authDate=2016-02-18T13:57:37-0800 host=ueb.api.simpledemo.onap.org:3904 topic=AAI-EVENT @@ -30,7 +30,7 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 AFT_DME2_EP_READ_TIMEOUT_MS=50000 sessionstickinessrequired=NO DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt -sdnc.odl.user=admin -sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +sdnc.odl.user=${ODL_USER} +sdnc.odl.password=${ODL_PASSWORD} sdnc.odl.url-base=http://sdnhost:8181/restconf/operations diff --git a/installation/dmaap-listener/src/main/properties/dblib.properties b/installation/dmaap-listener/src/main/properties/dblib.properties index 9506ac8d..f54e099e 100644 --- a/installation/dmaap-listener/src/main/properties/dblib.properties +++ b/installation/dmaap-listener/src/main/properties/dblib.properties @@ -23,11 +23,11 @@ org.onap.ccsdk.sli.dbtype=jdbc org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01 -org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://dbhost:3306/sdnctl +org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://dbhost:3306/${MYSQL_DATABASE} org.onap.ccsdk.sli.jdbc.driver=org.mariadb.jdbc.Driver -org.onap.ccsdk.sli.jdbc.database=sdnctl -org.onap.ccsdk.sli.jdbc.user=sdnctl -org.onap.ccsdk.sli.jdbc.password=gamma +org.onap.ccsdk.sli.jdbc.database=${MYSQL_DATABASE} +org.onap.ccsdk.sli.jdbc.user=${MYSQL_USER} +org.onap.ccsdk.sli.jdbc.password=${MYSQL_PASSWORD} org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01 org.onap.ccsdk.sli.jdbc.connection.timeout=50 org.onap.ccsdk.sli.jdbc.request.timeout=100 diff --git a/installation/dmaap-listener/src/main/properties/dhcpalert.properties b/installation/dmaap-listener/src/main/properties/dhcpalert.properties index ae9804f6..65b3e7fc 100755 --- a/installation/dmaap-listener/src/main/properties/dhcpalert.properties +++ b/installation/dmaap-listener/src/main/properties/dhcpalert.properties @@ -9,10 +9,10 @@ routeOffer=MR1 SubContextPath =/ Protocol =http MethodType =GET -username =admin -password =admin +username =${DMAAP_USER} +password =${DMAAP_PASSWORD} contenttype =application/json -authKey=fxoW4jZrO7mdLWWa:f4KxkoBtToyoEG7suMoV8KhnkwM= +authKey=${DMAAP_AUTHKEY} authDate=2016-02-18T13:57:37-0800 host=ueb.api.simpledemo.onap.org:3904 topic=VCPE-DHCP-EVENT @@ -30,7 +30,7 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 AFT_DME2_EP_READ_TIMEOUT_MS=50000 sessionstickinessrequired=NO DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt -sdnc.odl.user=admin -sdnc.odl.password=admin -sdnc.odl.url-base=https://sdncodl.st.us.aic.cip.att.com:8443/restconf/operations +sdnc.odl.user=${ODL_USER} +sdnc.odl.password=${ODL_PASSWORD} +sdnc.odl.url-base=https://sdnc.onap:8443/restconf/operations diff --git a/installation/dmaap-listener/src/main/properties/dmaap-consumer-CMNotify.properties b/installation/dmaap-listener/src/main/properties/dmaap-consumer-CMNotify.properties index aae34a26..b399d27f 100644 --- a/installation/dmaap-listener/src/main/properties/dmaap-consumer-CMNotify.properties +++ b/installation/dmaap-listener/src/main/properties/dmaap-consumer-CMNotify.properties @@ -9,10 +9,10 @@ routeOffer=MR1 SubContextPath =/ Protocol =http MethodType =GET -username =admin -password =admin +username =${DMAAP_USER} +password =${DMAAP_PASSWORD} contenttype =application/json -authKey=fs20cKwalJ6ry4kX:7Hqm6BDZK47IKxGRkOPFk33qMYs= +authKey=${DMAAP_AUTHKEY} authDate=2019-04-09T04:28:40-05:00 host=message-router.onap:3904 topic=CM-NOTIFICATION @@ -30,6 +30,6 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 AFT_DME2_EP_READ_TIMEOUT_MS=50000 sessionstickinessrequired=NO DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt -sdnc.odl.user=admin -sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +sdnc.odl.user=${ODL_USER} +sdnc.odl.password=${ODL_PASSWORD} sdnc.odl.url-base=http://sdnc.onap:8282/restconf/operations diff --git a/installation/dmaap-listener/src/main/properties/dmaap-consumer-RANSlice.properties b/installation/dmaap-listener/src/main/properties/dmaap-consumer-RANSlice.properties new file mode 100644 index 00000000..7f6e5e34 --- /dev/null +++ b/installation/dmaap-listener/src/main/properties/dmaap-consumer-RANSlice.properties @@ -0,0 +1,35 @@ +TransportType=HTTPNOAUTH +Latitude =50.000000 +Longitude =-100.000000 +Version =1.0 +ServiceName =message-router.onap:3904/events +Environment =TEST +Partner = +routeOffer=MR1 +SubContextPath =/ +Protocol =http +MethodType =GET +username =${DMAAP_USER} +password =${DMAAP_PASSWORD} +contenttype =application/json +authKey=${DMAAP_AUTHKEY} +authDate=2019-04-09T04:28:40-05:00 +host=message-router.onap:3904 +topic=RAN-Slice-Mgmt +group=users +id=sdnc1 +timeout=15000 +limit=1000 +filter= +AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler +AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler +AFT_DME2_REQ_TRACE_ON=true +AFT_ENVIRONMENT=AFTUAT +AFT_DME2_EP_CONN_TIMEOUT=15000 +AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 +AFT_DME2_EP_READ_TIMEOUT_MS=50000 +sessionstickinessrequired=NO +DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt +sdnc.odl.user=${ODL_USER} +sdnc.odl.password=${ODL_PASSWORD} +sdnc.odl.url-base=http://sdnc.onap:8282/restconf/operations diff --git a/installation/dmaap-listener/src/main/properties/dmaap-consumer-a1Adapter-policy.properties b/installation/dmaap-listener/src/main/properties/dmaap-consumer-a1Adapter-policy.properties index edb7c453..f01cf219 100644 --- a/installation/dmaap-listener/src/main/properties/dmaap-consumer-a1Adapter-policy.properties +++ b/installation/dmaap-listener/src/main/properties/dmaap-consumer-a1Adapter-policy.properties @@ -9,10 +9,10 @@ routeOffer=MR1 SubContextPath =/ Protocol =http MethodType =GET -username =admin -password =admin +username =${DMAAP_USER} +password =${DMAAP_PASSWORD} contenttype =application/json -authKey=fs20cKwalJ6ry4kX:7Hqm6BDZK47IKxGRkOPFk33qMYs= +authKey=${DMAAP_AUTHKEY} authDate=2019-04-09T04:28:40-05:00 host=message-router.onap:3904 topic=A1-P @@ -30,6 +30,6 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 AFT_DME2_EP_READ_TIMEOUT_MS=50000 sessionstickinessrequired=NO DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt -sdnc.odl.user=admin -sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -sdnc.odl.url-base=http://sdnc.onap:8282/restconf/operations +sdnc.odl.user=${ODL_USER} +sdnc.odl.password=${ODL_PASSWORD} +sdnc.odl.url-base=https://sdnc.onap:8443/restconf/operations diff --git a/installation/dmaap-listener/src/main/properties/dmaap-consumer-oofpcipoc.properties b/installation/dmaap-listener/src/main/properties/dmaap-consumer-oofpcipoc.properties index f933edee..222d8195 100644 --- a/installation/dmaap-listener/src/main/properties/dmaap-consumer-oofpcipoc.properties +++ b/installation/dmaap-listener/src/main/properties/dmaap-consumer-oofpcipoc.properties @@ -9,10 +9,10 @@ routeOffer=MR1 SubContextPath =/ Protocol =http MethodType =GET -username =admin -password =admin +username =${DMAAP_USER} +password =${DMAAP_PASSWORD} contenttype =application/json -authKey=fs20cKwalJ6ry4kX:7Hqm6BDZK47IKxGRkOPFk33qMYs= +authKey=${DMAAP_AUTHKEY} authDate=2019-04-09T04:28:40-05:00 host=message-router.onap:3904 topic=SDNR-CL @@ -30,6 +30,6 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 AFT_DME2_EP_READ_TIMEOUT_MS=50000 sessionstickinessrequired=NO DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt -sdnc.odl.user=admin -sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +sdnc.odl.user=${ODL_USER} +sdnc.odl.password=${ODL_PASSWORD} sdnc.odl.url-base=http://sdnc.onap:8282/restconf/operations diff --git a/installation/dmaap-listener/src/main/properties/dmaap-listener.properties b/installation/dmaap-listener/src/main/properties/dmaap-listener.properties index 5101c275..d7885cf6 100755 --- a/installation/dmaap-listener/src/main/properties/dmaap-listener.properties +++ b/installation/dmaap-listener/src/main/properties/dmaap-listener.properties @@ -1 +1 @@ -subscriptions=org.onap.ccsdk.sli.northbound.dmaapclient.SdncDhcpEventConsumer:dhcpalert.properties;org.onap.ccsdk.sli.northbound.dmaapclient.SdncLcmDmaapConsumer:lcm.properties;org.onap.ccsdk.sli.northbound.dmaapclient.SdncAaiDmaapConsumer:aai.properties;org.onap.ccsdk.sli.northbound.dmaapclient.OofPciPocDmaapConsumers:dmaap-consumer-oofpcipoc.properties;org.onap.ccsdk.sli.northbound.dmaapclient.A1AdapterPolicyDmaapConsumer:dmaap-consumer-a1Adapter-policy.properties;org.onap.ccsdk.sli.northbound.dmaapclient.CMNotifyDmaapConsumer:dmaap-consumer-CMNotify.properties +subscriptions=org.onap.ccsdk.sli.northbound.dmaapclient.SdncDhcpEventConsumer:dhcpalert.properties;org.onap.ccsdk.sli.northbound.dmaapclient.SdncLcmDmaapConsumer:lcm.properties;org.onap.ccsdk.sli.northbound.dmaapclient.SdncAaiDmaapConsumer:aai.properties;org.onap.ccsdk.sli.northbound.dmaapclient.OofPciPocDmaapConsumers:dmaap-consumer-oofpcipoc.properties;org.onap.ccsdk.sli.northbound.dmaapclient.A1AdapterPolicyDmaapConsumer:dmaap-consumer-a1Adapter-policy.properties;org.onap.ccsdk.sli.northbound.dmaapclient.CMNotifyDmaapConsumer:dmaap-consumer-CMNotify.properties;org.onap.ccsdk.sli.northbound.dmaapclient.SdncRANSliceDmaapConsumer:dmaap-consumer-RANSlice.properties diff --git a/installation/dmaap-listener/src/main/properties/lcm.properties b/installation/dmaap-listener/src/main/properties/lcm.properties index 22dbebe5..507433b7 100755 --- a/installation/dmaap-listener/src/main/properties/lcm.properties +++ b/installation/dmaap-listener/src/main/properties/lcm.properties @@ -9,10 +9,10 @@ routeOffer=MR1 SubContextPath =/ Protocol =http MethodType =GET -username =admin -password =admin +username =${DMAAP_USER} +password =${DMAAP_PASSWORD} contenttype =application/json -authKey=fxoW4jZrO7mdLWWa:f4KxkoBtToyoEG7suMoV8KhnkwM= +authKey=${DMAAP_AUTHKEY} authDate=2016-02-18T13:57:37-0800 host=ueb.api.simpledemo.onap.org:3904 topic=SDNC-LCM-READ @@ -30,7 +30,7 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000 AFT_DME2_EP_READ_TIMEOUT_MS=50000 sessionstickinessrequired=NO DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt -sdnc.odl.user=admin -sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -sdnc.odl.url-base=http://sdnhost:8181/restconf/operations +sdnc.odl.user=${ODL_USER} +sdnc.odl.password=${ODL_PASSWORD} +sdnc.odl.url-base=https://sdnc.onap:8443/restconf/operations diff --git a/installation/pom.xml b/installation/pom.xml index 3d814ed1..64855630 100644 --- a/installation/pom.xml +++ b/installation/pom.xml @@ -1,37 +1,35 @@ - + + 4.0.0 - org.onap.ccsdk.parent - odlparent-lite - 2.0.0-SNAPSHOT + org.onap.sdnc.oam + sdnc-oam + 2.7.0-SNAPSHOT - 4.0.0 - pom - org.onap.sdnc.oam installation - 2.0.0-SNAPSHOT + pom sdnc-oam :: installation Installs SDN-C on local file system - - installation - - yyyyMMdd'T'HHmmss'Z' - ${maven.build.timestamp} - 0.7.0-SNAPSHOT - UTF-8 - UTF-8 - - ansible-server sdnc sdnc-web - admportal ueb-listener dmaap-listener + + + installation + yyyyMMdd'T'HHmmss'Z' + ${maven.build.timestamp} + UTF-8 + UTF-8 + + false + true + diff --git a/installation/sdnc-web/README.md b/installation/sdnc-web/README.md new file mode 100644 index 00000000..d793b676 --- /dev/null +++ b/installation/sdnc-web/README.md @@ -0,0 +1,56 @@ +# sdnc web image + + +## folder structure + +| folder | description | +| ------ | ----------- | +| /opt/bitnami/nginx/conf/server_blocks/http(s)_site.conf | nginx config | +| /opt/bitnami/nginx/conf/server_blocks/location.rules | forwarding rules for nginx | +| /app/odlux | http content files (html, js, css, ...) | +| /app/odlux.application.list | application list file | +| /app/opm.py | Odlux package manager for install or uninstall apps | +| /app/init.d/ | autoinstall folder for opm | + +## Default app order + +| index | application | +| ----- | ----------- | +| 1 | connectApp | +| 10 | faultApp | +| 20 | maintenanceApp | +| 30 | configurationApp | +| 55 | performanceHistoryApp | +| 70 | inventoryApp | +| 75 | eventLogApp | +| 90 | mediatorApp | +| 200 | helpApp | + + +## usage + +### auto installation + +To auto install additional applications for odlux they can be easily injected before startup into the ```/app/init.d/``` folder. There are two options of file format allowed. + +[1] The first fileformat is e.g. 55linkCalculationApp.jar but also .zip is allowed. The important thing is that a number is leading the app package to specify the order number where the menu item is ordered in the menu bar. So the linkCalculationApp would be located between performanceApp and inventoryApp. + +[2] The second is the default jar format, like it would be installed into the opendaylight karaf environment, including a blueprint and the sources. There the filename is not important because application name and index will be detected by the blueprint information. + + +### manual method +``` +opm install --name myApp --index 53 --file myarchive.zip +``` +``` +opm install --url https://link-to-my-odlux-application.jar +``` + +``` +opm uninstall --name myApp +``` + +``` +opm list +``` + diff --git a/installation/sdnc-web/certs/cacert.pem b/installation/sdnc-web/certs/cacert.pem new file mode 100644 index 00000000..0146e6b4 --- /dev/null +++ b/installation/sdnc-web/certs/cacert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPjCCAyagAwIBAgIJAJ6u7cCnzrWdMA0GCSqGSIb3DQEBCwUAMCwxDjAMBgNV +BAsMBU9TQUFGMQ0wCwYDVQQKDARPTkFQMQswCQYDVQQGEwJVUzAeFw0xODA0MDUx +NDE1MjhaFw0zODAzMzExNDE1MjhaMCwxDjAMBgNVBAsMBU9TQUFGMQ0wCwYDVQQK +DARPTkFQMQswCQYDVQQGEwJVUzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC +ggIBAMA5pkgRs7NhGG4ew5JouhyYakgYUyFaG121+/h8qbSdt0hVQv56+EA41Yq7 +XGie7RYDQK9NmAFF3gruE+6X7wvJiChp+Cyd7sFMnb65uWhxEdxWTM2BJFrgfzUn +H8ZCxgaCo3XH4PzlKRy2LQQJEJECwl/RZmRCXijMt5e9h8XoZY/fKkKcZZUsWNCM +pTo266wjvA9MXLmdgReRj0+vrCjrNqy+htwJDztoiHWiYPqT6o8EvGcgjNqjlZx7 +NUNf8MfLDByqKF6+wRbHv1GKjn3/Vijd45Fv8riyRYROiFanvbV6jIfBkv8PZbXg +2VDWsYsgp8NAvMxK+iV8cO+Ck3lBI2GOPZbCEqpPVTYbLUz6sczAlCXwQoPzDIZY +wYa3eR/gYLY1gP2iEVHORag3bLPap9ZX5E8DZkzTNTjovvLk8KaCmfcaUMJsBtDd +ApcUitz10cnRyZc1sX3gE1f3DpzQM6t9C5sOVyRhDcSrKqqwb9m0Ss04XAS9FsqM +P3UWYQyqDXSxlUAYaX892u8mV1hxnt2gjb22RloXMM6TovM3sSrJS0wH+l1nznd6 +aFXftS/G4ZVIVZ/LfT1is4StoyPWZCwwwly1z8qJQ/zhip5NgZTxQw4mi7ww35DY +PdAQOCoajfSvFjqslQ/cPRi/MRCu079heVb5fQnnzVtnpFQRAgMBAAGjYzBhMB0G +A1UdDgQWBBRTVTPyS+vQUbHBeJrBKDF77+rtSTAfBgNVHSMEGDAWgBRTVTPyS+vQ +UbHBeJrBKDF77+rtSTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAN +BgkqhkiG9w0BAQsFAAOCAgEAPx/IaK94n02wPxpnYTy+LVLIxwdq/kawNd6IbiMz +L87zmNMDmHcGbfoRCj8OkhuggX9Lx1/CkhpXimuYsZOFQi5blr/u+v4mIbsgbmi9 +7j+cUHDP0zLycvSvxKHty51LwmaX9a4wkJl5zBU4O1sd/H9tWcEmwJ39ltKoBKBx +c94Zc3iMm5ytRWGj+0rKzLDAXEWpoZ5bE5PLJauA6UDCxDLfs3FwhbS7uDggxYvf +jySF5FCNET94oJ+m8s7VeHvoa8iPGKvXrIqdd7XDHnqJJlVKr7m9S0fMbyEB8ci2 +RtOXDt93ifY1uhoEtEykn4dqBSp8ezvNMnwoXdYPDvTd9uCAFeWFLVreBAWxd25h +PsBTkZA5hpa/rA+mKv6Af4VBViYr8cz4dZCsFChuioVebe9ighrfjB//qKepFjPF +CyjzKN1u0JKm/2x/ORqxkTONG8p3uDwoIOyimUcTtTMv42bfYD88RKakqSFXE9G+ +Z0LlaKABqfjK49o/tsAp+c5LoNlYllKhnetO3QAdraHwdmC36BhoghzR1jpX751A +cZn2VH3Q4XKyp01cJNCJIrua+A+bx6zh3RyW6zIIkbRCbET+UD+4mr8WIcSE3mtR +ZVlnhUDO4z9//WKMVzwS9Rh8/kuszrGFI1KQozXCHLrce3YP6RYZfOed79LXaRwX +dYY= +-----END CERTIFICATE----- diff --git a/installation/sdnc-web/certs/cert.pem b/installation/sdnc-web/certs/cert.pem new file mode 100644 index 00000000..1195a126 --- /dev/null +++ b/installation/sdnc-web/certs/cert.pem @@ -0,0 +1,102 @@ +Bag Attributes + friendlyName: sdnc@sdnc.onap.org + localKeyID: 54 69 6D 65 20 31 36 31 31 36 38 33 32 39 38 35 32 32 +Key Attributes: +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIk4s7xBaGXdgCAggA +MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECI7qjnyFxa3mBIIEyHgvXzCmhOT/ +atHsneicZqaGXxz57z1mPosvGwf2w6WerxOyW+cFejNepgMH+c5MQAfTuTD0H5g3 +SoyC9TKfHBld439sKO3hnDBROsypugO2uP4ownGiKQxOdwHNCOS8nC1EbUYC6nHR +B5QtRpDHZzB2t9dd6+RU1PuPUFRxjIPZsCM1DdKKhMHQHr8WDSbi170XfzC6O2Ko +23tgDq9cQYTqmgFedjyWpEmxfcibaujGOZ4VQej+tn60A03cXHG05tN/XvDCbQty +9bw1kiS8e+qmdUhkEIhR2aY0Z9sCUOLwJPDg/1vE0ZwK/bRGRD432PD+dmSLFV+v +m2m/ec8IQer8hCleI6GBaFI28QZyS2jznbzS7b/hU+nyxkZXejAymU1OBcNV4H8M +qf5ITWs+Ma5fc/8X90MlJacmBo3JuusTvDImLFP+5Nn5Yo3cnDeiAyMo0vFuywrv +bATYAncPlzksb6py3D5iXmLxREgLI14/TdZLhcYXBHw76oPz+/CH0A2P/HICPIjr +zF8U6zNI4bIguBTfVmm6YLjzOkVkKx4e/0fJiQO1yhzIsghhByIMg1uPcm0olNQz +r+YRPKTqFCPRxyGgPMleN56qeLhN8Q1WyJzIJoVVpDFc+4Stbv71C/po6/6A3v4r +hGUPCSsj8wJN+ozdamDWpeyRVCwXmmKwJU96pbnhdH/l6CPjmniAuKLzOMLJH1AD +FJEm1Frpz40BDC2U/165+nlfcHZfePWVPpNuqWzUfywqu8ORS/pYhapFoLLafQIn +22KhnPnbNXclIzuI0wiKjoNAfzJM0S9hysdojK/bptaZXUFeBEe41A8exuOjOxRh +pJqqgq2cRx6cmnAy0dr54+GoZr3haQCqTk814cxumOHqQdWllblA1D9b5Wd+8T5+ +tYdzYatsvjeY/VDH5czAbUhgBHGO3Vkxm49QemcopNDeCZ7RXmSwl2X6HLfCwnfH +9zsdNrIMfSTdRk9H4iHTyFRyoPViX6wYxlD7B9hJWggEyDVg9RvJImOSKyWk+NKd +WmfxaywgUJkxsJeEBCso8V690lm//oWrc17qWEd29h/9J0MPNa2zXJyG1Yq1RohZ +JW3IcnE8gCoyHVjxBCVjKPA6dXtfDNfmCDyEG+GgPglQUj9TBIRGmn9e067M6dB9 +vhnK12SBQNTyoH5vWSbP2u5wk6jV5QKYyqMbNHAD1uvsBbWy4FpoI+epp2Y3XcAr +kgBzopKSaCbj1thxxUHsMYBspVDR+D0SR4fsHhj+Y3jmr37s3q1NOSkWUMcMa7Hi +zaozRSo8hYUwP5RHpPcNCTcK0dhFPAWXyGPtP7IribGQDhUAdde/s4yPuSLa28zy +uTKWU5vSlaE+9WRSKvbA8HdKTPv45dV/qUCHITvPOdsqkWJ3qhNQMrrD9Mx17oj/ +zGZTcRGQG62dfYUR9v2rGE6Gj7MzaE1SrQgYqtCzWfJ9e3fBqOlko5jtZ5Kz86DU +ZFISrkb1sATngzWFtvyNgHFx4fUsYDJbc8XlB47H5Byyj/6SypS6dMpwqpNezn8s +xQi3yUfpg7GQzTFKdwmqK/KVeh0KZF/0FM+ZCUPh6IaRDcp8+Hm7H72ZD4vPxs4s +8bvLx9bxfiI+/6Om51IQrQ== +-----END ENCRYPTED PRIVATE KEY----- +Bag Attributes + friendlyName: sdnc@sdnc.onap.org + localKeyID: 54 69 6D 65 20 31 36 31 31 36 38 33 32 39 38 35 32 32 +subject=CN = sdnc, OU = sdnc@sdnc.onap.org:DEV, OU = OSAAF, O = ONAP, C = US + +issuer=C = US, O = ONAP, OU = OSAAF, CN = intermediateCA_9 + +-----BEGIN CERTIFICATE----- +MIIE6zCCA9OgAwIBAgIJALyx+8HFJuYTMA0GCSqGSIb3DQEBCwUAMEcxCzAJBgNV +BAYTAlVTMQ0wCwYDVQQKDARPTkFQMQ4wDAYDVQQLDAVPU0FBRjEZMBcGA1UEAwwQ +aW50ZXJtZWRpYXRlQ0FfOTAeFw0yMTAxMjYxNzQ4MThaFw0yMjAxMjYxNzQ4MTha +MFwxDTALBgNVBAMMBHNkbmMxHzAdBgNVBAsMFnNkbmNAc2RuYy5vbmFwLm9yZzpE +RVYxDjAMBgNVBAsMBU9TQUFGMQ0wCwYDVQQKDARPTkFQMQswCQYDVQQGEwJVUzCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALQtwrW3Eiru18BADUiBIbEU +sruiLu63h6jDprLqrxGt57d5MSpxaRoOPoWDPE/Z6LvMwTGfiQIPsFnZ2H3YtDsI +/p1fOFAHxCUl5Cs4HnYjJUkDs2U7dXUYZR8enNPZRfFZNUOajxERUgyE/0g+yHS1 +AlysMInFDblmNEYgQoNiN996FpBamHivCDXw612bBkkZQOTeKJaCZ0DPGIYGAJtf +Q1kIL7Y1D3c3C0VD39homtxqIb21rje63YVISprbfKX0RxijkWw0wXjaRDwxPGwH +TrDHgsrPH/zv9Hak6cJkTw5e7VBHHlL1sHYgPSDLd/8PFGkmD4a/N/IKLy/14KMC +AwEAAaOCAcMwggG/MAkGA1UdEwQCMAAwDgYDVR0PAQH/BAQDAgXgMCAGA1UdJQEB +/wQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBUBgNVHSMETTBLgBSB95lbELnIjN7z +Ul7qTmmgQz6s3aEwpC4wLDEOMAwGA1UECwwFT1NBQUYxDTALBgNVBAoMBE9OQVAx +CzAJBgNVBAYTAlVTggEHMB0GA1UdDgQWBBRUhHQPlauGoN9fiGiB7WYr+oIHJDCC +AQkGA1UdEQSCAQAwgf2BH21hcmsuZC5tYW5hZ2VyQHBlb3BsZS5vc2FhZi5jb22C +BHNkbmOCG2MxLnZtMS5zZG5jLnNpbXBsZWRlbW8ub25hcIIbYzIudm0xLnNkbmMu +c2ltcGxlZGVtby5vbmFwghtjMy52bTEuc2RuYy5zaW1wbGVkZW1vLm9uYXCCG2M0 +LnZtMS5zZG5jLnNpbXBsZWRlbW8ub25hcIIJb25hcC1zZG5jgg5vbmFwLXNkbmMu +b25hcIIcc2RuYy5hcGkuc2ltcGxlZGVtby5vbmFwLm9yZ4IJc2RuYy5vbmFwghx2 +bTEuc2RuYy5zaW1wbGVkZW1vLm9uYXAub3JnMA0GCSqGSIb3DQEBCwUAA4IBAQAg +7fybHysjWyKejSfPnodYuLfQoCIaXe5C4JbwLGKweAost5E6ud2rscN/c5UYNPs/ +IskfnMxULLzJpEXdUHwLQaLJj0fQQBRHq23s8P7Emu44ZeEzxAQfI+4pKRzTYxag +4dIitf91nhUq5SQI/pcki+/ElkwfeKHYQLBDU8ygG/gZKh1UHxIjfva7v/ENqL2h +H8UDXsLhOx/guaJzH2CRQdKMminsdtnNgSRRPzWRe4EMc2ah6G6E4B/Za/n7Rhq5 +r6jpvM/XIxPCY4ci5jJIbvdahS4I54kMaLRTSl4gT8+n8ie/GzhZlXX+1MR8HCZc +8SWDYxmc8MkJ20iekiSc +-----END CERTIFICATE----- +Bag Attributes + friendlyName: CN=intermediateCA_9,OU=OSAAF,O=ONAP,C=US +subject=C = US, O = ONAP, OU = OSAAF, CN = intermediateCA_9 + +issuer=OU = OSAAF, O = ONAP, C = US + +-----BEGIN CERTIFICATE----- +MIIEdTCCAl2gAwIBAgIBBzANBgkqhkiG9w0BAQsFADAsMQ4wDAYDVQQLDAVPU0FB +RjENMAsGA1UECgwET05BUDELMAkGA1UEBhMCVVMwHhcNMTgwODE3MTg1MTM3WhcN +MjMwODE3MTg1MTM3WjBHMQswCQYDVQQGEwJVUzENMAsGA1UECgwET05BUDEOMAwG +A1UECwwFT1NBQUYxGTAXBgNVBAMMEGludGVybWVkaWF0ZUNBXzkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCv0HHUkba3uNtNI3jPKimUcd6RNwmhSCJL +neMWpnjqp5/A+HCKyNsEaT4y177hNLmCm/aMm1u2JIfikc+8wEqLCSBBPz+P0h+d +o+sZ7U+4oeQizdYYpEdzHJ2SieHHa8vtu80rU3nO2NEIkuYC20HcKSEtl8fFKsk3 +nqlhY+tGfYJPTXcDOQAO40BTcgat3C3uIJHkWJJ4RivunE4LEuRv9QyKgAw7rkJV +v+f7guqpZlXy6dzAkuU7XULWcgo55MkZlssoiErMvEZJad5aWKvRY3g7qUjaQ6wO +15wOAUoRBW96eeZZbytgn8kybcBy++Ue49gPtgm1MF/KlAsp0MD5AgMBAAGjgYYw +gYMwHQYDVR0OBBYEFIH3mVsQuciM3vNSXupOaaBDPqzdMB8GA1UdIwQYMBaAFFNV +M/JL69BRscF4msEoMXvv6u1JMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/ +BAQDAgGGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjANBgkqhkiG9w0B +AQsFAAOCAgEADxNymiCNr2e37iLReoaxKmZvwox0cTiNAaj7iafRzmwIoY3VXO8Q +ix5IYcp4FaQ7fV1jyp/AmaSnyHf6Osl0sx8PxsQkO7ALttxKUrjfbvNSVUA2C/vl +u5m7UVJLIUtFDZBWanzUSmkTsYLHpiANFQKd2c/cU1qXcyzgJVFEFVyyHNkF7Is+ ++pjG9M1hwQHOoTnEuU013P7X1mHek+RXEfhJWwe7UsZnBKZaZKbQZu7hEtqKWYp/ +QsHgnjoLYXsh0WD5rz/mBxdTdDLGpFqWDzDqb8rsYnqBzoowvsasV8X8OSkov0Ht +8Yka0ckFH9yf8j1Cwmbl6ttuonOhky3N/gwLEozuhy7TPcZGVyzevF70kXy7g1CX +kpFGJyEHXoprlNi8FR4I+NFzbDe6a2cFow1JN19AJ9Z5Rk5m7M0mQPaQ4RcikjB3 +aoLsASCJTm1OpOFHfxEKiBW4Lsp3Uc5/Rb9ZNbfLrwqWZRM7buW1e3ekLqntgbky +uKKISHqVJuw/vXHl1jNibEo9+JuQ88VNuAcm7WpGUogeCa2iAlPTckPZei+MwZ8w +tpvxTyYlZEC8DWzY1VC29+W2N5cvh01e2E3Ql08W1zL63dqrgdEZ3VWjzooYi4ep +BmMXTvouW+Flyvcw/0oTcfN0biDIt0mCkZ5CQVjfGL9DTOYteR5hw+k= +-----END CERTIFICATE----- diff --git a/installation/sdnc-web/certs/key.pem b/installation/sdnc-web/certs/key.pem new file mode 100644 index 00000000..04bc8491 --- /dev/null +++ b/installation/sdnc-web/certs/key.pem @@ -0,0 +1,29 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC0LcK1txIq7tfA +QA1IgSGxFLK7oi7ut4eow6ay6q8Rree3eTEqcWkaDj6FgzxP2ei7zMExn4kCD7BZ +2dh92LQ7CP6dXzhQB8QlJeQrOB52IyVJA7NlO3V1GGUfHpzT2UXxWTVDmo8REVIM +hP9IPsh0tQJcrDCJxQ25ZjRGIEKDYjffehaQWph4rwg18OtdmwZJGUDk3iiWgmdA +zxiGBgCbX0NZCC+2NQ93NwtFQ9/YaJrcaiG9ta43ut2FSEqa23yl9EcYo5FsNMF4 +2kQ8MTxsB06wx4LKzx/87/R2pOnCZE8OXu1QRx5S9bB2ID0gy3f/DxRpJg+Gvzfy +Ci8v9eCjAgMBAAECggEAbB+J2MIjhOAPWK8XSYs0TK+/EhohT9+S6RN/1Z4/sLxL +cS6o8m9cQuaJXlWCu+hoYUpeJQk3jqUbjs/LurlwbnzXTlj10hDXA/PZGJZ0sTAm +D8rIvNcRhVM+W45jTj30WwDNleQKNpPOSPUGvLPwVxjIchRijEpUEg3jELILOAuW +ebloKLqc5SDAPKIpepZO7bz4L/dVlQSEBp3OTzyfeecbBNS2Vfw0K+I5BqGJAssZ +Dq+ixSHRj6mdvm7tf5e14j65W8VKvUoHbktp9z2OBCItySV4g1dqrfM7T9SqsosH +cbwR5dIieiFnhdg94rfpzH2QTCBt5MGUpCcv+CbQAQKBgQDkenCAImG1jAjzQNxb +7LXLJeIqJC2E3290hEYge2Bi+1/WmV222AAwNUEPQfKa7qUJRLpX8a4p+9kTaZos +93szyYEyp4vf93GDHvQPmKMJDCbbxa94txd5dnrtYTN+MCPjpwr+75++JRUUwcNr +k3mkzM87zhSBkyYcGiCsza4gQQKBgQDJ4enp8Zly3GqufbWJNpKut6e9hC6f4qWi +4qRUBmjnogm0HiGmn83n9B6SI6OnaRy/dXgPBogZDeETyzGu78nArDK+cy8wSy0H +aPuApqGJzsuAl6YWudYt4ooBcJL99XgTGxFAb2q04JKxh18V6DRfj7pY2uhZongI +OdcMSE2H4wKBgQCUzNEcAkhUbmEd264oCB/VsFR9UZZ7pPD3l3X8jZ2WmVQvdS69 +eCuXOfenMjIIiUfeo24g/HuLSER2Ch6pDnykm6WTEd9c+9Bnru8QgT4dFFbyZusC +2WtmZa1lkBpzInMdPptAsVr+ATSbkh3tn9xnYiPNNUfRo738K2AAauvugQKBgQCd +dzbqoOXdr4sOm0LzybtTyDBwJB/x2ej0Se9/EpjUw5DqCu6YduE2YTVPK7lEpTol +JE0G+0NAt5CtzbntB1/Ihwf1gQZ3lsuCkiJJ0K8DPGeC38ZOx5kFpUObp+EfcU29 +KUmlhsImX1xMWJiUD9B6ETN6hxTghVc2o1bXX7YJnQKBgQCGiRnjCEmKd8hefkS8 +ub9F4kdOzXmG4XhK+oZWVGPXIGfnoxm6IbWcjSArA/m8TLfJSHPKujnLOnOkffpi +7+PWzTHn5BFDGUb8z3mxwJV8e9szoDkljoiUwYU/S8eatAm6lyJv1gp2wmDI9DfT +86BefCEvGk3EzAo3L6hhHdICzA== +-----END PRIVATE KEY----- + diff --git a/installation/sdnc-web/pom.xml b/installation/sdnc-web/pom.xml index a3eeddfc..3a096ffd 100644 --- a/installation/sdnc-web/pom.xml +++ b/installation/sdnc-web/pom.xml @@ -1,325 +1,196 @@ - 4.0.0 + 4.0.0 - - org.onap.ccsdk.parent - odlparent-lite - 2.0.0-SNAPSHOT - + + org.onap.sdnc.oam + installation + 2.7.0-SNAPSHOT + - org.onap.sdnc.oam - installation-sdnc-web - 2.0.0-SNAPSHOT - pom + installation-sdnc-web + pom - sdnc-oam :: installation :: ${project.artifactId} - Creates SDN Controller WebUI Docker container + sdnc-oam :: installation :: ${project.artifactId} + Creates SDN Controller WebUI Docker container - - docker.io/bitnami/nginx:1.16-debian-9 - onap/sdnc-web-image - ${project.version} - ${maven.build.timestamp} - org.onap.ccsdk.features.sdnr.wt - 1.0.0-SNAPSHOT - ${https_proxy} - yyyyMMdd'T'HHmmss'Z' - deploy - true - + + docker.io/bitnami/nginx:1.21-debian-10 + onap/sdnc-web-image + ${project.version} + ${maven.build.timestamp} + ${https_proxy} + yyyyMMdd'T'HHmmss'Z' + - - - org.onap.ccsdk.features.sdnr.wt - sdnr-wt-odlux-framework - ${ccsdk.features.version} - - - org.onap.ccsdk.features.sdnr.wt - sdnr-wt-odlux-apps-installer - ${ccsdk.features.version} - zip - repo - - - org.onap.ccsdk.features.sdnr.wt - sdnr-wt-helpserver-installer - ${ccsdk.features.version} - zip - repo - - + + + org.onap.ccsdk.features.sdnr.odlux + sdnr-odlux-installer + ${ccsdk.features.version} + zip + repo + + - - - - org.codehaus.groovy.maven - gmaven-plugin - 1.0 - - - validate - - execute - - - ${basedir}/../TagVersion.groovy - - - - - - maven-resources-plugin - 2.6 - - - copy-dockerfile - - copy-resources - - validate - - ${basedir}/target/docker-stage - - - src/main/docker - - Dockerfile - - true - - - - - - copy-siteconf - - copy-resources - - validate - - ${basedir}/target/docker-stage - - - src/main/resources - - *.conf - - true - - - - - - - copy-scripts - - copy-resources - - validate - - ${basedir}/target/docker-stage/bin - - - src/main/scripts - - *.sh - - true - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack features - generate-sources - - unpack - - - - - - ${ccsdk.groupId} - sdnr-wt-odlux-framework - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-connectApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-eventLogApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-helpApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-maintenanceApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-minimumApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-configurationApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-demoApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-faultApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/* - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-inventoryApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-mediatorApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-odlux-app-performanceHistoryApp - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - odlux/** - - - - ${ccsdk.groupId} - sdnr-wt-helpserver-provider - ${ccsdk.features.version} - jar - false - ${project.build.directory}/docker-stage/html - help/** - - - - - - - - io.fabric8 - docker-maven-plugin - 0.16.5 - false - - - - ${image.name} - - try - ${basedir}/target/docker-stage - ${basedir}/target/docker-stage/Dockerfile - - ${project.docker.latestminortag.version} - ${project.docker.latestfulltag.version} - ${project.docker.latesttagtimestamp.version} - - - - - - - - generate-images - package - - build - - - - push-images - ${docker.push.phase} - - build - push - - - - - - + + + + org.codehaus.gmaven + groovy-maven-plugin + 2.1.1 + + + validate + + execute + + + ${basedir}/../TagVersion.groovy + + + + + + maven-resources-plugin + 2.6 + + + copy-dockerfile + + copy-resources + + validate + + ${basedir}/target/docker-stage + + + src/main/docker + + Dockerfile + + true + + + + + + copy-siteconf + + copy-resources + + validate + + ${basedir}/target/docker-stage/conf + + + src/main/resources + + *.conf + *.rules + + true + + + + + + copy-scripts + + copy-resources + + validate + + ${basedir}/target/docker-stage/bin + + + src/main/scripts + + *.sh + *.py + + true + + + + + + copy-favicon + + copy-resources + + validate + + ${basedir}/target/docker-stage/html + + + src/main/resources + + favicon.ico + odlux.application.list + + false + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack features + generate-sources + + unpack-dependencies + + + ${basedir}/target/docker-stage/html + true + false + true + true + + + + + + io.fabric8 + docker-maven-plugin + 0.34.0 + false + + + + ${image.name} + + try + true + ${basedir}/target/docker-stage + Dockerfile + + ${project.docker.latestminortag.version} + ${project.docker.latestfulltag.version} + ${project.docker.latesttagtimestamp.version} + + + + + ${docker.verbose} + ${docker.skip.push} + + + + build-push-images + + build + push + + + + + + diff --git a/installation/sdnc-web/src/main/docker/Dockerfile b/installation/sdnc-web/src/main/docker/Dockerfile index 5009a215..6433d3f6 100644 --- a/installation/sdnc-web/src/main/docker/Dockerfile +++ b/installation/sdnc-web/src/main/docker/Dockerfile @@ -21,36 +21,45 @@ # Base bitnami nginx image FROM ${base.image.repo} -MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org) - +LABEL maintainer="CCSDK Team (onap-ccsdk@lists.onap.org)" +USER root +RUN apt-get update && apt-get install python3-minimal python3-urllib3 unzip openssl -y +USER 1001 # copy ODLUX files to nginx COPY html /opt/bitnami/nginx/html # copy site conf files -COPY http_site.conf /opt/bitnami/nginx/conf/server_blocks/ -COPY https_site.conf /opt/bitnami/nginx/conf/server_blocks/ +COPY conf/* /opt/bitnami/nginx/conf/server_blocks/ # setup environment variables ENV WEBPROTOCOL="HTTP" \ - WEBPORT="8080" \ - SDNRPROTOCOL="HTTP" \ - SDNRHOST="172.18.0.3" \ - SDNRPORT="8181" \ - SSL_CERT_DIR="/app/cert" \ - SSL_CERTIFICATE="cert.pem" \ - SSL_CERTIFICATE_KEY="cert.key" + WEBPORT="8080" \ + SDNRPROTOCOL="HTTP" \ + SDNRHOST="172.18.0.3" \ + SDNRPORT="8181" \ + SDNRWEBSOCKETPORT="8182" \ + TRPCEURL="" \ + TOPOURL="" \ + TILEURL="" \ + SITEDOCURL="" \ + DNS_RESOLVER="1.1.1.1 ipv6=off" \ + DNS_INTERNAL_RESOLVER="127.0.0.11" \ + SSL_CERT_DIR="/app/cert" \ + SSL_CERTIFICATE="cert.pem" \ + SSL_CERTIFICATE_KEY="cert.key" # Check if /app can be used. If so, create "custom" directory and copy the files there. -COPY bin/configure.sh /opt/bitnami/nginx/sbin -COPY bin/run.sh /opt/bitnami/nginx/sbin +COPY bin/* /opt/bitnami/nginx/sbin/ USER root -RUN chmod +x /opt/bitnami/nginx/sbin/configure.sh -RUN chmod +x /opt/bitnami/nginx/sbin/run.sh +RUN chmod +x /opt/bitnami/nginx/sbin/run.sh /opt/bitnami/nginx/sbin/opm.py # By default, docker copies files with the permissions of the build user. To avoid cases where build user # has 644 which can result in failure of certain commands -RUN chmod -R g+w /opt/bitnami/nginx/html/odlux - +RUN chmod -R g+w /opt/bitnami/nginx/html/odlux && mkdir /app/init.d +RUN chmod 666 /opt/bitnami/nginx/conf/server_blocks/*.rules +#RUN chown 1001:1001 /app/odlux.application.list && chmod 777 /app/odlux.application.list +RUN chown -R 1001:1001 /app +RUN ln -s /opt/bitnami/nginx/sbin/opm.py /usr/local/bin/opm USER 1001 CMD [ "/opt/bitnami/nginx/sbin/run.sh" ] diff --git a/installation/sdnc-web/src/main/resources/favicon.ico b/installation/sdnc-web/src/main/resources/favicon.ico new file mode 100644 index 00000000..650067eb Binary files /dev/null and b/installation/sdnc-web/src/main/resources/favicon.ico differ diff --git a/installation/sdnc-web/src/main/resources/http_site.conf b/installation/sdnc-web/src/main/resources/http_site.conf index 640668a1..1fe43039 100644 --- a/installation/sdnc-web/src/main/resources/http_site.conf +++ b/installation/sdnc-web/src/main/resources/http_site.conf @@ -40,33 +40,27 @@ # Default server configuration # server { - listen WEBPORT default_server ; - listen [::]:WEBPORT default_server; + listen WEBPORT default_server ; + listen [::]:WEBPORT default_server; -# root /var/www; +# root /var/www; - index index.html index.htm index.nginx-debian.html; + index index.html index.htm index.nginx-debian.html; - server_name _; + server_name _; - location ~ ^/$ { - return 301 /odlux/index.html; - } - location ~ /help/$ { - try_files /help/$args.json $uri; - } - location / { - try_files $uri $uri/ @backend; - } - location /websocket { - proxy_pass SDNRPROTOCOL://SDNRHOST:SDNRPORT/websocket; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } - location @backend { - proxy_pass SDNRPROTOCOL://SDNRHOST:SDNRPORT; - } + include server_blocks/location.rules; + gzip on; + gzip_min_length 1000; + gzip_comp_level 5; + gzip_proxied any; + gzip_vary on; + gzip_types text/plain + application/json + application/xml + application/yang-data+json + application/yang-data+xml + text/javascript + application/javascript; } - diff --git a/installation/sdnc-web/src/main/resources/https_site.conf b/installation/sdnc-web/src/main/resources/https_site.conf index 5dc4cfba..734a48bc 100644 --- a/installation/sdnc-web/src/main/resources/https_site.conf +++ b/installation/sdnc-web/src/main/resources/https_site.conf @@ -40,52 +40,46 @@ # Default server configuration # server { - listen WEBPORT ssl default_server ; - listen [::]:WEBPORT ssl default_server; + listen WEBPORT ssl default_server ; + listen [::]:WEBPORT ssl default_server; - # SSL configuration - # - # listen 443 ssl default_server; - # listen [::]:443 ssl default_server; - # - # Note: You should disable gzip for SSL traffic. - # See: https://bugs.debian.org/773332 - # - # Read up on ssl_ciphers to ensure a secure configuration. - # See: https://bugs.debian.org/765782 - # - # Self signed certs generated by the ssl-cert package - # Don't use them in a production server! - # - # include snippets/snakeoil.conf; + # SSL configuration + # + # listen 443 ssl default_server; + # listen [::]:443 ssl default_server; + # + # Note: You should disable gzip for SSL traffic. + # See: https://bugs.debian.org/773332 + # + # Read up on ssl_ciphers to ensure a secure configuration. + # See: https://bugs.debian.org/765782 + # + # Self signed certs generated by the ssl-cert package + # Don't use them in a production server! + # + # include snippets/snakeoil.conf; - ssl_certificate SSL_CERT_DIR/SSL_CERTIFICATE; - ssl_certificate_key SSL_CERT_DIR/SSL_CERTIFICATE_KEY; - -# root /var/www; + ssl_certificate SSL_CERT_DIR/SSL_CERTIFICATE; + ssl_certificate_key SSL_CERT_DIR/SSL_CERTIFICATE_KEY; - index index.html index.htm index.nginx-debian.html; +# root /var/www; - server_name _; + index index.html index.htm index.nginx-debian.html; - location ~ ^/$ { - return 301 /odlux/index.html; - } - location ~ /help/$ { - try_files /help/$args.json $uri; - } - location / { - try_files $uri $uri/ @backend; - } - location /websocket { - proxy_pass SDNRPROTOCOL://SDNRHOST:SDNRPORT/websocket; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } - location @backend { - proxy_pass SDNRPROTOCOL://SDNRHOST:SDNRPORT; - } + server_name _; + include server_blocks/location.rules; + + gzip on; + gzip_min_length 1000; + gzip_comp_level 5; + gzip_proxied any; + gzip_vary on; + gzip_types text/plain + application/json + application/xml + application/yang-data+json + application/yang-data+xml + text/javascript + application/javascript; } - diff --git a/installation/sdnc-web/src/main/resources/location.rules b/installation/sdnc-web/src/main/resources/location.rules new file mode 100644 index 00000000..8f1f527f --- /dev/null +++ b/installation/sdnc-web/src/main/resources/location.rules @@ -0,0 +1,30 @@ +location ~ ^/$ { + return 301 " /odlux/index.html"; +} +location ~ ^/help/$ { + try_files /help/$args.json $uri; +} +location ~ ^/transportpce { + resolver DNS_INTERNAL_RESOLVER; + if ($request_uri ~* "/transportpce/(.*)") { + proxy_pass TRPCEURL/$1; + } +} +location ~ ^/tiles/ { + resolver DNS_RESOLVER; + if ($request_uri ~* "/tiles/(.*)") { + proxy_pass TILEURL/$1; + } +} +location / { + try_files $uri $uri/ @backend; +} +location /websocket { + proxy_pass http://SDNRHOST:SDNRWEBSOCKETPORT/websocket; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; +} +location @backend { + proxy_pass SDNRPROTOCOL://SDNRHOST:SDNRPORT; +} \ No newline at end of file diff --git a/installation/sdnc-web/src/main/resources/odlux.application.list b/installation/sdnc-web/src/main/resources/odlux.application.list new file mode 100644 index 00000000..c56559cb --- /dev/null +++ b/installation/sdnc-web/src/main/resources/odlux.application.list @@ -0,0 +1,8 @@ +1 connectApp +10 faultApp +20 maintenanceApp +30 configurationApp +55 performanceHistoryApp +70 inventoryApp +75 eventLogApp +200 helpApp diff --git a/data-migrator/src/test/resources/log4j.properties b/installation/sdnc-web/src/main/scripts/configure.py similarity index 66% rename from data-migrator/src/test/resources/log4j.properties rename to installation/sdnc-web/src/main/scripts/configure.py index 82f1f470..255cbcd5 100644 --- a/data-migrator/src/test/resources/log4j.properties +++ b/installation/sdnc-web/src/main/scripts/configure.py @@ -1,8 +1,11 @@ +#!/bin/bash + ### # ============LICENSE_START======================================================= -# ONAP : SDN-C +# ONAP : ccsdk distribution web # ================================================================================ -# Copyright (C) 2019 AMDOCS +# Copyright (C) 2020 highstreet technologies GmbH 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. @@ -18,12 +21,14 @@ # ============LICENSE_END========================================================= ### -log4j.rootLogger=DEBUG,CONSOLE +# load core methods to call +from core import * -# CONSOLE is set to be a ConsoleAppender using a PatternLayout. -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.Threshold=DEBUG -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n +# Comment listening on 8080 in nginx.conf as we don't want nginx to listen on any port other than SDNR +sedInFile('listen','\#listen', '/opt/bitnami/nginx/conf/nginx.conf') +initial_load() +update_index_html() +check_for_rule_template() +update_nginx_site_conf() diff --git a/installation/sdnc-web/src/main/scripts/configure.sh b/installation/sdnc-web/src/main/scripts/configure.sh deleted file mode 100644 index ca2ea764..00000000 --- a/installation/sdnc-web/src/main/scripts/configure.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -### -# ============LICENSE_START======================================================= -# ONAP : ccsdk distribution web -# ================================================================================ -# Copyright (C) 2020 highstreet technologies GmbH 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========================================================= -### - -# Comment listening on 8080 in nginx.conf as we don't want nginx to listen on any port other than SDNR -sed -i 's/listen/\#listen/g' /opt/bitnami/nginx/conf/nginx.conf - -update_index_html() { - - # Backup the index.html file - cp /opt/bitnami/nginx/html/odlux/index.html /opt/bitnami/nginx/html/odlux/index.html.backup - sed -z 's/