Adapt code to support the new version of GNPy 25/87925/2
authoratriki <ahmed.triki.tn@gmail.com>
Mon, 17 Feb 2020 09:36:41 +0000 (10:36 +0100)
committerguillaume.lambert <guillaume.lambert@orange.com>
Wed, 26 Feb 2020 10:08:05 +0000 (11:08 +0100)
- change the gnpy version from 1.2 to 2.2 in tox.ini
- modify the yang model to add a new field "bidirectional"
- delete unused code lines
- update the gnpy tests to support the new version

Change-Id: If318cc4515372bdad86ba46d3c4929bc0a15da43
Signed-off-by: atriki <ahmed.triki.tn@gmail.com>
13 files changed:
api/src/main/yang/gnpy-path-computation-simplified@2019-05-02.yang [deleted file]
api/src/main/yang/gnpy-path-computation-simplified@2020-02-02.yang [new file with mode: 0644]
pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyServiceImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyTopoImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/graph/PostAlgoPathValidator.java
pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceResult.java
pce/src/main/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImpl.java
tests/sample_configs/gnpy/openroadmTopology.json
tests/transportpce_tests/1.2.1/test_gnpy.py
tox.ini

diff --git a/api/src/main/yang/gnpy-path-computation-simplified@2019-05-02.yang b/api/src/main/yang/gnpy-path-computation-simplified@2019-05-02.yang
deleted file mode 100644 (file)
index 9f73607..0000000
+++ /dev/null
@@ -1,630 +0,0 @@
-module gnpy-path-computation-simplified {
-  yang-version 1;
-  namespace "gnpy:path";
-  prefix gnpypc;
-
-  import ietf-yang-types {
-    prefix yang-types;
-  }
-  import ietf-inet-types {
-    prefix inet;
-  }
-
-  organization
-    "Telecom Infra Project OOPT PSE Working Group";
-  contact
-    "WG Web:   <https://github.com/Telecominfraproject/oopt-gnpy>
-     contact:  <mailto:ahmed.triki@orange.com>
-     contact:  <mailto:esther.lerouzic@orange.com>
-    ";
-  description
-    "YANG model for gnpy path computation simplified for transportPCE";
-
-  revision 2019-05-02 {
-    description
-      "second draft with detailed blocking reasons";
-    reference
-      "YANG model for path computation with gnpy inputs";
-  }
-
-  identity SNR-bandwidth {
-    base path-metric-type;
-    description
-      "A metric that records SNR in signal bandwidth";
-  }
-
-  identity OSNR-bandwidth {
-    base path-metric-type;
-    description
-      "A metric that records OSNR in signal bandwidth";
-  }
-
-  identity SNR-0.1nm {
-    base path-metric-type;
-    description
-      "A metric that records SNR in 0.1nm";
-  }
-
-  identity OSNR-0.1nm {
-    base path-metric-type;
-    description
-      "A metric that records OSNR in 0.1nm";
-  }
-
-  identity reference_power {
-    base path-metric-type;
-    description
-      "to be revised";
-  }
-
-  identity path_bandwidth {
-    base path-metric-type;
-    description
-      "to be revised";
-  }
-
-  identity path-metric-type {
-    description
-      "Base identity for path metric type";
-  }
-
-  identity route-usage-type {
-    description
-      "Base identity for route usage";
-  }
-
-  identity route-include-ero {
-    base route-usage-type;
-    description
-      "Include ERO from route";
-  }
-
-  identity route-exclude-ero {
-    base route-usage-type;
-    description
-      "Exclude ERO from route";
-  }
-
-  identity route-exclude-srlg {
-    base route-usage-type;
-    description
-      "Exclude SRLG from route";
-  }
-
-  typedef te-hop-type {
-    type enumeration {
-      enum LOOSE {
-        description
-          "loose hop in an explicit path";
-      }
-      enum STRICT {
-        description
-          "strict hop in an explicit path";
-      }
-    }
-    description
-      "enumerated type for specifying loose or strict
-       paths";
-    reference
-      "RFC3209: section-4.3.2";
-  }
-
-  typedef te-path-disjointness {
-    type bits {
-      bit node {
-        position 0;
-        description
-          "Node disjoint.";
-      }
-      bit link {
-        position 1;
-        description
-          "Link disjoint.";
-      }
-      bit srlg {
-        position 2;
-        description
-          "SRLG (Shared Risk Link Group) disjoint.";
-      }
-    }
-    description
-      "Type of the resource disjointness for a TE tunnel path.";
-    reference
-      "RFC4872: RSVP-TE Extensions in Support of End-to-End
-       Generalized Multi-Protocol Label Switching (GMPLS)
-       Recovery";
-  }
-
-  // te-path-disjointness
-
-  typedef te-node-id {
-    type inet:ip-address;
-    description
-      "An identifier for a node in a topology.
-       The identifier is represented as 32-bit unsigned integer in
-       the dotted-quad notation.
-       This attribute is mapped to Router ID in
-       RFC3630, RFC5329, RFC5305, and RFC6119.";
-  }
-
-  typedef te-tp-id {
-    type union {
-      type uint32;
-      // Unnumbered
-      type inet:ip-address;
-      // IPv4 or IPv6 address
-    }
-    description
-      "An identifier for a TE link endpoint on a node.
-       This attribute is mapped to local or remote link identifier in
-       RFC3630 and RFC5305.";
-  }
-
-  typedef accumulated-metric-type {
-    type union {
-      type uint64;
-      type decimal64 {
-        fraction-digits 2;
-      }
-    }
-    description
-      "type useable for accumulative-value";
-  }
-
-  grouping effective-freq-slot {
-    /* content copied from ietf-flexi-grid-media-channel, because only M and N are needed
-       from the initial grouping.
-     */
-    description
-      "The effective frequency slot is an attribute
-       of a media channel and, being a frequency slot, it is
-       described by its nominal central frequency and slot
-       width";
-    reference
-      "rfc7698";
-    leaf N {
-      type int32;
-      description
-        "Is used to determine the Nominal Central
-         Frequency. The set of nominal central frequencies
-         can be built using the following expression:
-           f = 193.1 THz + n x 0.00625 THz,
-         where 193.1 THz is ITU-T ''anchor frequency'' for
-         transmission over the C band, n is a positive or
-         negative integer including 0.";
-      reference
-        "rfc7698";
-    }
-    leaf M {
-      type int32;
-      description
-        "Is used to determine the slot width. A slot width
-         is constrained to be M x SWG (that is, M x 12.5 GHz),
-         where M is an integer greater than or equal to 1.";
-      reference
-        "rfc7698";
-    }
-  }
-
-  grouping gnpy-specific-parameters {
-    description
-      "This grouping defines the gnpy specific parameters for requests.";
-    leaf technology {
-      type string;
-      default "flexi-grid";
-      description
-        "Data plane technology type.";
-    }
-    leaf trx_type {
-      type string;
-      mandatory true;
-      description
-        "name of the transponder type (to be read from equipment library";
-    }
-    leaf trx_mode {
-      type string;
-      description
-        "name of the transponder mode (to be read from equipment library";
-    }
-    list effective-freq-slot {
-      key "N";
-      uses effective-freq-slot;
-    }
-    leaf spacing {
-      type decimal64 {
-        fraction-digits 1;
-      }
-      units "Hz";
-      mandatory true;
-      description
-        "It is the spacing between channels assuming full load with
-         same channels as the requested one. multiple of 12.5 GHz";
-    }
-    leaf max-nb-of-channel {
-      type uint32;
-      description
-        "Nb of channel to take into account for the full load case.\n";
-    }
-    leaf output-power {
-      type decimal64 {
-        fraction-digits 5;
-      }
-      units "W";
-      description
-        "optical power setting to be used for the propagation";
-    }
-    leaf path_bandwidth {
-      type decimal64 {
-        fraction-digits 5;
-      }
-      units "bit/s";
-      mandatory true;
-      description
-        "Capacity required";
-    }
-  }
-
-  grouping transponder {
-    leaf transponder-type {
-      type string;
-      description
-        "transponder type.";
-    }
-    leaf transponder-mode {
-      type string;
-      description
-        "transponder mode.";
-    }
-  }
-
-  grouping hop-attribute {
-    description
-      "This grouping defines the hop attribute parameters for request or response";
-    choice hop-type {
-      case tsp {
-        container transponder {
-          uses transponder;
-        }
-      }
-      case regen {
-        container regenerator {
-          leaf regenerator-id {
-            type string;
-          }
-          uses transponder;
-        }
-      }
-      case pow {
-        container optical-power {
-          leaf optical-power {
-            type decimal64 {
-              fraction-digits 5;
-            }
-            units "W";
-            description
-              "hop output (input??) power";
-          }
-        }
-      }
-    }
-  }
-
-  grouping path-route-objects {
-    description
-      "List of EROs to be included or excluded when performing
-       the path computation.";
-    container explicit-route-objects {
-      description
-        "Container for the route object list";
-      list route-object-include-exclude {
-        key "index";
-        description
-          "List of explicit route objects to include or
-           exclude in path computation";
-        leaf explicit-route-usage {
-          type identityref {
-            base route-usage-type;
-          }
-          description
-            "Explicit-route usage.";
-        }
-        uses explicit-route-hop;
-      }
-    }
-  }
-
-  grouping generic-path-disjointness {
-    description
-      "Path disjointness grouping";
-    leaf disjointness {
-      type te-path-disjointness;
-      description
-        "The type of resource disjointness.
-         Under primary path, disjointness level applies to
-         all secondary LSPs. Under secondary, disjointness
-         level overrides the one under primary";
-    }
-  }
-
-  grouping common-path-constraints-attributes {
-    description
-      "Common path constraints configuration grouping";
-    uses common-constraints_config;
-  }
-
-  grouping generic-path-constraints {
-    description
-      "Global named path constraints configuration
-       grouping";
-    container path-constraints {
-      description
-        "TE named path constraints container";
-      uses common-path-constraints-attributes;
-    }
-  }
-
-  grouping explicit-route-hop {
-    description
-      "The explicit route subobject grouping";
-    leaf index {
-      type uint32;
-      description
-        "ERO subobject index";
-    }
-    choice type {
-      description
-        "The explicit route subobject type";
-      case num-unnum-hop {
-        container num-unnum-hop {
-          description
-            "Numbered and Unnumbered link/node explicit route
-             subobject";
-          leaf node-id {
-            //type te-node-id;
-            type string;
-            description
-              "The identifier of a node in the TE topology.";
-          }
-          leaf link-tp-id {
-            //type te-tp-id;
-            type string;
-            description
-              "TE link termination point identifier. The combination
-               of TE link ID and the TE node ID is used to identify an
-               unnumbered TE link.";
-          }
-          leaf hop-type {
-            type te-hop-type;
-            description
-              "strict or loose hop";
-          }
-        }
-      }
-      case label {
-        description
-          "The Label ERO subobject";
-        container label-hop {
-          description
-            "Label hop type";
-          uses effective-freq-slot;
-        }
-      }
-      case hop-attribute {
-        uses gnpypc:hop-attribute;
-      }
-    }
-  }
-
-  grouping common-constraints_config {
-    description
-      "Common constraints grouping that can be set on
-       a constraint set or directly on the tunnel";
-    container te-bandwidth {
-      description
-        "A requested bandwidth to use for path computation";
-      uses gnpy-specific-parameters;
-    }
-  }
-
-  grouping end-points {
-    description
-      "Common grouping to define the TE tunnel end-points";
-    leaf source {
-      type inet:ip-address;
-      description
-        "TE tunnel source address.";
-    }
-    leaf destination {
-      type inet:ip-address;
-      description
-        "P2P tunnel destination address";
-    }
-    leaf src-tp-id {
-      type binary;
-      description
-        "TE tunnel source termination point identifier.";
-    }
-    leaf dst-tp-id {
-      type binary;
-      description
-        "TE tunnel destination termination point
-         identifier.";
-    }
-  }
-
-  grouping synchronization-info {
-    description
-      "Information for sync";
-    list synchronization {
-      key "synchronization-id";
-      description
-        "sync list";
-      leaf synchronization-id {
-        type uint32;
-        description
-          "index";
-      }
-      container svec {
-        description
-          "Synchronization VECtor";
-        leaf relaxable {
-          type boolean;
-          default "true";
-          description
-            "If this leaf is true, path computation process is free
-             to ignore svec content.
-             otherwise it must take into account this svec.";
-        }
-        uses generic-path-disjointness;
-        leaf-list request-id-number {
-          type uint32;
-          description
-            "This list reports the set of M path computation requests that must be synchronized.";
-        }
-      }
-    }
-  }
-
-  grouping generic-path-properties {
-    description
-      "TE generic path properties grouping";
-    container path-properties {
-      config false;
-      description
-        "The TE path properties";
-      list path-metric {
-        key "metric-type";
-        description
-          "TE path metric type";
-        leaf metric-type {
-          type identityref {
-            base path-metric-type;
-          }
-          description
-            "TE path metric type";
-        }
-        leaf accumulative-value {
-          type decimal64 {
-            fraction-digits 2;
-          }
-          description
-            "TE path metric accumulative value";
-        }
-      }
-      //      container path-route-objects {
-      //        description
-      //          "Container for the list of route objects either returned by
-      //           the computation engine or actually used by an LSP";
-      //        list path-route-object {
-      //          key index;
-      //          description
-      //            "List of route objects either returned by the computation
-      //             engine or actually used by an LSP";
-      //          uses explicit-route-hop;
-      //        }
-      //      }
-      list path-route-objects {
-        description
-          "Container for the list of route objects either returned by
-           the computation engine or actually used by an LSP";
-        container path-route-object {
-          description
-            "List of route objects either returned by the computation
-             engine or actually used by an LSP";
-          uses explicit-route-hop;
-        }
-      }
-    }
-  }
-
-  grouping path-info {
-    description
-      "Path computation output information";
-    uses generic-path-properties;
-  }
-
-  // adding some blocking reasons and info on path in case of blocking
-
-  grouping no-path-info {
-    description
-      "no-path-info";
-    container no-path {
-      presence "Response without path information, due to failure
-                performing the path computation";
-      description
-        "if path computation cannot identify a path,
-         rpc returns no path.";
-      leaf no-path {
-        type string;
-        mandatory true;
-        description
-          "returned blocking reasons:
-            NO_PATH
-            NO_COMPUTED_SNR
-            NO_FEASIBLE_BAUDRATE_WITH_SPACING
-            NO_PATH_WITH_CONSTRAINT
-            NO_FEASIBLE_MODE
-            MODE_NOT_FEASIBLE
-            NO_SPECTRUM
-          ";
-      }
-      uses generic-path-properties;
-    }
-  }
-
-  /* TODO : correct the following with good trees:
-   *  te:tunnels-rpc/te:input/te:tunnel-info
-   *  te:tunnels-rpc/te:output/te:result
-   */
-
-  grouping service {
-    list path-request {
-      key "request-id";
-      description
-        "request-list";
-      leaf request-id {
-        type uint32;
-        mandatory true;
-        description
-          "Each path computation request is uniquely identified by the request-id-number.";
-      }
-      uses end-points;
-      uses path-route-objects;
-      uses generic-path-constraints;
-    }
-    uses synchronization-info;
-  }
-
-  grouping result {
-    list response {
-      key "response-id";
-      config false;
-      description
-        "response";
-      leaf response-id {
-        type uint32;
-        description
-          "The list key that has to reuse request-id-number.";
-      }
-      choice response-type {
-        config false;
-        description
-          "response-type";
-        case no-path-case {
-          uses no-path-info;
-        }
-        case path-case {
-          description
-            "Path computation service.";
-          uses path-info;
-        }
-      }
-    }
-  }
-
-  container result {
-    description
-      "Describe the service file to connect to gnpy";
-    uses result;
-  }
-}
diff --git a/api/src/main/yang/gnpy-path-computation-simplified@2020-02-02.yang b/api/src/main/yang/gnpy-path-computation-simplified@2020-02-02.yang
new file mode 100644 (file)
index 0000000..630887e
--- /dev/null
@@ -0,0 +1,600 @@
+module gnpy-path-computation-simplified {
+  yang-version 1;
+  namespace "gnpy:path";
+
+  prefix "gnpypc";
+
+  import ietf-yang-types {
+    prefix "yang-types";
+  }
+
+  import ietf-inet-types {
+    prefix inet;
+  }
+    organization
+    "Telecom Infra Project OOPT PSE Working Group";
+
+  contact
+    "WG Web:   <https://github.com/Telecominfraproject/oopt-gnpy>
+     contact:  <mailto:ahmed.triki@orange.com>
+     contact:  <mailto:esther.lerouzic@orange.com>
+   ";
+
+  description "YANG model for gnpy path computation simplified for transportPCE";
+
+  revision "2020-02-02" {
+    description "second draft with detailed blocking reasons";
+    reference "YANG model for path computation with gnpy inputs";
+  }
+
+  grouping effective-freq-slot{
+         /* content copied from ietf-flexi-grid-media-channel, because only M and N are needed
+            from the initial grouping.
+         */
+         description "The effective frequency slot is an attribute
+            of a media channel and, being a frequency slot, it is
+            described by its nominal central frequency and slot
+            width";
+         reference "rfc7698";
+            leaf N {
+               type int32;
+               description
+                  "Is used to determine the Nominal Central
+                  Frequency. The set of nominal central frequencies
+                  can be built using the following expression:
+                     f = 193.1 THz + n x 0.00625 THz,
+                  where 193.1 THz is ITU-T ''anchor frequency'' for
+                  transmission over the C band, n is a positive or
+                  negative integer including 0.";
+               reference "rfc7698";
+            }
+            leaf M {
+               type int32;
+               description
+                  "Is used to determine the slot width. A slot width
+                  is constrained to be M x SWG (that is, M x 12.5 GHz),
+                  where M is an integer greater than or equal to 1.";
+               reference "rfc7698";
+    }
+  }
+
+  grouping gnpy-specific-parameters{
+    description
+      "This grouping defines the gnpy specific parameters for requests.";
+        leaf technology {
+            type string;
+            default "flexi-grid";
+            description
+          "Data plane technology type.";
+          }
+      leaf trx_type {
+        type string ;
+        mandatory true;
+        description "name of the transponder type (to be read from equipment library";
+
+      }
+      leaf trx_mode {
+        type string ;
+        description "name of the transponder mode (to be read from equipment library";
+
+      }
+      list effective-freq-slot {
+        key "N";
+        uses effective-freq-slot ;
+      }
+      leaf spacing {
+        mandatory true;
+        type decimal64 {
+          fraction-digits 1;
+        }
+        units Hz;
+        description
+          "It is the spacing between channels assuming full load with
+          same channels as the requested one. multiple of 12.5 GHz";
+
+      }
+      leaf max-nb-of-channel{
+        type uint32 ;
+        description "Nb of channel to take into account for the full load case.
+        ";
+
+      }
+      leaf output-power{
+        type decimal64 {
+          fraction-digits 5;
+        }
+        units W;
+        description "optical power setting to be used for the propagation";
+
+      }
+      leaf path_bandwidth{
+        type decimal64 {
+          fraction-digits 5;
+        }
+        mandatory true;
+        units bit/s;
+        description "Capacity required";
+      }
+  }
+
+  identity SNR-bandwidth {
+    base path-metric-type;
+    description
+      "A metric that records SNR in signal bandwidth";
+  }
+
+  identity OSNR-bandwidth {
+    base path-metric-type;
+    description
+      "A metric that records OSNR in signal bandwidth";
+  }
+
+  identity SNR-0.1nm {
+    base path-metric-type;
+    description
+      "A metric that records SNR in 0.1nm";
+  }
+
+  identity OSNR-0.1nm {
+    base path-metric-type;
+    description
+      "A metric that records OSNR in 0.1nm";
+  }
+
+  identity reference_power {
+    base path-metric-type;
+    description
+      "to be revised";
+  }
+
+  identity path_bandwidth {
+     base path-metric-type;
+     description
+       "to be revised";
+  }
+
+  grouping transponder{
+        leaf transponder-type {
+        type string ;
+        description
+          "transponder type.";
+          }
+      leaf transponder-mode {
+        type string ;
+        description
+          "transponder mode.";
+          }
+  }
+
+  grouping hop-attribute{
+    description
+      "This grouping defines the hop attribute parameters for request or response";
+    choice hop-type{
+      case tsp {
+        container transponder{
+          uses transponder ;
+        }
+      }
+      case regen {
+        container regenerator{
+          leaf regenerator-id{
+            type string ;
+          }
+          uses transponder ;
+        }
+      }
+      case pow {
+        container optical-power{
+          leaf optical-power{
+            type decimal64 {
+              fraction-digits 5;
+            }
+            units W;
+            description "hop output (input??) power";
+          }
+        }
+      }
+    }
+
+  }
+
+  identity path-metric-type {
+    description
+      "Base identity for path metric type";
+  }
+
+  identity route-usage-type {
+    description
+      "Base identity for route usage";
+  }
+
+  identity route-include-ero {
+    base route-usage-type;
+    description
+      "Include ERO from route";
+  }
+
+  identity route-exclude-ero {
+    base route-usage-type;
+    description
+      "Exclude ERO from route";
+  }
+
+  identity route-exclude-srlg {
+    base route-usage-type;
+    description
+      "Exclude SRLG from route";
+  }
+
+  typedef te-hop-type {
+    type enumeration {
+      enum LOOSE {
+        description
+          "loose hop in an explicit path";
+      }
+      enum STRICT {
+        description
+          "strict hop in an explicit path";
+      }
+    }
+    description
+     "enumerated type for specifying loose or strict
+      paths";
+    reference "RFC3209: section-4.3.2";
+  }
+
+  typedef te-path-disjointness {
+    type bits {
+      bit node {
+        position 0;
+        description "Node disjoint.";
+      }
+      bit link {
+        position 1;
+        description "Link disjoint.";
+      }
+      bit srlg {
+        position 2;
+        description "SRLG (Shared Risk Link Group) disjoint.";
+      }
+    }
+    description
+      "Type of the resource disjointness for a TE tunnel path.";
+    reference
+      "RFC4872: RSVP-TE Extensions in Support of End-to-End
+       Generalized Multi-Protocol Label Switching (GMPLS)
+       Recovery";
+  } // te-path-disjointness
+
+  typedef te-node-id {
+    type inet:ip-address;
+    description
+      "An identifier for a node in a topology.
+       The identifier is represented as 32-bit unsigned integer in
+       the dotted-quad notation.
+       This attribute is mapped to Router ID in
+       RFC3630, RFC5329, RFC5305, and RFC6119.";
+  }
+
+  typedef te-tp-id {
+    type union {
+      type uint32;          // Unnumbered
+      type inet:ip-address; // IPv4 or IPv6 address
+    }
+    description
+      "An identifier for a TE link endpoint on a node.
+       This attribute is mapped to local or remote link identifier in
+       RFC3630 and RFC5305.";
+  }
+
+    typedef accumulated-metric-type {
+      type union {
+        type uint64;
+        type decimal64 {
+          fraction-digits 2;
+        }
+      }
+      description
+          "type useable for accumulative-value";
+  }
+
+  grouping path-route-objects {
+    description
+      "List of EROs to be included or excluded when performing
+       the path computation.";
+    container explicit-route-objects {
+      description
+        "Container for the route object list";
+      list route-object-include-exclude {
+        key index;
+        description
+          "List of explicit route objects to include or
+           exclude in path computation";
+        leaf explicit-route-usage {
+          type identityref {
+            base route-usage-type;
+          }
+          description "Explicit-route usage.";
+        }
+        uses explicit-route-hop ;
+      }
+    }
+  }
+
+  grouping generic-path-disjointness {
+    description "Path disjointness grouping";
+    leaf disjointness {
+      type te-path-disjointness;
+      description
+        "The type of resource disjointness.
+         Under primary path, disjointness level applies to
+         all secondary LSPs. Under secondary, disjointness
+         level overrides the one under primary";
+    }
+  }
+
+  grouping common-path-constraints-attributes {
+    description
+      "Common path constraints configuration grouping";
+    uses common-constraints_config;
+  }
+
+  grouping generic-path-constraints {
+    description
+      "Global named path constraints configuration
+      grouping";
+    container path-constraints {
+      description "TE named path constraints container";
+      uses common-path-constraints-attributes;
+    }
+  }
+
+
+  grouping explicit-route-hop {
+    description
+      "The explicit route subobject grouping";
+    leaf index {
+      type uint32;
+      description "ERO subobject index";
+    }
+    choice type {
+      description
+        "The explicit route subobject type";
+      case num-unnum-hop {
+        container num-unnum-hop {
+          leaf node-id {
+            //type te-node-id;
+            type string;
+            description
+              "The identifier of a node in the TE topology.";
+          }
+          leaf link-tp-id {
+            //type te-tp-id;
+            type string;
+            description
+              "TE link termination point identifier. The combination
+              of TE link ID and the TE node ID is used to identify an
+              unnumbered TE link.";
+          }
+          leaf hop-type {
+            type te-hop-type;
+            description "strict or loose hop";
+          }
+          description
+            "Numbered and Unnumbered link/node explicit route
+            subobject";
+        }
+      }
+      case label {
+        container label-hop {
+          description "Label hop type";
+          uses effective-freq-slot;
+        }
+        description
+          "The Label ERO subobject";
+      }
+      case hop-attribute{
+        uses gnpypc:hop-attribute ;
+      }
+    }
+  }
+
+  grouping common-constraints_config {
+    description
+      "Common constraints grouping that can be set on
+       a constraint set or directly on the tunnel";
+
+    container te-bandwidth {
+      uses gnpy-specific-parameters ;
+      description
+        "A requested bandwidth to use for path computation";
+    }
+  }
+
+  grouping end-points {
+    description
+      "Common grouping to define the TE tunnel end-points";
+
+    leaf source {
+      type inet:ip-address;
+      description "TE tunnel source address.";
+    }
+    leaf destination {
+      type inet:ip-address;
+      description "P2P tunnel destination address";
+    }
+    leaf src-tp-id {
+      type binary;
+      description "TE tunnel source termination point identifier.";
+    }
+    leaf dst-tp-id {
+      type binary;
+
+      description "TE tunnel destination termination point
+identifier.";
+    }
+  }
+
+  grouping synchronization-info {
+    description "Information for sync";
+    list synchronization {
+      key "synchronization-id";
+      description "sync list";
+      leaf synchronization-id {
+        type uint32;
+        description "index";
+      }
+      container svec {
+        description
+         "Synchronization VECtor";
+        leaf relaxable {
+          type boolean;
+          default true;
+          description
+           "If this leaf is true, path computation process is free
+to ignore svec content.
+            otherwise it must take into account this svec.";
+        }
+        uses generic-path-disjointness;
+        leaf-list request-id-number {
+          type uint32;
+          description "This list reports the set of M path computation requests that must be synchronized.";
+        }
+      }
+    }
+  }
+
+  grouping generic-path-properties {
+    description "TE generic path properties grouping";
+    container path-properties {
+      config false;
+      description "The TE path properties";
+      list path-metric {
+        key metric-type;
+        description "TE path metric type";
+        leaf metric-type {
+          type identityref {
+            base path-metric-type;
+          }
+          description "TE path metric type";
+        }
+        leaf accumulative-value {
+          type decimal64 {
+              fraction-digits 2;
+          }
+          description "TE path metric accumulative value";
+        }
+      }
+//      container path-route-objects {
+//        description
+//          "Container for the list of route objects either returned by
+//           the computation engine or actually used by an LSP";
+//        list path-route-object {
+//          key index;
+//          description
+//            "List of route objects either returned by the computation
+//             engine or actually used by an LSP";
+//          uses explicit-route-hop;
+//        }
+//      }
+      list path-route-objects {
+          description
+            "Container for the list of route objects either returned by
+             the computation engine or actually used by an LSP";
+          container path-route-object {
+            description
+              "List of route objects either returned by the computation
+               engine or actually used by an LSP";
+            uses explicit-route-hop;
+          }
+        }
+    }
+  }
+
+  grouping path-info {
+    uses generic-path-properties;
+    description "Path computation output information";
+  }
+
+// adding some blocking reasons and info on path in case of blocking
+
+  grouping no-path-info {
+    description "no-path-info";
+    container no-path {
+      presence "Response without path information, due to failure
+        performing the path computation";
+      leaf no-path {
+        type string;
+        mandatory true ;
+        description
+          "returned blocking reasons:
+            NO_PATH
+            NO_COMPUTED_SNR
+            NO_FEASIBLE_BAUDRATE_WITH_SPACING
+            NO_PATH_WITH_CONSTRAINT
+            NO_FEASIBLE_MODE
+            MODE_NOT_FEASIBLE
+            NO_SPECTRUM
+          ";
+        }
+      uses generic-path-properties ;
+      description "if path computation cannot identify a path,
+        rpc returns no path.";
+    }
+  }
+
+  /* TODO : correct the following with good trees:
+  *  te:tunnels-rpc/te:input/te:tunnel-info
+  *  te:tunnels-rpc/te:output/te:result
+  */
+   grouping service {
+     list path-request {
+       key "request-id";
+       description "request-list";
+       leaf request-id {
+         type uint32;
+         mandatory true;
+         description "Each path computation request is uniquely identified by the request-id-number.";
+       }
+       leaf bidirectional {
+         type boolean;
+         mandatory true;
+         description "Specify the bidirectionality of the path";
+       }
+
+       uses end-points;
+       uses path-route-objects;
+       uses generic-path-constraints;
+     }
+     uses synchronization-info;
+   }
+
+   grouping result {
+     list response {
+       key response-id;
+       config false;
+       description "response";
+       leaf response-id {
+         type uint32;
+         description
+         "The list key that has to reuse request-id-number.";
+       }
+       choice response-type {
+         config false;
+         description "response-type";
+         case no-path-case {
+           uses no-path-info;
+         }
+         case path-case {
+           uses path-info;
+           description "Path computation service.";
+         }
+       }
+     }
+   }
+   container result {
+     uses result;
+     description
+     "Describe the service file to connect to gnpy";
+   }
+}
index d735582ea744f48247532db352878621639242c8..76fb7144f7808cd2a90f5c9e010fa0fe4641fccf 100644 (file)
@@ -101,7 +101,7 @@ public class PceSendingPceRPCs {
         LOG.info("PceGraph ...");
         PceGraph graph = new PceGraph(nwAnalizer.getaendPceNode(),
                 nwAnalizer.getzendPceNode(), nwAnalizer.getAllPceNodes(),
-                pceHardConstraints, pceSoftConstraints, rc, serviceType);
+                hardConstraints, softConstraints, rc, serviceType);
         graph.calcPath();
         rc = graph.getReturnStructure();
         if (!rc.getStatus()) {
index 3c498da3d547a0e9351d2ac3f1ea1a78b688158b..df797ed837a7574e778194c623a0afc531001a92 100644 (file)
@@ -33,13 +33,13 @@ import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecR
 import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
 import org.opendaylight.mdsal.binding.generator.util.BindingRuntimeContext;
 import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.Result;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.explicit.route.hop.type.NumUnnumHop;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.generic.path.properties.path.properties.PathMetric;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.generic.path.properties.path.properties.PathRouteObjects;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.result.Response;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.result.response.response.type.NoPathCase;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.result.response.response.type.PathCase;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.Result;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.explicit.route.hop.type.NumUnnumHop;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.generic.path.properties.path.properties.PathMetric;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.generic.path.properties.path.properties.PathRouteObjects;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.Response;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.response.response.type.NoPathCase;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.response.response.type.PathCase;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.General;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.GeneralBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.Include;
@@ -102,7 +102,7 @@ public class GnpyResult {
             new BindingNormalizedNodeCodecRegistry(bindingRuntimeContext);
 
         // Create the data object
-        QName pathQname = QName.create("gnpy:path", "2019-05-02", "result");
+        QName pathQname = QName.create("gnpy:path", "2020-02-02", "result");
         LOG.debug("the Qname is {} / namesapce {} ; module {}; ", pathQname.toString(), pathQname.getNamespace(),
             pathQname.getModule());
         YangInstanceIdentifier yangId = YangInstanceIdentifier.of(pathQname);
@@ -188,7 +188,7 @@ public class GnpyResult {
         int counter = 0;
         for (PathRouteObjects pathRouteObjects : pathRouteObjectList) {
             if (pathRouteObjects.getPathRouteObject().getType() instanceof NumUnnumHop) {
-                NumUnnumHop numUnnumHop = (org.opendaylight.yang.gen.v1.gnpy.path.rev190502.explicit.route.hop.type
+                NumUnnumHop numUnnumHop = (org.opendaylight.yang.gen.v1.gnpy.path.rev200202.explicit.route.hop.type
                     .NumUnnumHop) pathRouteObjects.getPathRouteObject().getType();
                 String nodeIp = numUnnumHop.getNumUnnumHop().getNodeId();
                 try {
index d32ab4214d5178f7abb3722fcb5d728e80a0ba00..4c6beee8a3f49dee2eb1dad759a176e7774fcdf6 100644 (file)
@@ -19,30 +19,30 @@ import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.transportpce.pce.constraints.PceConstraints;
 import org.opendaylight.transportpce.pce.constraints.PceConstraints.ResourcePair;
 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.Elements;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.RouteIncludeEro;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.TeHopType;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.TeNodeId;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.TePathDisjointness;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.TeTpId;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.common.constraints_config.TeBandwidth;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.common.constraints_config.TeBandwidthBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.explicit.route.hop.Type;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.explicit.route.hop.type.NumUnnumHopBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.explicit.route.hop.type.num.unnum.hop.NumUnnumHop;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.generic.path.constraints.PathConstraints;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.generic.path.constraints.PathConstraintsBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.gnpy.specific.parameters.EffectiveFreqSlot;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.gnpy.specific.parameters.EffectiveFreqSlotBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.path.route.objects.ExplicitRouteObjects;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.path.route.objects.ExplicitRouteObjectsBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.path.route.objects.explicit.route.objects.RouteObjectIncludeExclude;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.path.route.objects.explicit.route.objects.RouteObjectIncludeExcludeBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.service.PathRequest;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.service.PathRequestBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.synchronization.info.Synchronization;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.synchronization.info.SynchronizationBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.synchronization.info.synchronization.Svec;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.synchronization.info.synchronization.SvecBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.RouteIncludeEro;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.TeHopType;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.TeNodeId;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.TePathDisjointness;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.TeTpId;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.common.constraints_config.TeBandwidth;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.common.constraints_config.TeBandwidthBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.explicit.route.hop.Type;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.explicit.route.hop.type.NumUnnumHopBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.explicit.route.hop.type.num.unnum.hop.NumUnnumHop;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.generic.path.constraints.PathConstraints;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.generic.path.constraints.PathConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.gnpy.specific.parameters.EffectiveFreqSlot;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.gnpy.specific.parameters.EffectiveFreqSlotBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.path.route.objects.ExplicitRouteObjects;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.path.route.objects.ExplicitRouteObjectsBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.path.route.objects.explicit.route.objects.RouteObjectIncludeExclude;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.path.route.objects.explicit.route.objects.RouteObjectIncludeExcludeBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.service.PathRequest;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.service.PathRequestBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.synchronization.info.Synchronization;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.synchronization.info.SynchronizationBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.synchronization.info.synchronization.Svec;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.synchronization.info.synchronization.SvecBuilder;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInput;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
@@ -142,7 +142,8 @@ public class GnpyServiceImpl {
         List<PathRequest> pathRequestList = new ArrayList<>();
         PathRequest pathRequestEl = new PathRequestBuilder().setRequestId(requestId)
             .setSource(this.mapNodeRefIp.get(sourceNode)).setDestination(this.mapNodeRefIp.get(destNode))
-            .setSrcTpId("srcTpId".getBytes()).setDstTpId("dstTpId".getBytes()).setPathConstraints(pathConstraints)
+            .setSrcTpId("srcTpId".getBytes()).setDstTpId("dstTpId".getBytes())
+            .setBidirectional(false).setPathConstraints(pathConstraints).setPathConstraints(pathConstraints)
             .setExplicitRouteObjects(explicitRouteObjects).build();
         pathRequestList.add(pathRequestEl);
         LOG.debug("In GnpyServiceImpl: path request AToZ is extracted");
@@ -167,14 +168,14 @@ public class GnpyServiceImpl {
         ExplicitRouteObjects explicitRouteObjects = new ExplicitRouteObjectsBuilder()
             .setRouteObjectIncludeExclude(routeObjectIncludeExcludes).build();
         //Create Path Constraint
-        //to be deleted
-        //Long wavelengthNumber = (ztoa.getZToAWavelengthNumber() != null) ? ztoa.getZToAWavelengthNumber() : null;
         PathConstraints pathConstraints = createPathConstraints(ztoa.getRate(),ztoa.getZToAWavelengthNumber());
+
         // Create the path request
         List<PathRequest> pathRequestList = new ArrayList<>();
         PathRequest pathRequestEl = new PathRequestBuilder().setRequestId(requestId)
             .setSource(this.mapNodeRefIp.get(sourceNode)).setDestination(this.mapNodeRefIp.get(destNode))
-            .setSrcTpId("srcTpId".getBytes()).setDstTpId("dstTpId".getBytes()).setPathConstraints(pathConstraints)
+            .setSrcTpId("srcTpId".getBytes()).setDstTpId("dstTpId".getBytes())
+            .setBidirectional(false).setPathConstraints(pathConstraints)
             .setExplicitRouteObjects(explicitRouteObjects).build();
         pathRequestList.add(pathRequestEl);
         LOG.debug("In GnpyServiceImpl: path request ZToA is extracted");
@@ -306,7 +307,7 @@ public class GnpyServiceImpl {
     private RouteObjectIncludeExclude addRouteObjectIncludeExclude(IpAddress ipAddress, long teTpValue) {
         TeNodeId teNodeId = new TeNodeId(ipAddress);
         TeTpId teTpId = new TeTpId(teTpValue);
-        NumUnnumHop numUnnumHop = new org.opendaylight.yang.gen.v1.gnpy.path.rev190502.explicit.route.hop.type.num
+        NumUnnumHop numUnnumHop = new org.opendaylight.yang.gen.v1.gnpy.path.rev200202.explicit.route.hop.type.num
             .unnum.hop.NumUnnumHopBuilder()
                 .setNodeId(teNodeId.getIpv4Address().getValue())
                 .setLinkTpId(teTpId.getUint32().toString())
index 5560ea7ddcecb8a5bfad708dd39f1121d519c25a..787fdb63bdf12b32af1c8d8e728c9d671caf267d 100644 (file)
@@ -169,7 +169,11 @@ public class GnpyTopoImpl {
         for (Node openRoadmTopoNode : openRoadmTopoNodeList) {
             // Retrieve the supporting node and the type of the node in openRoadm network
             List<SupportingNode> supportingNodeList = openRoadmTopoNode.getSupportingNode();
+
             for (SupportingNode supportingNode : supportingNodeList) {
+                if (!supportingNode.getNetworkRef().getValue().equals("openroadm-network")) {
+                    continue;
+                }
                 IpAddress ipAddress = null;
                 String nodeRef = supportingNode.getNodeRef().getValue();
                 // Retrieve the mapping between the openRoadm topology and openRoadm network
index 960e800f58cb1bc42357c17a674128fb8fe339fe..a1cec9a59fe8780c5d88f38d7f70c8fe75ae8454 100644 (file)
@@ -18,9 +18,9 @@ import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev190103.gnpy.api.ServiceFile
 import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev190103.gnpy.api.TopologyFileBuilder;
 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.Connections;
 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.Elements;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.generic.path.properties.path.properties.PathRouteObjects;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.service.PathRequest;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.synchronization.info.Synchronization;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.generic.path.properties.path.properties.PathRouteObjects;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.service.PathRequest;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.synchronization.info.Synchronization;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInput;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirectionBuilder;
@@ -46,7 +46,6 @@ public class GnpyUtilitiesImpl {
     private GnpyResult gnpyAtoZ;
     private GnpyResult gnpyZtoA;
     private Long requestId;
-    //private boolean status;
 
     public GnpyUtilitiesImpl(NetworkTransactionService networkTransaction, PathComputationRequestInput input)
         throws GnpyException {
index ce942e8cd1af31b6fa5c9433b7386aaf130cd16d..cae5ca1639fb8cf6530ca72e6ff2a0a20f37a73a 100644 (file)
@@ -47,7 +47,7 @@ public class PostAlgoPathValidator {
         }
 
         int tribSlotNb = 1;
-        //variable to deal wih 1GE (Nb=1) and 10GE (Nb=10) cases
+        //variable to deal with 1GE (Nb=1) and 10GE (Nb=10) cases
         switch (serviceType) {
 
             case "100GE":
@@ -63,9 +63,6 @@ public class PostAlgoPathValidator {
                 pceResult.setResultWavelength(waveL);
                 LOG.info("In PostAlgoPathValidator: chooseWavelength WL found {} {}", waveL, path.toString());
 
-                // TODO here other post algo validations can be added
-                // more data can be sent to PceGraph module via PceResult structure if required
-
                 // Check the OSNR
                 if (!checkOSNR(path)) {
                     pceResult.setRC(ResponseCodes.RESPONSE_FAILED);
@@ -87,7 +84,13 @@ public class PostAlgoPathValidator {
                     pceResult.setLocalCause(PceResult.LocalCause.HD_NODE_INCLUDE);
                     return pceResult;
                 }
+
+                // TODO here other post algo validations can be added
+                // more data can be sent to PceGraph module via PceResult structure if required
+
                 pceResult.setRC(ResponseCodes.RESPONSE_OK);
+                pceResult.setLocalCause(PceResult.LocalCause.NONE);
+
                 break;
 
             case "10GE":
@@ -120,10 +123,8 @@ public class PostAlgoPathValidator {
                     serviceType, path.toString());
                 break;
         }
-        return pceResult;
 
-        // TODO other post algo validations can be added anf if needed,
-        // more data can be sent to PceGraph module via PceResult structure
+        return pceResult;
     }
 
     // Choose the first available wavelength from the source to the destination
@@ -431,9 +432,6 @@ public class PostAlgoPathValidator {
         if ((osnrDb + SYS_MARGIN) < MIN_OSNR_W100G) {
             return false;
         }
-        double localOsnr = 0L;
-        LOG.info("In OSNR Stub: {}", localOsnr);
-        // TODO : change this to return OSNR value and validate or invalidate the path
         return true;
     }
 
index d3139777564c600c498e36715acf630f6591052f..ce8bb6b230322fb661bfa07927f75fa2aeaec342 100644 (file)
@@ -125,12 +125,7 @@ public class PceResult {
     }
 
     public void setLocalCause(LocalCause lc) {
-        // For now keep the very first fatal problem
-        // TODO. Later this value might become history of algo if all
-        // significant problems are added here as to List
-        if (localCause == LocalCause.NONE) {
-            this.localCause = lc;
-        }
+        this.localCause = lc;
     }
 
     public void setCalcMessage(String calcMessage) {
index ae7c81bf3fb887b681b554e4ff612483c40a5e17..8a1b33317c5e5f4c469e78fb2f66e2360bcabec1 100644 (file)
@@ -22,7 +22,8 @@ import org.opendaylight.transportpce.pce.PceComplianceCheck;
 import org.opendaylight.transportpce.pce.PceComplianceCheckResult;
 import org.opendaylight.transportpce.pce.PceSendingPceRPCs;
 import org.opendaylight.transportpce.pce.gnpy.GnpyResult;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.result.Response;
+
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.Response;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.CancelResourceReserveInput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.CancelResourceReserveOutput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.CancelResourceReserveOutputBuilder;
@@ -225,25 +226,25 @@ public class PathComputationServiceImpl implements PathComputationService {
         ResponseType respType = null;
         boolean feasible = true;
         if (responseGnpy != null) {
-            if (responseGnpy.getResponseType() instanceof org.opendaylight.yang.gen.v1.gnpy.path.rev190502.result
+            if (responseGnpy.getResponseType() instanceof org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result
                     .response.response.type.NoPathCase) {
                 LOG.info("GNPy : path is not feasible");
-                org.opendaylight.yang.gen.v1.gnpy.path.rev190502.result.response.response.type.NoPathCase
-                    noPathGnpy = (org.opendaylight.yang.gen.v1.gnpy.path.rev190502.result.response.response.type
+                org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.response.response.type.NoPathCase
+                    noPathGnpy = (org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.response.response.type
                     .NoPathCase) responseGnpy.getResponseType();
                 NoPathCase noPathCase = new NoPathCaseBuilder().setNoPath(noPathGnpy.getNoPath()).build();
                 respType = noPathCase;
                 feasible = false;
-            } else if (responseGnpy.getResponseType() instanceof org.opendaylight.yang.gen.v1.gnpy.path.rev190502.result
+            } else if (responseGnpy.getResponseType() instanceof org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result
                     .response.response.type.PathCase) {
                 LOG.info("GNPy : path is feasible");
-                org.opendaylight.yang.gen.v1.gnpy.path.rev190502.result.response.response.type.PathCase pathCase =
-                        (org.opendaylight.yang.gen.v1.gnpy.path.rev190502.result.response.response.type.PathCase)
+                org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.response.response.type.PathCase pathCase =
+                        (org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.response.response.type.PathCase)
                         responseGnpy.getResponseType();
-                List<org.opendaylight.yang.gen.v1.gnpy.path.rev190502.generic.path.properties.path.properties
+                List<org.opendaylight.yang.gen.v1.gnpy.path.rev200202.generic.path.properties.path.properties
                     .PathMetric> pathMetricList = pathCase.getPathProperties().getPathMetric();
                 List<PathMetric> gnpyPathMetricList = new ArrayList<>();
-                for (org.opendaylight.yang.gen.v1.gnpy.path.rev190502.generic.path.properties.path.properties.PathMetric
+                for (org.opendaylight.yang.gen.v1.gnpy.path.rev200202.generic.path.properties.path.properties.PathMetric
                         pathMetricGnpy : pathMetricList) {
                     PathMetric pathMetric = new PathMetricBuilder().setMetricType(pathMetricGnpy.getMetricType())
                             .setAccumulativeValue(pathMetricGnpy.getAccumulativeValue()).build();
index 14035e6e0080ae243bb473ea1a7f3c5ff567d98a..99fe2304e775c03e55dbfa230f4d6d8e434ced9b 100644 (file)
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-2-DEG1-to-OpenROADM-1-DEG1",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 28.4,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 70000,
+                                    "SRLG-length": 100000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 12,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 29,
+                            "engineered-spanloss": 30.2,
                             "clfi": "fiber12",
                             "auto-spanloss": true
                         },
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 70000,
+                                    "SRLG-length": 100000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-1-DEG1-to-OpenROADM-2-DEG1",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 28.4,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 70000,
+                                    "SRLG-length": 100000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 12,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 29,
+                            "engineered-spanloss": 30.2,
                             "clfi": "fiber21",
                             "auto-spanloss": true
                         },
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-3-DEG2-to-OpenROADM-2-DEG2",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 28.4,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 70000,
+                                    "SRLG-length": 140000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 12,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 29,
+                            "engineered-spanloss": 30.2,
                             "clfi": "fiber23",
                             "auto-spanloss": true
                         },
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-5-DEG3-to-OpenROADM-2-DEG3",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 7.1,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 149000,
+                                    "SRLG-length": 60000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 38,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 7.2,
+                            "engineered-spanloss": 7.5,
                             "clfi": "fiber25",
                             "auto-spanloss": true
                         },
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 70000,
+                                    "SRLG-length": 100000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-2-DEG2-to-OpenROADM-3-DEG2",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 28.4,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 70000,
+                                    "SRLG-length": 140000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 12,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 29,
+                            "engineered-spanloss": 30.2,
                             "clfi": "fiber32",
                             "auto-spanloss": true
                         },
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-5-DEG2-to-OpenROADM-3-DEG3",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 7.1,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 149000,
+                                    "SRLG-length": 60000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 38,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 7.2,
+                            "engineered-spanloss": 7.5,
                             "clfi": "fiber35",
                             "auto-spanloss": true
                         },
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-4-DEG2-to-OpenROADM-3-DEG4",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 28.4,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 70000,
+                                    "SRLG-length": 100000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 12,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 29,
+                            "engineered-spanloss": 30.2,
                             "clfi": "fiber34",
                             "auto-spanloss": true
                         },
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-4-DEG1-to-OpenROADM-5-DEG1",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 28.4,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 70000,
+                                    "SRLG-length": 100000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 12,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 29,
+                            "engineered-spanloss": 30.2,
                             "clfi": "fiber45",
                             "auto-spanloss": true
                         },
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-3-DEG4-to-OpenROADM-4-DEG2",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 28.4,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 70000,
+                                    "SRLG-length": 100000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 12,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 29,
+                            "engineered-spanloss": 30.2,
                             "clfi": "fiber43",
                             "auto-spanloss": true
                         },
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-4-DEG1-to-OpenROADM-5-DEG1",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 28.4,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 70000,
+                                    "SRLG-length": 100000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 12,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 29,
+                            "engineered-spanloss": 30.2,
                             "clfi": "fiber54",
                             "auto-spanloss": true
                         },
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-3-DEG3-to-OpenROADM-5-DEG2",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 7.1,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 149000,
+                                    "SRLG-length": 60000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 38,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 7.2,
+                            "engineered-spanloss": 7.5,
                             "clfi": "fiber53",
                             "auto-spanloss": true
                         },
                     "org-openroadm-network-topology:OMS-attributes": {
                         "opposite-link": "OpenROADM-2-DEG3-to-OpenROADM-5-DEG3",
                         "span": {
-                            "spanloss-base": 11.4,
+                            "spanloss-base": 7.1,
                             "link-concatenation": [
                                 {
                                     "SRLG-Id": 0,
-                                    "SRLG-length": 149000,
+                                    "SRLG-length": 60000,
                                     "pmd": 0.5,
                                     "fiber-type": "smf"
                                 }
                             ],
-                            "spanloss-current": 38,
-                            "engineered-spanloss": 12.2,
+                            "spanloss-current": 7.2,
+                            "engineered-spanloss": 7.5,
                             "clfi": "fiber52",
                             "auto-spanloss": true
                         },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-1"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node1"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-1"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node1"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-1"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node1"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-2"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node2"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-2"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node2"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-2"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node2"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-2"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node2"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-3"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node3"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-3"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node3"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-3"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node3"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-3"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node3"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-3"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node3"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-4"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node4"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-4"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node4"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-4"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node4"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-5"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node5"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-5"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node5"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-5"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node5"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "OpenROADM-5"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node5"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "XPONDER-1"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node1"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "XPONDER-2"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node2"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "XPONDER-3"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node3"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "XPONDER-4"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node4"
                         }
                     ]
                 },
                         {
                             "network-ref":"openroadm-network",
                             "node-ref": "XPONDER-5"
+                        },
+                        {
+                            "network-ref":"clli-network",
+                            "node-ref": "Node5"
                         }
                     ]
                 }
             ]
         }
     ]
-}
\ No newline at end of file
+}
index fd01a8932bf1009034bcf980132df107654495ec..469b8a6d2113ae072ca34d3e80c8db81c1ee391d 100644 (file)
@@ -93,8 +93,8 @@ class TransportGNPYtesting(unittest.TestCase):
         self.assertEqual(response.status_code, requests.codes.ok)
         time.sleep(3)
 
-    #Path computed by PCE is not feasible and Gnpy computes a new one feasible
-    def test_04_path_computation_NotFeasibleWithPCE_FeasibleWithGnpy(self):
+    #Path computed by PCE is feasible according to Gnpy
+    def test_04_path_computation_FeasibleWithPCE(self):
         url = ("{}/operations/transportpce-pce:path-computation-request"
               .format(self.restconf_baseurl))
         body = {"input": {
@@ -107,11 +107,13 @@ class TransportGNPYtesting(unittest.TestCase):
                 "service-a-end": {
                     "node-id": "XPONDER-1",
                     "service-rate": "100",
+                    "service-format": "Ethernet",
                     "clli": "Node1"
                 },
                 "service-z-end": {
                     "node-id": "XPONDER-5",
                     "service-rate": "100",
+                    "service-format": "Ethernet",
                     "clli": "Node5"
                 }
             }
@@ -124,14 +126,16 @@ class TransportGNPYtesting(unittest.TestCase):
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(res['output']['configuration-response-common']['response-code'], '200')
+        self.assertEqual(res['output']['configuration-response-common']['response-message'],
+                         'Path is calculated by PCE')
         self.assertEqual(res['output']['gnpy-response'][0]['path-dir'], 'A-to-Z')
         self.assertEqual(res['output']['gnpy-response'][0]['feasibility'],True)
         self.assertEqual(res['output']['gnpy-response'][1]['path-dir'], 'Z-to-A')
         self.assertEqual(res['output']['gnpy-response'][1]['feasibility'],True)
         time.sleep(5)
 
-    #Path computed by PCE is not feasible and Gnpy cannot find a new one because the constraints
-    def test_05_path_computation_NotFeasibleWithPCE_NotFeasibleWithGnpy_withConstraints(self):
+    #Path computed by PCE is not feasible by GNPy and GNPy cannot find another one (low SNR)
+    def test_05_path_computation_FoundByPCE_NotFeasibleByGnpy(self):
         url = ("{}/operations/transportpce-pce:path-computation-request"
               .format(self.restconf_baseurl))
         body = {"input": {
@@ -144,11 +148,13 @@ class TransportGNPYtesting(unittest.TestCase):
                 "service-a-end": {
                     "node-id": "XPONDER-1",
                     "service-rate": "100",
+                    "service-format": "Ethernet",
                     "clli": "Node1"
                 },
                 "service-z-end": {
                     "node-id": "XPONDER-5",
                     "service-rate": "100",
+                    "service-format": "Ethernet",
                     "clli": "Node5"
                 },
                 "hard-constraints": {
@@ -157,13 +163,19 @@ class TransportGNPYtesting(unittest.TestCase):
                             {
                                 "hop-number": "0",
                                 "hop-type": {
-                                    "node-id": "XPONDER-1"
+                                    "node-id": "OpenROADM-2"
+                                }
+                            },
+                            {
+                                "hop-number": "1",
+                                "hop-type": {
+                                    "node-id": "OpenROADM-3"
                                 }
                             },
                             {
                                 "hop-number": "2",
                                 "hop-type": {
-                                    "node-id": "OpenROADM-2"
+                                    "node-id": "OpenROADM-4"
                                 }
                             }
                         ]
@@ -179,14 +191,16 @@ class TransportGNPYtesting(unittest.TestCase):
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(res['output']['configuration-response-common']['response-code'], '500')
+        self.assertEqual(res['output']['configuration-response-common']['response-message'],
+                         'No path available by PCE and GNPy ')
         self.assertEqual(res['output']['gnpy-response'][0]['path-dir'], 'A-to-Z')
         self.assertEqual(res['output']['gnpy-response'][0]['feasibility'],False)
         self.assertEqual(res['output']['gnpy-response'][1]['path-dir'], 'Z-to-A')
         self.assertEqual(res['output']['gnpy-response'][1]['feasibility'],False)
         time.sleep(5)
 
-    #Path computed by PCE is feasible and Gnpy confirms the feasibility
-    def test_06_path_computation_FeasibleWithPCE_withConstraints(self):
+    # #PCE cannot find a path while GNPy finds a feasible one
+    def test_06_path_computation_NotFoundByPCE_FoundByGNPy(self):
         url = ("{}/operations/transportpce-pce:path-computation-request"
               .format(self.restconf_baseurl))
         body = {"input": {
@@ -199,11 +213,13 @@ class TransportGNPYtesting(unittest.TestCase):
                 "service-a-end": {
                     "node-id": "XPONDER-1",
                     "service-rate": "100",
+                    "service-format": "Ethernet",
                     "clli": "Node1"
                 },
                 "service-z-end": {
-                    "node-id": "XPONDER-5",
+                    "node-id": "XPONDER-4",
                     "service-rate": "100",
+                    "service-format": "Ethernet",
                     "clli": "Node5"
                 },
                 "hard-constraints": {
@@ -212,20 +228,14 @@ class TransportGNPYtesting(unittest.TestCase):
                             {
                                 "hop-number": "0",
                                 "hop-type": {
-                                    "node-id": "XPONDER-1"
+                                    "node-id": "OpenROADM-2"
                                 }
                             },
                             {
-                                "hop-number": "2",
+                                "hop-number": "1",
                                 "hop-type": {
                                     "node-id": "OpenROADM-3"
                                 }
-                            },
-                            {
-                                "hop-number": "4",
-                                "hop-type": {
-                                    "node-id": "OpenROADM-4"
-                                }
                             }
                         ]
                     }
@@ -240,14 +250,83 @@ class TransportGNPYtesting(unittest.TestCase):
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(res['output']['configuration-response-common']['response-code'], '200')
+        self.assertEqual(res['output']['configuration-response-common']['response-message'],
+                         'Path is calculated by GNPy')
         self.assertEqual(res['output']['gnpy-response'][0]['path-dir'], 'A-to-Z')
         self.assertEqual(res['output']['gnpy-response'][0]['feasibility'],True)
         self.assertEqual(res['output']['gnpy-response'][1]['path-dir'], 'Z-to-A')
         self.assertEqual(res['output']['gnpy-response'][1]['feasibility'],True)
         time.sleep(5)
 
+    #Not found path by PCE and GNPy cannot find another one
+    def test_07_path_computation_FoundByPCE_NotFeasibleByGnpy(self):
+        url = ("{}/operations/transportpce-pce:path-computation-request"
+              .format(self.restconf_baseurl))
+        body = {"input": {
+                "service-name": "service-4",
+                "resource-reserve": "true",
+                "pce-metric": "hop-count",
+                "service-handler-header": {
+                    "request-id": "request-4"
+                },
+                "service-a-end": {
+                    "node-id": "XPONDER-1",
+                    "service-rate": "100",
+                    "service-format": "Ethernet",
+                    "clli": "Node1"
+                },
+                "service-z-end": {
+                    "node-id": "XPONDER-4",
+                    "service-rate": "100",
+                    "service-format": "Ethernet",
+                    "clli": "Node5"
+                },
+                "hard-constraints": {
+                    "include_": {
+                        "ordered-hops": [
+                            {
+                                "hop-number": "0",
+                                "hop-type": {
+                                    "node-id": "OpenROADM-2"
+                                }
+                            },
+                            {
+                                "hop-number": "1",
+                                "hop-type": {
+                                    "node-id": "OpenROADM-3"
+                                }
+                            },
+                            {
+                                "hop-number": "2",
+                                "hop-type": {
+                                    "node-id": "OpenROADM-4"
+                                }
+                            },
+                            {
+                                "hop-number": "3",
+                                "hop-type": {
+                                    "node-id": "OpenROADM-3"
+                                }
+                            }
+                        ]
+                    }
+                }
+            }
+        }
+        headers = {'content-type': 'application/json',
+        "Accept": "application/json"}
+        response = requests.request(
+            "POST", url, data=json.dumps(body), headers=headers,
+            auth=('admin', 'admin'))
+        self.assertEqual(response.status_code, requests.codes.ok)
+        res = response.json()
+        self.assertEqual(res['output']['configuration-response-common']['response-code'], '500')
+        self.assertEqual(res['output']['configuration-response-common']['response-message'],
+                         'No path available by PCE and GNPy ')
+        time.sleep(5)
+
     #Disconnect the different topologies
-    def test_07_disconnect_openroadmTopology(self):
+    def test_08_disconnect_openroadmTopology(self):
         url = ("{}/config/ietf-network:networks/network/openroadm-topology"
                .format(self.restconf_baseurl))
         data = {}
@@ -258,7 +337,7 @@ class TransportGNPYtesting(unittest.TestCase):
         self.assertEqual(response.status_code, requests.codes.ok)
         time.sleep(3)
 
-    def test_08_disconnect_openroadmNetwork(self):
+    def test_09_disconnect_openroadmNetwork(self):
         url = ("{}/config/ietf-network:networks/network/openroadm-network"
                .format(self.restconf_baseurl))
         data = {}
@@ -269,7 +348,7 @@ class TransportGNPYtesting(unittest.TestCase):
         self.assertEqual(response.status_code, requests.codes.ok)
         time.sleep(3)
 
-    def test_09_disconnect_clliNetwork(self):
+    def test_10_disconnect_clliNetwork(self):
         url = ("{}/config/ietf-network:networks/network/clli-network"
                .format(self.restconf_baseurl))
         data = {}
diff --git a/tox.ini b/tox.ini
index ed0b4908ba91ae119530e4a604ac41ac053a016e..6ba7095a6896b6760a9e2f4ef09a03cabd86ea82 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -36,8 +36,8 @@ commands =
   {py3,rspn221}: nosetests --with-xunit transportpce_tests/2.2.1/test_renderer_service_path_nominal.py
   {py3,olm221}: nosetests --with-xunit transportpce_tests/2.2.1/test_olm.py
   {end2end221}: nosetests --with-xunit transportpce_tests/2.2.1/test_end2end.py
-  #{gnpy}: - sudo docker pull atriki/gnpyrest:v1.1
-  {gnpy}: - sudo docker run -d -p 8008:5000 --name gnpy_tpce_rest1 atriki/gnpyrest:v1.1
+  #{gnpy}: - sudo docker pull atriki/gnpyrest:v1.2
+  {gnpy}: - sudo docker run -d -p 8008:5000 --name gnpy_tpce_rest1 atriki/gnpyrest:v1.2
   {gnpy}: nosetests --with-xunit transportpce_tests/1.2.1/test_gnpy.py
   {gnpy}: - sudo docker container rm -f gnpy_tpce_rest1