Merge "Add if-cap-support for If-OTU4-ODU4 ports (7.1)"
authorGuillaume Lambert <guillaume.lambert@orange.com>
Thu, 27 Jul 2023 14:14:14 +0000 (14:14 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 27 Jul 2023 14:14:14 +0000 (14:14 +0000)
.pre-commit-config.yaml
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/RendererListenerImpl.java
tests/Xtesting/Dockerfile
tests/Xtesting/INSTALL.txt
tests/Xtesting/patch.diff [new file with mode: 0644]
tests/Xtesting/site.yml
tests/Xtesting/testcases.yaml

index e2513a9137ec63ec05c175b762b977a714621703..954379b1e9bce0d377613103bf09127883a63636 100644 (file)
@@ -4,7 +4,7 @@ repos:
     rev: v4.3.0
     hooks:
       - id: trailing-whitespace
-        exclude: '^ordmodels/'
+        exclude: '^ordmodels/|.diff$'
         # ordmodels trailing blanks shall preferably be fixed in OpenROADM upstream repo
 
   - repo: https://github.com/jorisroovers/gitlint
index 42d7ed6059541e41a46841560d5e5a87b1dc25a3..d71da9f17723d1bf91463716f1af2b2048dfaeb0 100644 (file)
@@ -242,12 +242,17 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
             return ModelMappingUtils.createCreateServiceReply(input, ResponseCodes.FINAL_ACK_YES,
                     LogMessages.serviceInDS(serviceName), ResponseCodes.RESPONSE_FAILED);
         }
+        // TODO: Here we also have to check if there is an associated temp-service.
+        // TODO: If there is one, delete it from the temp-service-list??
         this.pceListenerImpl.setInput(new ServiceInput(input));
         this.pceListenerImpl.setServiceReconfigure(false);
         this.pceListenerImpl.setTempService(false);
         this.pceListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations);
         this.rendererListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
         this.rendererListenerImpl.setServiceInput(new ServiceInput(input));
+        // This ensures that the temp-service boolean is false, especially, when
+        // service-create is initiated after the temp-service-create
+        this.rendererListenerImpl.setTempService(false);
         this.networkModelListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
         LOG.debug(SERVICE_CREATE_MSG, LogMessages.PCE_CALLING);
         PathComputationRequestOutput output = this.pceServiceWrapper.performPCE(input, true);
