Update Functional tests for SP1.6 92/77692/3
authorMartial COULIBALY <martial.coulibaly@gfi.fr>
Mon, 12 Nov 2018 16:04:23 +0000 (17:04 +0100)
committerMartial COULIBALY <martial.coulibaly@gfi.fr>
Tue, 13 Nov 2018 15:55:30 +0000 (16:55 +0100)
Change-Id: Ifd8df94c618dcb5d43cebf8ef1fcba5204c94c90
Signed-off-by: Martial COULIBALY <martial.coulibaly@gfi.fr>
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java [moved from servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java with 100% similarity]
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererCompliancyCheck.java [moved from servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererCompliancyCheck.java with 100% similarity]
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererImpl.java [moved from servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererImpl.java with 100% similarity]
tests/SH_stubs.diff
tests/transportpce_tests/test_olm.py
tests/transportpce_tests/test_pce.py
tests/transportpce_tests/test_portmapping.py
tests/transportpce_tests/test_renderer_service_path_nominal.py
tests/transportpce_tests/test_servicehandler.py
tests/transportpce_tests/test_topoPortMapping.py
tests/transportpce_tests/test_topology.py

index 088fdfe44448beaaae2e28d9facdb8c842400f71..bb26d8af2967ebed315ac92c78b70aea7c229b84 100644 (file)
-diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java
-index e5b44c4..a063b9e 100644
---- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java
-+++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java
-@@ -8,8 +8,6 @@
- package org.opendaylight.transportpce.servicehandler;
- import com.google.common.util.concurrent.ListenableFuture;
--import java.util.ArrayList;
--import java.util.List;
- import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
- import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.path.computation.request.input.ServiceAEnd;
- import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.path.computation.request.input.ServiceAEndBuilder;
-@@ -18,8 +16,6 @@ import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev17
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommon;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.response.parameters.ResponseParametersBuilder;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.Topology;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.TopologyBuilder;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.LifecycleState;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.State;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInput;
-@@ -31,12 +27,6 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.Service
- import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceReconfigureInput;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.Services;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.ServicesBuilder;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.AToZ;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.AToZBuilder;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.AToZKey;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.ZToA;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.ZToABuilder;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.ZToAKey;
- import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.HardConstraintsBuilder;
- import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.SoftConstraintsBuilder;
- import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.RxDirection;
-@@ -238,42 +228,6 @@ public final class ModelMappingUtils {
-                 .setSoftConstraints(serviceReconfigureInput.getSoftConstraints())
-                 .setLifecycleState(LifecycleState.Planned).setServiceAEnd(aend).setServiceZEnd(zend);
-         }
--
--        org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.response
--                .parameters.sp.ResponseParameters responseParameters = output.getResponseParameters();
--        if (responseParameters != null) {
--            // service.setPceMetric(responseParameters.getPceMetric());
--            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426
--                .response.parameters.sp.response.parameters.PathDescription pathDescription =
--                responseParameters.getPathDescription();
--            if (pathDescription != null) {
--                List<AToZ> atozList = new ArrayList<>();
--                List<ZToA> ztoaList = new ArrayList<>();
--
--                for (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426
--                    .path.description.atoz.direction.AToZ tmp : pathDescription.getAToZDirection().getAToZ()) {
--
--                    AToZKey key = new AToZKey(tmp.key().getId());
--                    AToZ atoz = new AToZBuilder().setId(tmp.getId()).withKey(key)
--                            // .setResource(tmp.getResource())
--                            .build();
--                    atozList.add(atoz);
--                }
--
--                for (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426
--                        .path.description.ztoa.direction.ZToA
--                        tmp : pathDescription.getZToADirection().getZToA()) {
--                    ZToAKey key = new ZToAKey(tmp.key().getId());
--                    ZToA ztoa = new ZToABuilder().setId(tmp.getId()).withKey(key)
--                            // .setResource(tmp.getResource())
--                            .build();
--                    ztoaList.add(ztoa);
--                }
--
--                Topology topology = new TopologyBuilder().setAToZ(atozList).setZToA(ztoaList).build();
--                service.setTopology(topology);
--            }
--        }
-         return service.build();
-     }
 diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java
-index b81e9b4..c5b5045 100644
+index ccd0f14..8219393 100644
 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java
 +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java
-@@ -27,6 +27,7 @@ import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOper
+@@ -22,6 +22,7 @@ import org.opendaylight.transportpce.servicehandler.ModelMappingUtils;
+ import org.opendaylight.transportpce.servicehandler.service.PCEServiceWrapper;
+ import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
+ import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperationsImpl;
++import org.opendaylight.transportpce.servicehandler.stub.StubRendererServiceOperations;
  import org.opendaylight.transportpce.servicehandler.validation.ServiceCreateValidation;
  import org.opendaylight.transportpce.servicehandler.validation.checks.ComplianceCheckResult;
  import org.opendaylight.transportpce.servicehandler.validation.checks.ServicehandlerCompliancyCheck;
-+import org.opendaylight.transportpce.stubrenderer.SendingRendererRPCs;
- import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.RpcActions;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.sdnc.request.header.SdncRequestHeaderBuilder;
-@@ -89,6 +90,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
+@@ -84,6 +85,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
+     private DataBroker db;
      private ServiceDataStoreOperations serviceDataStoreOperations;
      private RendererServiceOperations rendererServiceOperations;
++    private StubRendererServiceOperations stubRendererServiceOperations;
      private PCEServiceWrapper pceServiceWrapper;
-+    private SendingRendererRPCs stubrendererService;
  
      //TODO: remove private request fields as they are in global scope