index 5ded8540ec39b00527bd865f44237f7c6e697b05..adc23ae083dfd611c8d7bda3667cc47ceb981ac8 100644 (file)
@@ -198,6 +198,17 @@ public class RendererListenerImpl implements TransportpceRendererListener, Rende
         } else {
             OperationResult operationResult = this.serviceDataStoreOperations.modifyService(
                     serviceRpcResultSp.getServiceName(), State.InService, AdminStates.InService);
+            // Here the service is implemented and the tempService has to be deleted if present
+            String commonId = input.getCommonId();
+            if (commonId != null) {
+                if (this.serviceDataStoreOperations.getTempService(commonId).isPresent()) {
+                    LOG.info("Temp-service exists with the common-Id {}", commonId);
+                    // Delete the common-id from this temp-service-list here
+                    OperationResult tempServiceListDelete = serviceDataStoreOperations.deleteTempService(commonId);
+                    LOG.info("Result for temp-service-list with {} is {}", commonId, tempServiceListDelete);
+                }
+            }
+
             if (operationResult.isSuccess()) {
                 sendNbiNotification(nbiNotificationBuilder
                     .setResponseFailed("")
index 5b1aad183765f5429b46126efff6fd17293ff5b7..82963d445407d2b0b5068d0e66c7cb7aaf4a13a7 100644 (file)
@@ -4,6 +4,8 @@ ARG BRANCH=master
 
 RUN apk --update add \
         build-base \
+        checkbashisms \
+        curl \
         linux-headers \
         git \
         gcc \
@@ -11,6 +13,7 @@ RUN apk --update add \
         libxslt-dev \
         maven \
         openjdk17-jdk \
+        openssl-dev \
         python3 \
         python3-dev \
         py3-pip \
index eb922f0382d7096535a3657f557a06a1294aed0b..eb47e85e38423d01a94e5028958b67c140c8b58b 100644 (file)
@@ -10,6 +10,9 @@ virtualenv xtesting -p python3 --system-site-packages
 . xtesting/bin/activate
 pip install ansible
 ansible-galaxy install collivier.xtesting
+## Until https://github.com/collivier/ansible-role-xtesting/pull/19 is fixed, the following command
+## or any equivalent must be performed so that the playbook correctly performs Jenkins configuration
+## sed -i_ 's/port\:{/port: {/' ~/.ansible/roles/collivier.xtesting/templates/run.yaml.j2
 ansible-galaxy collection install ansible.posix community.general community.grafana community.kubernetes community.docker community.postgresql
 ansible-playbook site.yml
 deactivate
diff --git a/tests/Xtesting/patch.diff b/tests/Xtesting/patch.diff
new file mode 100644 (file)
index 0000000..d8999db
--- /dev/null
@@ -0,0 +1,31 @@
+diff --git a/tox.ini b/tox.ini
+index 7cae5c70..dd44b57a 100644
+--- a/tox.ini
++++ b/tox.ini
+@@ -94,7 +94,7 @@ commands =
+   ./build_karaf_for_tests.sh
+ [testenv:tests121]
+-depends = buildcontroller,build_karaf_tests121,sims121,testsPCE
++depends = buildcontroller,build_karaf_tests121,sims121
+ # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
+ allowlist_externals = launch_tests.sh
+ passenv = LAUNCHER, USE_LIGHTY, NO_ODL_STARTUP, USE_ODL_RESTCONF_VERSION
+@@ -127,7 +127,7 @@ commands =
+   ./build_karaf_for_tests.sh
+ [testenv:tests221]
+-depends = buildcontroller,build_karaf_tests221,sims221,tests71
++depends = buildcontroller,build_karaf_tests221,sims221,tests_tapi
+ # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
+ allowlist_externals = launch_tests.sh
+ passenv = LAUNCHER, USE_LIGHTY, NO_ODL_STARTUP, USE_ODL_RESTCONF_VERSION
+@@ -152,7 +152,7 @@ commands =
+   ./build_karaf_for_tests.sh
+ [testenv:tests71]
+-depends = buildcontroller,build_karaf_tests71,sims71,tests_tapi
++depends = buildcontroller,build_karaf_tests71,sims71
+ allowlist_externals = launch_tests.sh
+ passenv = LAUNCHER, USE_LIGHTY, NO_ODL_STARTUP, USE_ODL_RESTCONF_VERSION
+ setenv =
index 3dc17f28fc331e84787e78cddab3b7cff65f149f..fc832f37f96015b5d9c34e4b7ee8fb26c255384d 100644 (file)
       suites:
         - container: tpce0
           tests:
-            - pre-commit
+            - combined
+#            - linters
+#            - build
+#            - PCE
+#            - 121
+#            - 221
+#            - 71
+#            - hybrid
index 315d3a2dc019d02120244e093f8fd9e25003d2a0..67cd870ffc071c18597ae0d65c6346230144c6b1 100644 (file)
 ---
 tiers:
     -
-        name: transportpce
+        name: suites
+        order: 0
+        description: 'transportPCE tests by category'
+        testcases:
+            -
+                case_name: linters
+                project_name: transportpce
+                criteria: 100
+                blocking: true
+                clean_flag: false
+                description: 'linters suite'
+                run:
+                    name: 'bashfeature'
+                    args:
+                        cmd: 'cd /src/transportpce && tox -o -p auto -e docs,docs-linkcheck,pre-commit,checkbashisms,pylint'
+                        console: true
+            -
+                case_name: build
+                project_name: transportpce
+                criteria: 100
+                blocking: true
+                clean_flag: false
+                description: 'build transportpce with karaf and lighty.io'
+                run:
+                    name: 'bashfeature'
+                    args:
+                        cmd: 'cd /src/transportpce && tox -e buildcontroller,buildlighty'
+                        console: true
+            -
+                case_name: PCE
+                project_name: transportpce
+                criteria: 100
+                blocking: true
+                clean_flag: false
+                description: 'run PCE tests'
+                run:
+                    name: 'bashfeature'
+                    args:
+                        cmd: 'cd /src/transportpce && tox -e buildcontroller,testsPCE'
+                        console: true
+            -
+                case_name: 121
+                project_name: transportpce
+                criteria: 100
+                blocking: true
+                clean_flag: false
+                description: 'run OpenROADM device 1.2.1 tests suite'
+                run:
+                    name: 'bashfeature'
+                    args:
+                        cmd: 'cd /src/transportpce && tox -e buildcontroller,build_karaf_tests121,sims121,tests121'
+                        console: true
+            -
+                case_name: 221
+                project_name: transportpce
+                criteria: 100
+                blocking: true
+                clean_flag: false
+                description: 'run OpenROADM device 2.2.1 tests suite'
+                run:
+                    name: 'bashfeature'
+                    args:
+                        cmd: 'cd /src/transportpce && tox -e buildcontroller,build_karaf_tests221,sims221,tests221'
+                        console: true
+            -
+                case_name: 71
+                project_name: transportpce
+                criteria: 100
+                blocking: true
+                clean_flag: false
+                description: 'run OpenROADM device 7.1 tests suite'
+                run:
+                    name: 'bashfeature'
+                    args:
+                        cmd: 'cd /src/transportpce && tox -e buildcontroller,build_karaf_tests71,sims71,tests71'
+                        console: true
+            -
+                case_name: hybrid
+                project_name: transportpce
+                criteria: 100
+                blocking: true
+                clean_flag: false
+                description: 'run OpenROADM device mixed versions tests suite'
+                run:
+                    name: 'bashfeature'
+                    args:
+                        cmd: 'cd /src/transportpce && tox -e buildcontroller,build_karaf_tests_hybrid,tests_hybrid'
+                        console: true
+    -
+        name: combined
         order: 1
-        description: ''
+        description: 'combine all transportPCE tests'
         testcases:
             -
-                case_name: pre-commit
+                case_name: combined
                 project_name: transportpce
                 criteria: 100
                 blocking: true
                 clean_flag: false
-                description: ''
+                description: 'run all transportPCE tests in parallell with tox'
                 run:
                     name: 'bashfeature'
                     args:
-                        cmd: 'cd /src/transportpce && tox -e pre-commit'
+                        cmd: 'cd /src/transportpce && git apply tests/Xtesting/patch.diff && tox -o -p auto'
                         console: true