-@@ -145,8 +147,9 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
+@@ -92,6 +94,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
+                               RendererServiceOperations rendererServiceOperations) {
+         this.db = databroker;
+         this.rendererServiceOperations = rendererServiceOperations;
++        this.stubRendererServiceOperations = new StubRendererServiceOperations();
+         this.serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(this.db);
+         this.serviceDataStoreOperations.initialize();
+         this.pceServiceWrapper = new PCEServiceWrapper(pathComputationService);
+@@ -141,8 +144,8 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
  
          ServiceImplementationRequestInput serviceImplementationRequest =
                  ModelMappingUtils.createServiceImplementationRequest(input, pceResponse);
-+        this.stubrendererService = new SendingRendererRPCs();
-         org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
--            .ServiceImplementationRequestOutput serviceImplementationRequestOutput = this.rendererServiceOperations
-+            .ServiceImplementationRequestOutput serviceImplementationRequestOutput = this.stubrendererService
-             .serviceImplementation(serviceImplementationRequest);
+-        ServiceImplementationRequestOutput serviceImplementationRequestOutput = this.rendererServiceOperations
+-            .serviceImplementation(serviceImplementationRequest);
++        ServiceImplementationRequestOutput serviceImplementationRequestOutput = this.stubRendererServiceOperations
++                .serviceImplementation(serviceImplementationRequest);
          if (ResponseCodes.RESPONSE_OK
                  .equals(serviceImplementationRequestOutput.getConfigurationResponseCommon().getResponseCode())) {
-@@ -215,8 +218,9 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
-         LOG.debug("Service '{}' present in datastore !", serviceName);
-         org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput
-                 serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(input);
-+        this.stubrendererService = new SendingRendererRPCs();
-         org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
+             String message = "Service rendered successfully !";
+@@ -216,8 +219,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
+         org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+             .ServiceDeleteInput serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(input);
+         org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
 -            .ServiceDeleteOutput output = this.rendererServiceOperations.serviceDelete(serviceDeleteInput);
-+            .ServiceDeleteOutput output = this.stubrendererService.serviceDelete(serviceDeleteInput);
+-
++            .ServiceDeleteOutput output = this.stubRendererServiceOperations.serviceDelete(serviceDeleteInput);
          if (!ResponseCodes.RESPONSE_OK
                  .equals(output.getConfigurationResponseCommon().getResponseCode())) {
-diff --git a/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java b/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java
-index 6db468c..76e4a26 100644
---- a/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java
-+++ b/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java
-@@ -9,13 +9,8 @@ package org.opendaylight.transportpce.servicehandler.stub;
- import java.util.concurrent.ExecutionException;
- import java.util.concurrent.Future;
--
- import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
- import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
--import org.opendaylight.transportpce.servicehandler.mappers.ServiceDeleteInputConverter;
--import org.opendaylight.transportpce.servicehandler.mappers.ServiceDeleteOutputConverter;
--import org.opendaylight.transportpce.servicehandler.mappers.ServiceImplementationRequestInputConverter;
--import org.opendaylight.transportpce.servicehandler.mappers.ServiceImplementationRequestOutputConverter;
- import org.opendaylight.transportpce.stubrenderer.impl.StubrendererImpl;
- import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
- import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-@@ -30,16 +25,15 @@ public class StubRendererServiceOperations implements RendererServiceOperations
-     private StubrendererImpl stubrenderer;
-     public StubRendererServiceOperations(NotificationPublishService notificationPublishService) {
--        this.stubrenderer = new StubrendererImpl(notificationPublishService);
-+        this.stubrenderer = new StubrendererImpl();
-     }
-     @Override
-     public ServiceImplementationRequestOutput serviceImplementation(ServiceImplementationRequestInput input) {
--        Future<RpcResult<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426
--            .ServiceImplementationRequestOutput>> rpcResultFuture = this.stubrenderer
--                .serviceImplementationRequest(ServiceImplementationRequestInputConverter.getStub(input));
-+        Future<RpcResult<ServiceImplementationRequestOutput>> rpcResultFuture = this.stubrenderer
-+                .serviceImplementationRequest(input);
-         try {
--            return ServiceImplementationRequestOutputConverter.getConcrete(rpcResultFuture.get().getResult());
-+            return rpcResultFuture.get().getResult();
-         } catch (InterruptedException e) {
-             LOG.error("RPC serviceImplementation failed !",e);
-         } catch (ExecutionException e) {
-@@ -50,11 +44,10 @@ public class StubRendererServiceOperations implements RendererServiceOperations
-     @Override
-     public ServiceDeleteOutput serviceDelete(ServiceDeleteInput input) {
--        Future<RpcResult<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426
--            .ServiceDeleteOutput>> rpcResultFuture = this.stubrenderer
--                .serviceDelete(ServiceDeleteInputConverter.getStub(input));
-+        Future<RpcResult<ServiceDeleteOutput>> rpcResultFuture = this.stubrenderer
-+                .serviceDelete(input);
-         try {
--            return ServiceDeleteOutputConverter.getConcrete(rpcResultFuture.get().getResult());
-+            return rpcResultFuture.get().getResult();
-         } catch (InterruptedException e) {
-             LOG.error("RPC serviceDelete failed !",e);
-         } catch (ExecutionException e) {
-diff --git a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/SendingRendererRPCs.java b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/SendingRendererRPCs.java
-index cdcdc0e..b43535f 100644
---- a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/SendingRendererRPCs.java
-+++ b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/SendingRendererRPCs.java
-@@ -8,16 +8,18 @@
- package org.opendaylight.transportpce.stubrenderer;
--import com.google.common.util.concurrent.ListenableFuture;
--import com.google.common.util.concurrent.ListeningExecutorService;
--
- import java.util.ArrayList;
- import java.util.List;
--import java.util.concurrent.Callable;
--
-+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.TopologyBuilder;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.AToZ;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.ZToA;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutputBuilder;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutputBuilder;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
-@@ -41,73 +43,78 @@ public class SendingRendererRPCs {
-     private List<AToZ> atoz;
-     private List<ZToA> ztoa;
-     private String error;
--    private final ListeningExecutorService executor;
--    public SendingRendererRPCs(ListeningExecutorService executor) {
--        success = true;
-+    public SendingRendererRPCs() {
-+        this.success = true;
-         setTopology(null);
--        this.executor = executor;
-         setError("");
-     }
-     private void buildAtoZ() {
--        atoz = new ArrayList<AToZ>();
-+        this.atoz = new ArrayList<AToZ>();
-     }
-     private void buildZtoA() {
--        ztoa = new ArrayList<ZToA>();
-+        this.ztoa = new ArrayList<ZToA>();
-     }
--    public ListenableFuture<Boolean> serviceDelete() {
-+    public ServiceDeleteOutput serviceDelete(ServiceDeleteInput input) {
-+        String message = "Service deleted !";
-+        String responseCode = "200";
-         LOG.info("ServiceDelete request ...");
--        success = false;
--        return executor.submit(new Callable<Boolean>() {
--            @Override
--            public Boolean call() throws Exception {
--                Boolean output = true;
--                LOG.info("Wait for 10s til beginning the Renderer serviceDelete request");
--                try {
--                    Thread.sleep(10000); //sleep for 10s
--                } catch (InterruptedException e) {
--                    output = false;
--                    LOG.error("Thread.sleep failed : {}", e.toString());
--                }
--                buildAtoZ();
--                buildZtoA();
--                success = true;
--                return output;
--            }
--        });
-+        LOG.info("Wait for 10s til beginning the Renderer serviceDelete request");
-+        try {
-+            Thread.sleep(1000); //sleep for 1s
-+        } catch (InterruptedException e) {
-+            message = "deleting service failed !";
-+            LOG.error(message);
-+            responseCode = "500";
-+            setError(message);
-+        }
-+        ConfigurationResponseCommonBuilder configurationResponseCommon = new ConfigurationResponseCommonBuilder()
-+                .setAckFinalIndicator("yes")
-+                .setRequestId(input.getServiceHandlerHeader().getRequestId())
-+                .setResponseCode(responseCode)
-+                .setResponseMessage(message);
-+        ServiceDeleteOutput output =  new ServiceDeleteOutputBuilder()
-+                .setConfigurationResponseCommon(configurationResponseCommon.build())
-+                .build();
-+        return output;
-     }
--    public ListenableFuture<Boolean> serviceImplementation() {
-+    public ServiceImplementationRequestOutput serviceImplementation(ServiceImplementationRequestInput input) {
-+        String message = "Service implemented !";
-+        String responseCode = "200";
-+        setSuccess(true);
-         LOG.info("serviceImplementation request ...");
--        success = false;
--        return executor.submit(new Callable<Boolean>() {
--            @Override
--            public Boolean call() throws Exception {
--                Boolean output = true;
--                LOG.info("Wait for 10s til beginning the Renderer serviceDelete request");
--                try {
--                    Thread.sleep(10000); //sleep for 10s
--                } catch (InterruptedException e) {
--                    output = false;
--                    LOG.error("Thread.sleep failed : {}", e.toString());
--                }
--                buildAtoZ();
--                buildZtoA();
--                setTopology(new TopologyBuilder()
--                        .setAToZ(atoz)
--                        .setZToA(ztoa));
--                output = true;
--                success = true;
--                return output;
--            }
--        });
-+        LOG.info("Wait for 10s til beginning the Renderer serviceDelete request");
-+        try {
-+            Thread.sleep(1000); //sleep for 1s
-+        } catch (InterruptedException e) {
-+            message = "implementing service failed !";
-+            LOG.error(message);
-+            setError(message);
-+            responseCode = "500";
-+            setSuccess(false);
-+        }
-+        buildAtoZ();
-+        buildZtoA();
-+        setTopology(new TopologyBuilder()
-+                .setAToZ(SendingRendererRPCs.this.atoz)
-+                .setZToA(SendingRendererRPCs.this.ztoa));
-+        ConfigurationResponseCommonBuilder configurationResponseCommon = new ConfigurationResponseCommonBuilder()
-+                .setAckFinalIndicator("yes")
-+                .setRequestId(input.getServiceHandlerHeader().getRequestId())
-+                .setResponseCode(responseCode)
-+                .setResponseMessage(message);
-+        ServiceImplementationRequestOutput output =  new ServiceImplementationRequestOutputBuilder()
-+                .setConfigurationResponseCommon(configurationResponseCommon.build())
-+                .build();
-+        return output;
-     }
-     public Boolean getSuccess() {
--        return success;
-+        return this.success;
-     }
-     public void setSuccess(Boolean success) {
-@@ -115,7 +122,7 @@ public class SendingRendererRPCs {
-     }
-     public TopologyBuilder getTopology() {
--        return topology;
-+        return this.topology;
-     }
-     public void setTopology(TopologyBuilder topo) {
-@@ -123,7 +130,7 @@ public class SendingRendererRPCs {
-     }
-     public String getError() {
--        return error;
-+        return this.error;
-     }
-     public void setError(String error) {
-diff --git a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererImpl.java b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererImpl.java
-index 6e197d5..e3e1984 100644
---- a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererImpl.java
-+++ b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererImpl.java
-@@ -9,30 +9,21 @@
- package org.opendaylight.transportpce.stubrenderer.impl;
--import com.google.common.util.concurrent.FutureCallback;
--import com.google.common.util.concurrent.Futures;
- import com.google.common.util.concurrent.ListenableFuture;
--import com.google.common.util.concurrent.ListeningExecutorService;
--import com.google.common.util.concurrent.MoreExecutors;
--import java.util.concurrent.Executors;
--import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
- import org.opendaylight.transportpce.stubrenderer.SendingRendererRPCs;
- import org.opendaylight.transportpce.stubrenderer.StubrendererCompliancyCheck;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceDeleteInput;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceDeleteOutput;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceDeleteOutputBuilder;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceImplementationRequestInput;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceImplementationRequestOutput;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceImplementationRequestOutputBuilder;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceRpcResultSp;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceRpcResultSpBuilder;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.StubrendererService;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.service.rpc.result.sp.PathTopology;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.service.rpc.result.sp.PathTopologyBuilder;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.TopologyBuilder;
--import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.RpcStatusEx;
--import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.ServicePathNotificationTypes;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.CancelResourceReserveInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.CancelResourceReserveOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.PathComputationRequestInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.PathComputationRequestOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutputBuilder;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutputBuilder;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService;
- import org.opendaylight.yangtools.yang.common.RpcResult;
- import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
- import org.slf4j.Logger;
-@@ -45,21 +36,12 @@ import org.slf4j.LoggerFactory;
-  * @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
-  *
-  */
--public class StubrendererImpl implements StubrendererService {
-+public class StubrendererImpl implements TransportpceServicepathService {
-     /** Logging. */
-     private static final Logger LOG = LoggerFactory.getLogger(StubrendererImpl.class);
--    /** send notification. */
--    private NotificationPublishService notificationPublishService;
--    private ServiceRpcResultSp notification;
--    private final ListeningExecutorService executor = MoreExecutors
--            .listeningDecorator(Executors.newFixedThreadPool(10));
-     /** check service sdnc-request-header compliancy. */
-     private StubrendererCompliancyCheck compliancyCheck;
--    public StubrendererImpl(NotificationPublishService notificationPublishService) {
--        this.notificationPublishService = notificationPublishService;
--    }
--
-     @Override
-     public ListenableFuture<RpcResult<ServiceImplementationRequestOutput>> serviceImplementationRequest(
-             ServiceImplementationRequestInput input) {
-@@ -77,102 +59,20 @@ public class StubrendererImpl implements StubrendererService {
-              * a path and implement a service.
-              */
--            this.notification = new ServiceRpcResultSpBuilder()
--                    .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
--                    .setServiceName(input.getServiceName())
--                    .setStatus(RpcStatusEx.Pending)
--                    .setStatusMessage("Service compliant, submitting serviceImplementation Request ...")
--                    .build();
--            try {
--                this.notificationPublishService.putNotification(this.notification);
--            } catch (InterruptedException e) {
--                LOG.info("notification offer rejected : {}", e);
-+            SendingRendererRPCs sendingRenderer = new SendingRendererRPCs();
-+            sendingRenderer.serviceImplementation(input);
-+            if (sendingRenderer.getSuccess()) {
-+                message = "Service implemented !";
-+                LOG.info(message);
-+                responseCode = "200";
-+            } else {
-+                message = "Service implementation failed : " + sendingRenderer.getError();
-+                LOG.error(message);
-+                responseCode = "500";
-             }
--
--            SendingRendererRPCs sendingRenderer = new SendingRendererRPCs(this.executor);
--            FutureCallback<Boolean> rendererCallback =
--                    new FutureCallback<Boolean>() {
--                String message = "";
--                ServiceRpcResultSp notification = null;
--
--                @Override
--                public void onFailure(Throwable arg0) {
--                    LOG.error("Failure message : {}", arg0.toString());
--                    LOG.error("Service implementation failed !");
--                    this.notification = new ServiceRpcResultSpBuilder()
--                            .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
--                            .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
--                            .setStatusMessage("PCR Request failed  : {}" + arg0.getMessage()).build();
--                    try {
--                        StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
--                    } catch (InterruptedException e) {
--                        LOG.info("notification offer rejected : {}", e);
--                    }
--                }
--
--                @Override
--                public void onSuccess(Boolean response) {
--                    LOG.info("response : {}", response);
--                    if (response) {
--                        this.message = "Service implemented !";
--                        TopologyBuilder topo = sendingRenderer.getTopology();
--                        ServiceRpcResultSpBuilder tmp = new ServiceRpcResultSpBuilder()
--                                .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
--                                .setServiceName(input.getServiceName())
--                                .setStatus(RpcStatusEx.Successful)
--                                .setStatusMessage(this.message);
--                        if (topo != null) {
--                            PathTopology value = new PathTopologyBuilder()
--                                    .setAToZ(topo.getAToZ())
--                                    .setZToA(topo.getZToA())
--                                    .build();
--                            tmp.setPathTopology(value);
--                        }
--                        this.notification = tmp.build();
--                    } else {
--                        this.message = "Service implementation failed : " + sendingRenderer.getError();
--                        this.notification = new ServiceRpcResultSpBuilder()
--                                .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
--                                .setServiceName("")
--                                .setStatus(RpcStatusEx.Failed).setStatusMessage(this.message)
--                                .build();
--                    }
--                    LOG.info(this.notification.toString());
--                    try {
--                        StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
--                    } catch (InterruptedException e) {
--                        LOG.info("notification offer rejected : {}", e);
--                    }
--                    LOG.info(this.message);
--                }
--            };
--            ListenableFuture<Boolean> renderer = sendingRenderer.serviceImplementation();
--            Futures.addCallback(renderer, rendererCallback, this.executor);
--            LOG.info("Service implmentation Request in progress ");
--            configurationResponseCommon = new ConfigurationResponseCommonBuilder()
--                    .setAckFinalIndicator("Yes")
--                    .setRequestId(input.getServiceHandlerHeader().getRequestId())
--                    .setResponseCode("200")
--                    .setResponseMessage("Service implementation Request in progress ");
--
--            ServiceImplementationRequestOutput output = new ServiceImplementationRequestOutputBuilder()
--                    .setConfigurationResponseCommon(configurationResponseCommon.build())
--                    .build();
--            return RpcResultBuilder.success(output).buildFuture();
-         } else {
--            message = this.compliancyCheck.getMessage();
-+            message = "Service not compliant";
+             message = "Service delete failed!";
+diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererImpl.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererImpl.java
+index 630fb67..2cc2bdf 100644
+--- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererImpl.java
++++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererImpl.java
+@@ -51,6 +51,8 @@ public final class StubrendererImpl {
+             LOG.error("deleting service failed !", e);
              responseCode = "500";
--            LOG.info("Service not compliant caused by : {}", message);
--            this.notification = new ServiceRpcResultSpBuilder()
--                    .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
--                    .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
--                    .setStatusMessage("Service not compliant caused by : " + message)
--                    .build();
--            try {
--                this.notificationPublishService.putNotification(this.notification);
--            } catch (InterruptedException e) {
--                LOG.info("notification offer rejected : {}", e);
--            }
          }
-         configurationResponseCommon = new ConfigurationResponseCommonBuilder()
++        responseCode = "200";
++        message = "Service deleted";
+         ConfigurationResponseCommonBuilder configurationResponseCommon = new ConfigurationResponseCommonBuilder()
                  .setAckFinalIndicator("yes")
-@@ -201,90 +101,20 @@ public class StubrendererImpl implements StubrendererService {
-              * a path and implement a service.
-              */
--            this.notification = new ServiceRpcResultSpBuilder()
--                    .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
--                    .setServiceName(input.getServiceName())
--                    .setStatus(RpcStatusEx.Pending)
--                    .setStatusMessage("Service compliant, submitting serviceDelete Request ...")
--                    .build();
--            try {
--                this.notificationPublishService.putNotification(this.notification);
--            } catch (InterruptedException e) {
--                LOG.info("notification offer rejected : {}", e);
-+            SendingRendererRPCs sendingRenderer = new SendingRendererRPCs();
-+            sendingRenderer.serviceDelete(input);
-+            if (sendingRenderer.getSuccess()) {
-+                message = "Service deleted !";
-+                responseCode = "200";
-+                LOG.info(message);
-+            } else {
-+                message = "Service implementation failed : " + sendingRenderer.getError();
-+                LOG.error(message);
-+                responseCode = "500";
-             }
--            SendingRendererRPCs sendingRenderer = new SendingRendererRPCs(this.executor);
--            FutureCallback<Boolean> rendererCallback = new FutureCallback<Boolean>() {
--                String message = "";
--                ServiceRpcResultSp notification = null;
--
--                @Override
--                public void onFailure(Throwable arg0) {
--                    LOG.error("Failure message : {}", arg0.toString());
--                    LOG.error("Service delete failed !");
--                    this.notification = new ServiceRpcResultSpBuilder()
--                            .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
--                            .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
--                            .setStatusMessage("PCR Request failed  : " + arg0.getMessage()).build();
--                    try {
--                        StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
--                    } catch (InterruptedException e) {
--                        LOG.info("notification offer rejected : {}", e);
--                    }
--                }
--
--                @Override
--                public void onSuccess(Boolean response) {
--                    LOG.info("response : {}", response);
--                    if (response) {
--                        this.message = "Service deleted !";
--                        this.notification = new ServiceRpcResultSpBuilder()
--                                .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
--                                .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Successful)
--                                .setStatusMessage(this.message).build();
--                    } else {
--                        this.message = "Service delete failed : " + sendingRenderer.getError();
--                        this.notification = new ServiceRpcResultSpBuilder()
--                                .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
--                                .setServiceName("")
--                                .setStatus(RpcStatusEx.Failed).setStatusMessage(this.message)
--                                .build();
--                    }
--                    LOG.info(this.notification.toString());
--                    try {
--                        StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
--                    } catch (InterruptedException e) {
--                        LOG.info("notification offer rejected : {}", e);
--                    }
--                    LOG.info(this.message);
--                }
--            };
--            ListenableFuture<Boolean> renderer = sendingRenderer.serviceDelete();
--            Futures.addCallback(renderer, rendererCallback, this.executor);
--            message = "Service delete Request in progress ...";
--            LOG.info(message);
--            configurationResponseCommon = new ConfigurationResponseCommonBuilder()
--                    .setAckFinalIndicator("Yes")
--                    .setRequestId(input.getServiceHandlerHeader().getRequestId())
--                    .setResponseCode("200")
--                    .setResponseMessage(message);
--            ServiceDeleteOutput output = new ServiceDeleteOutputBuilder()
--                    .setConfigurationResponseCommon(configurationResponseCommon.build())
--                    .build();
--            return RpcResultBuilder.success(output).buildFuture();
-         } else {
--            message = this.compliancyCheck.getMessage();
--            LOG.info("Service not compliant caused by : {}", message);
-+            message = "Service not compliant";
+                 .setRequestId(input.getServiceHandlerHeader().getRequestId())
+@@ -75,6 +77,8 @@ public final class StubrendererImpl {
+             LOG.error(message);
              responseCode = "500";
--            this.notification = new ServiceRpcResultSpBuilder()
--                    .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
--                    .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
--                    .setStatusMessage("Service not compliant caused by : " + message)
--                    .build();
--            try {
--                this.notificationPublishService.putNotification(this.notification);
--            } catch (InterruptedException e) {
--                LOG.info("notification offer rejected : {}", e);
--            }
          }
-         configurationResponseCommon = new ConfigurationResponseCommonBuilder()
++        responseCode = "200";
++        message = "Service implemented";
+         ConfigurationResponseCommonBuilder configurationResponseCommon = new ConfigurationResponseCommonBuilder()
                  .setAckFinalIndicator("yes")
-@@ -296,4 +126,24 @@ public class StubrendererImpl implements StubrendererService {
-                 .build();
-         return RpcResultBuilder.success(output).buildFuture();
-     }
-+
-+    /* (non-Javadoc)
-+     * @see org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService#pathComputationRequest(org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.PathComputationRequestInput)
-+     */
-+    @Override
-+    public ListenableFuture<RpcResult<PathComputationRequestOutput>> pathComputationRequest(
-+            PathComputationRequestInput input) {
-+        // TODO Auto-generated method stub
-+        return null;
-+    }
-+
-+    /* (non-Javadoc)
-+     * @see org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService#cancelResourceReserve(org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.CancelResourceReserveInput)
-+     */
-+    @Override
-+    public ListenableFuture<RpcResult<CancelResourceReserveOutput>> cancelResourceReserve(
-+            CancelResourceReserveInput input) {
-+        // TODO Auto-generated method stub
-+        return null;
-+    }
- }
-diff --git a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererProvider.java b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererProvider.java
-index 0beb087..92b20f5 100644
---- a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererProvider.java
-+++ b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererProvider.java
-@@ -13,9 +13,7 @@ import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService
- import org.opendaylight.controller.md.sal.binding.api.NotificationService;
- import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
- import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.StubrendererListener;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.StubrendererService;
--import org.opendaylight.yangtools.concepts.ListenerRegistration;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
-@@ -27,17 +25,13 @@ import org.slf4j.LoggerFactory;
- public class StubrendererProvider {
-     private static final Logger LOG = LoggerFactory.getLogger(StubrendererProvider.class);
-     private final RpcProviderRegistry rpcRegistry;
--    private final NotificationPublishService notificationPublishService;
--
--    private BindingAwareBroker.RpcRegistration<StubrendererService> rpcRegistration;
--    private ListenerRegistration<StubrendererListener> stubRendererlistenerRegistration;
-+    private BindingAwareBroker.RpcRegistration<TransportpceServicepathService> rpcRegistration;
-     public StubrendererProvider(RpcProviderRegistry rpcProviderRegistry,
-             NotificationService notificationService,
-             NotificationPublishService notificationPublishService) {
-         this.rpcRegistry = rpcProviderRegistry;
--        this.notificationPublishService = notificationPublishService;
-     }
-     /**
-@@ -45,8 +39,8 @@ public class StubrendererProvider {
-      */
-     public void init() {
-         LOG.info("StubrendererProvider Session Initiated");
--        final StubrendererImpl consumer = new StubrendererImpl(this.notificationPublishService);
--        this.rpcRegistration = this.rpcRegistry.addRpcImplementation(StubrendererService.class, consumer);
-+        final StubrendererImpl consumer = new StubrendererImpl();
-+        this.rpcRegistration = this.rpcRegistry.addRpcImplementation(TransportpceServicepathService.class, consumer);
-     }
-     /**
+                 .setRequestId(input.getServiceHandlerHeader().getRequestId())
index bf38678acacd8f863e56ff425e4e5beb6047414a..66a0dac89f38199bf112b217fa0f77548e112fd8 100644 (file)
@@ -199,7 +199,7 @@ class TransportOlmTesting(unittest.TestCase):
         time.sleep(20)
 
     def test_05_connect_xprdA_to_roadmA(self):
-        url = "{}/operations/networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
         data = {
             "networkutils:input": {
                 "networkutils:links-input": {
@@ -221,7 +221,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertIn('Xponder Roadm Link created successfully', res["output"]["result"])
 
     def test_06_connect_roadmA_to_xpdrA(self):
-        url = "{}/operations/networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
         data = {
             "networkutils:input": {
                 "networkutils:links-input": {
@@ -243,7 +243,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
 
     def test_07_connect_xprdC_to_roadmC(self):
-        url = "{}/operations/networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
         data = {
             "networkutils:input": {
                 "networkutils:links-input": {
@@ -265,7 +265,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertIn('Xponder Roadm Link created successfully', res["output"]["result"])
 
     def test_08_connect_roadmC_to_xpdrC(self):
-        url = "{}/operations/networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
         data = {
             "networkutils:input": {
                 "networkutils:links-input": {
@@ -287,7 +287,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
 
     def test_09_create_OTS_ROADMA(self):
-        url = "{}/operations/renderer:create-ots-oms".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-device-renderer:create-ots-oms".format(self.restconf_baseurl)
         data = {
             "input" : {
                 "node-id" : "ROADMA",
@@ -304,7 +304,7 @@ class TransportOlmTesting(unittest.TestCase):
                       res["output"]["result"])
 
     def test_10_create_OTS_ROADMC(self):
-        url = "{}/operations/renderer:create-ots-oms".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-device-renderer:create-ots-oms".format(self.restconf_baseurl)
         data = {
             "input" : {
                 "node-id" : "ROADMC",
@@ -321,7 +321,7 @@ class TransportOlmTesting(unittest.TestCase):
                       res["output"]["result"])
 
     def test_11_get_PM_ROADMA(self):
-        url = "{}/operations/olm:get-pm".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-olm:get-pm".format(self.restconf_baseurl)
         data = {
             "input": {
                 "node-id": "ROADMA",
@@ -352,7 +352,7 @@ class TransportOlmTesting(unittest.TestCase):
             }, res["output"]["measurements"])
 
     def test_12_get_PM_ROADMC(self):
-        url = "{}/operations/olm:get-pm".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-olm:get-pm".format(self.restconf_baseurl)
         data = {
             "input": {
                 "node-id": "ROADMC",
@@ -383,7 +383,7 @@ class TransportOlmTesting(unittest.TestCase):
             }, res["output"]["measurements"])
 
     def test_13_calculate_span_loss_base_ROADMA_ROADMC(self):
-        url = "{}/operations/olm:calculate-spanloss-base".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-olm:calculate-spanloss-base".format(self.restconf_baseurl)
         data = {
             "input": {
                 "src-type": "link",
@@ -405,7 +405,7 @@ class TransportOlmTesting(unittest.TestCase):
         time.sleep(5)
 
     def test_14_calculate_span_loss_base_all(self):
-        url = "{}/operations/olm:calculate-spanloss-base".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-olm:calculate-spanloss-base".format(self.restconf_baseurl)
         data = {
             "input": {
                 "src-type": "all"
@@ -454,7 +454,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertEqual(6, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-receive'])
 
     def test_17_servicePath_create_AToZ(self):
-        url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
         data = {
             "input": {
                 "service-name": "test",
@@ -495,7 +495,7 @@ class TransportOlmTesting(unittest.TestCase):
         time.sleep(40)
 
     def test_18_servicePath_create_ZToA(self):
-        url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
         data = {
             "input": {
                 "service-name": "test",
@@ -536,7 +536,7 @@ class TransportOlmTesting(unittest.TestCase):
         time.sleep(40)
 
     def test_19_service_power_setup_XPDRA_XPDRC(self):
-        url = "{}/operations/olm:service-power-setup".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-olm:service-power-setup".format(self.restconf_baseurl)
         data = {
             "input": {
                 "service-name": "test",
@@ -609,7 +609,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertEqual("power", res['roadm-connections'][0]['opticalControlMode'])
 
     def test_23_service_power_setup_XPDRC_XPDRA(self):
-        url = "{}/operations/olm:service-power-setup".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-olm:service-power-setup".format(self.restconf_baseurl)
         data = {
             "input": {
                 "service-name": "test",
@@ -671,7 +671,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertEqual(2, res['roadm-connections'][0]['target-output-power'])
 
     def test_26_service_power_turndown_XPDRA_XPDRC(self):
-        url = "{}/operations/olm:service-power-turndown".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-olm:service-power-turndown".format(self.restconf_baseurl)
         data = {
             "input": {
                 "service-name": "test",
@@ -732,7 +732,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertEqual("off", res['roadm-connections'][0]['opticalControlMode'])
 
     def test_29_servicePath_delete_AToZ(self):
-        url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
         data = {
             "input": {
                 "service-name": "test",
@@ -773,7 +773,7 @@ class TransportOlmTesting(unittest.TestCase):
         time.sleep(10)
 
     def test_30_servicePath_delete_ZToA(self):
-        url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
         data = {
             "input": {
                 "service-name": "test",
@@ -816,7 +816,7 @@ class TransportOlmTesting(unittest.TestCase):
     """to test case where SRG where the xpdr is connected to has no optical range data"""
 
     def test_31_connect_xprdA_to_roadmA(self):
-        url = "{}/operations/networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
         data = {
             "networkutils:input": {
                 "networkutils:links-input": {
@@ -838,7 +838,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertIn('Xponder Roadm Link created successfully', res["output"]["result"])
 
     def test_32_connect_roadmA_to_xpdrA(self):
-        url = "{}/operations/networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
         data = {
             "networkutils:input": {
                 "networkutils:links-input": {
@@ -860,7 +860,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
 
     def test_33_servicePath_create_AToZ(self):
-        url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
         data = {
             "input": {
                 "service-name": "test2",
@@ -903,7 +903,7 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertEqual(2, res['org-openroadm-optical-channel-interfaces:och']['wavelength-number'])
 
     def test_35_servicePath_delete_AToZ(self):
-        url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
         data = {
             "input": {
                 "service-name": "test",
@@ -956,7 +956,7 @@ class TransportOlmTesting(unittest.TestCase):
         time.sleep(10)
 
     def test_38_calculate_span_loss_current(self):
-        url = "{}/operations/olm:calculate-spanloss-current".format(self.restconf_baseurl)
+        url = "{}/operations/transportpce-olm:calculate-spanloss-current".format(self.restconf_baseurl)
         headers = {'content-type': 'application/json'}
         response = requests.request(
              "POST", url, headers=headers, auth=('admin', 'admin'))
index 05b23c59da5488d09f59817d46e7d7fe131a555e..8d60017be414ce7c2879e2e8b82370bc5169afb7 100644 (file)
@@ -107,7 +107,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     # Path Computation success
     def test_04_path_computation(self):
-        url = ("{}/operations/pce:path-computation-request"
+        url = ("{}/operations/transportpce-pce:path-computation-request"
               .format(self.restconf_baseurl))
         body = {"input": {
                 "service-name": "service-1",
@@ -191,7 +191,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     # Test failed path computation
     def test_09_fail_path_computation(self):
-        url = ("{}/operations/pce:path-computation-request"
+        url = ("{}/operations/transportpce-pce:path-computation-request"
               .format(self.restconf_baseurl))
         body = {"input": {
                 "service-handler-header": {
@@ -212,7 +212,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     # Test1 success path computation
     def test_10_success1_path_computation(self):
-        url = ("{}/operations/pce:path-computation-request"
+        url = ("{}/operations/transportpce-pce:path-computation-request"
               .format(self.restconf_baseurl))
         body = {"input": {
                 "service-name": "service1",
@@ -313,7 +313,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     # Test2 success path computation with path description
     def test_11_success2_path_computation(self):
-        url = ("{}/operations/pce:path-computation-request"
+        url = ("{}/operations/transportpce-pce:path-computation-request"
               .format(self.restconf_baseurl))
         body = {"input": {
                 "service-name": "service 1",
@@ -349,7 +349,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     # Test3 success path computation with hard-constraints exclude
     def test_12_success3_path_computation(self):
-        url = ("{}/operations/pce:path-computation-request"
+        url = ("{}/operations/transportpce-pce:path-computation-request"
               .format(self.restconf_baseurl))
         body = {"input": {
                 "service-name": "service 1",
index 8eb6706449b95fd51e42b273c0c9ce5aed4f870d..f43218f2011d9a0b7d9cc9e127a7995888be7802 100644 (file)
@@ -97,7 +97,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
 #                         'connected')
 
     def test_02_restconfAPI(self):
-        url = ("{}/config/portmapping:network/nodes/controller-config".format(self.restconf_baseurl))
+        url = ("{}/config/transportpce-portmapping:network/nodes/controller-config".format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
             "GET", url, headers=headers, auth=('admin', 'admin'))
@@ -142,7 +142,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         time.sleep(10)
 
     def test_05_rdm_portmapping_DEG1_TTP_TXRX(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/ROADMA/mapping/DEG1-TTP-TXRX"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -156,7 +156,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_06_rdm_portmapping_SRG1_PP7_TXRX(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/ROADMA/mapping/SRG1-PP7-TXRX"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -170,7 +170,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_07_rdm_portmapping_SRG3_PP1_TXRX(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/ROADMA/mapping/SRG3-PP1-TXRX"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -217,7 +217,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         time.sleep(10)
 
     def test_10_xpdr_portmapping_NETWORK1(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/XPDRA/mapping/XPDR1-NETWORK1"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -231,7 +231,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_11_xpdr_portmapping_NETWORK2(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/XPDRA/mapping/XPDR1-NETWORK2"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -245,7 +245,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_12_xpdr_portmapping_CLIENT1(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/XPDRA/mapping/XPDR1-CLIENT1"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -260,7 +260,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_13_xpdr_portmapping_CLIENT2(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/XPDRA/mapping/XPDR1-CLIENT2"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -275,7 +275,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_14_xpdr_portmapping_CLIENT4(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/XPDRA/mapping/XPDR1-CLIENT4"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -314,7 +314,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['errors']['error'])
 
     def test_17_xpdr_device_disconnected(self):
-        url = ("{}/config/portmapping:network/nodes/XPDRA".format(self.restconf_baseurl))
+        url = ("{}/config/transportpce-portmapping:network/nodes/XPDRA".format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
             "GET", url, headers=headers, auth=('admin', 'admin'))
@@ -349,7 +349,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['errors']['error'])
 
     def test_20_rdm_device_disconnected(self):
-        url = ("{}/config/portmapping:network/nodes/ROADMA".format(self.restconf_baseurl))
+        url = ("{}/config/transportpce-portmapping:network/nodes/ROADMA".format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
             "GET", url, headers=headers, auth=('admin', 'admin'))
index 5eb53bd39646f6bce4afbe56baf604386f49bf51..729bbb7f36b2d3c47a6a3d9ecf9801ab4b6748dc 100644 (file)
@@ -126,7 +126,7 @@ class TransportPCERendererTesting(unittest.TestCase):
         time.sleep(20)
 
     def test_03_rdm_portmapping(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/ROADMA"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -144,7 +144,7 @@ class TransportPCERendererTesting(unittest.TestCase):
              res['nodes'][0]['mapping'])
 
     def test_04_xpdr_portmapping(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/XPDRA"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
index 6faf2e3e81bc506390568e7873ca98670987c590..51271fa15eaca92b625453cac681594ac84ea0be 100644 (file)
@@ -657,7 +657,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     # Verify 'test' service deleted
     def test_13_get_service(self):
-        url = ("{}/operational/org-openroadm-service:service-list/services/test-new"
+        url = ("{}/operational/org-openroadm-service:service-list/services/test"
               .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json',
         "Accept": "application/json"}
index fa1ed4db78e74849b696eaf28405d423c44b5447..60a1dd0be6f882bfa27208f984a170dedf257cf9 100644 (file)
@@ -117,7 +117,7 @@ class TransportPCEtesting(unittest.TestCase):
             for i in range(0,nbTP):
                 tp_id=res_topo['node'][0]['ietf-network-topology:termination-point'][i]['tp-id']
                 if(not "CP" in tp_id):
-                    url_map="{}/config/portmapping:network/nodes/ROADMA/mapping/"+tp_id
+                    url_map="{}/config/transportpce-portmapping:network/nodes/ROADMA/mapping/"+tp_id
                     with open('./transportpce_tests/log/topoPortMap.log', 'a') as outfile1:
                         outfile1.write('Config: '+`i`+'/'+ `nbTP`+' : '+url_map+'\n')
                     url = (url_map.format(self.restconf_baseurl))
@@ -142,7 +142,7 @@ class TransportPCEtesting(unittest.TestCase):
             for i in range(0,nbTP):
                 tp_id=res_topo['node'][0]['ietf-network-topology:termination-point'][i]['tp-id']
                 if(not "CTP" in tp_id):
-                    url_map ="{}/config/portmapping:network/nodes/ROADMA/mapping/"+tp_id
+                    url_map ="{}/config/transportpce-portmapping:network/nodes/ROADMA/mapping/"+tp_id
                     with open('./transportpce_tests/log/topoPortMap.log', 'a') as outfile1:
                         outfile1.write('Config: '+`i`+'/'+ `nbTP`+' : '+url_map+'\n')
                     url = (url_map.format(self.restconf_baseurl))
@@ -215,7 +215,7 @@ class TransportPCEtesting(unittest.TestCase):
             nbTP=len(res_topo['node'][0]['ietf-network-topology:termination-point'])
             for i in range(0,nbTP):
                 tp_id=res_topo['node'][0]['ietf-network-topology:termination-point'][i]['tp-id']
-                url_map = "{}/config/portmapping:network/nodes/XPDRA/mapping/"+tp_id
+                url_map = "{}/config/transportpce-portmapping:network/nodes/XPDRA/mapping/"+tp_id
                 with open('./transportpce_tests/log/topoPortMap.log', 'a') as outfile1:
                     outfile1.write('Config: '+`i`+'/'+ `nbTP`+' : '+url_map+'\n')
                 url = url_map.format(self.restconf_baseurl)
@@ -226,7 +226,7 @@ class TransportPCEtesting(unittest.TestCase):
                 if("CLIENT" in tp_id):
                     #Verify the tail equipment id of the client
                     xpdr_client=res_topo['node'][0]['ietf-network-topology:termination-point'][i]["org-openroadm-network-topology:xpdr-client-attributes"]["tail-equipment-id"]
-                    url_map = "{}/config/portmapping:network/nodes/XPDRA/mapping/"+xpdr_client
+                    url_map = "{}/config/transportpce-portmapping:network/nodes/XPDRA/mapping/"+xpdr_client
                     with open('./transportpce_tests/log/topoPortMap.log', 'a') as outfile1:
                         outfile1.write('Config: '+`i`+'/'+ `nbTP`+' : '+xpdr_client+'\n')
                     url = url_map.format(self.restconf_baseurl)
@@ -237,7 +237,7 @@ class TransportPCEtesting(unittest.TestCase):
                 if("NETWORK" in tp_id):
                     #Verify the tail equipment id of the network
                     xpdr_network=res_topo['node'][0]['ietf-network-topology:termination-point'][i]["org-openroadm-network-topology:xpdr-network-attributes"]["tail-equipment-id"]
-                    url_map = "{}/config/portmapping:network/nodes/XPDRA/mapping/"+xpdr_network
+                    url_map = "{}/config/transportpce-portmapping:network/nodes/XPDRA/mapping/"+xpdr_network
                     with open('./transportpce_tests/log/topoPortMap.log', 'a') as outfile1:
                         outfile1.write('Config: '+`i`+'/'+ `nbTP`+' : '+xpdr_network+'\n')
                     url = url_map.format(self.restconf_baseurl)
index 40d21b8767fa2d41e55593ffd9fce7a7cfc8af06..535ffb3eaca72379eb64b39008887231933636cb 100644 (file)
@@ -341,7 +341,7 @@ class TransportPCEtesting(unittest.TestCase):
     #Connect the tail XPDRA to ROADMA and vice versa
     def test_10_connect_tail_xpdr_rdm(self):
          #Connect the tail: XPDRA to ROADMA
-        url = ("{}/operations/networkutils:init-xpdr-rdm-links"
+        url = ("{}/operations/transportpce-networkutils:init-xpdr-rdm-links"
                 .format(self.restconf_baseurl))
         data = {"networkutils:input": {
              "networkutils:links-input": {
@@ -363,7 +363,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_11_connect_tail_rdm_xpdr(self):
          #Connect the tail: ROADMA to XPDRA
-         url = ("{}/operations/networkutils:init-rdm-xpdr-links"
+         url = ("{}/operations/transportpce-networkutils:init-rdm-xpdr-links"
                  .format(self.restconf_baseurl))
          data = {"networkutils:input": {
               "networkutils:links-input": {