import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.network.nodes.NodeInfo;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If100GE;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If100GEODU4;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If100GEOduflexgfp;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If10GE;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If10GEODU2;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If10GEODU2e;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If10GEOduflexgfp;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If1GE;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If1GEODU0;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If200GE;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If200GEOduflexcbr;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If25GEOduflexcbr;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If400GE;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If400GEOduflexcbr;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If400GEOdufleximp;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If40GE;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If40GEODU3;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If40GEOduflexgfp;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCH;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCHOTU1ODU1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCHOTU2EODU2E;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCHOTU2ODU2;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCHOTU3ODU3;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCHOTU4ODU4;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCHOTU4ODU4Regen;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCHOTU4ODU4Uniregen;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOTU1ODU1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOTU2ODU2;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOTU3ODU3;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOTU4ODU4;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOTUCnODUCn;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOTUCnODUCnRegen;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOTUCnODUCnUniregen;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOtsiOtsigroup;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOtsiOtucnOducn;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.SupportedIfCapability;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.service.component.annotations.Activate;
private static final ImmutableMap<String, SupportedIfCapability> CAP_TYPE_MAP =
ImmutableMap.<String, SupportedIfCapability>builder()
- .put("If400GE{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-400GE}", If400GE.VALUE)
- .put("IfOTU4ODU4{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OTU4-ODU4}",
- IfOTU4ODU4.VALUE)
- .put("IfOtsiOtsigroup{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-otsi-otsigroup}",
- IfOtsiOtsigroup.VALUE)
- .put("IfOCH{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OCH}", IfOCH.VALUE)
- .put("IfOCHOTU4ODU4{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OCH-OTU4-ODU4}",
- IfOCHOTU4ODU4.VALUE)
- .put("IfOCHOTU4ODU4{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OCH-OTU4-ODU4}",
- IfOCHOTU4ODU4.VALUE)
+ .put("If1GE{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-1GE}", If1GE.VALUE)
+ .put("If1GE{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-1GE}", If1GE.VALUE)
+ .put("If1GE{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-1GE}", If1GE.VALUE)
.put("If1GEODU0{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-1GE-ODU0}", If1GEODU0.VALUE)
+ .put("If1GEODU0{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-1GE-ODU0}", If1GEODU0.VALUE)
+ .put("If1GEODU0{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-1GE-ODU0}", If1GEODU0.VALUE)
.put("If10GE{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-10GE}", If10GE.VALUE)
+ .put("If10GE{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-10GE}", If10GE.VALUE)
+ .put("If10GE{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-10GE}", If10GE.VALUE)
.put("If10GEODU2{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-10GE-ODU2}",
If10GEODU2.VALUE)
+ .put("If10GEODU2{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-10GE-ODU2}",
+ If10GEODU2.VALUE)
+ .put("If10GEODU2{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-10GE-ODU2}",
+ If10GEODU2.VALUE)
.put("If10GEODU2e{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-10GE-ODU2e}",
If10GEODU2e.VALUE)
+ .put("If10GEODU2e{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-10GE-ODU2e}",
+ If10GEODU2e.VALUE)
+ .put("If10GEODU2e{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-10GE-ODU2e}",
+ If10GEODU2e.VALUE)
+ .put("If10GEoduflexgfp{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-10GE-oduflexgfp}",
+ If10GEOduflexgfp.VALUE)
+ .put("If10GEoduflexgfp{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-10GE-oduflexgfp}",
+ If10GEOduflexgfp.VALUE)
+ .put("If25GEoduflexcbr{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-25GE-oduflexcbr}",
+ If25GEOduflexcbr.VALUE)
+ .put("If25GEoduflexcbr{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-25GE-oduflexcbr}",
+ If25GEOduflexcbr.VALUE)
+ .put("If40GE{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-40GE}", If40GE.VALUE)
+ .put("If40GE{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-40GE}", If40GE.VALUE)
+ .put("If40GE{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-40GE}", If40GE.VALUE)
+ .put("If40GEODU3{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-40GE-ODU3}",
+ If40GEODU3.VALUE)
+ .put("If40GEODU3{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-40GE-ODU3}",
+ If40GEODU3.VALUE)
+ .put("If40GEODU3{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-40GE-ODU3}",
+ If40GEODU3.VALUE)
+ .put("If40GEoduflexgfp{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-40GE-oduflexgfp}",
+ If40GEOduflexgfp.VALUE)
+ .put("If40GEoduflexgfp{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-40GE-oduflexgfp}",
+ If40GEOduflexgfp.VALUE)
.put("If100GE{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-100GE}", If100GE.VALUE)
.put("If100GE{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-100GE}", If100GE.VALUE)
+ .put("If100GE{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-100GE}", If100GE.VALUE)
.put("If100GEODU4{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-100GE-ODU4}",
If100GEODU4.VALUE)
.put("If100GEODU4{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-100GE-ODU4}",
If100GEODU4.VALUE)
+ .put("If100GEODU4{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-100GE-ODU4}",
+ If100GEODU4.VALUE)
+ .put("If100GEoduflexgfp{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-100GE-oduflexgfp}",
+ If100GEOduflexgfp.VALUE)
+ .put("If100GEoduflexgfp{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-100GE-oduflexgfp}",
+ If100GEOduflexgfp.VALUE)
+ .put("If200GE{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-200GE}", If200GE.VALUE)
+ .put("If200GE{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-200GE}", If200GE.VALUE)
+ .put("If200GEoduflexcbr{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-200GE-oduflexcbr}",
+ If200GEOduflexcbr.VALUE)
+ .put("If200GEoduflexcbr{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-200GE-oduflexcbr}",
+ If200GEOduflexcbr.VALUE)
+ .put("If400GE{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-400GE}", If400GE.VALUE)
+ .put("If400GE{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-400GE}", If400GE.VALUE)
+ .put("If400GEodufleximp{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-400GE-odufleximp}",
+ If400GEOdufleximp.VALUE)
+ .put("If400GEodufleximp{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-400GE-odufleximp}",
+ If400GEOdufleximp.VALUE)
+ .put("If400GEoduflexcbr{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-400GE-oduflexcbr}",
+ If400GEOduflexcbr.VALUE)
+ .put("If400GEoduflexcbr{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-400GE-oduflexcbr}",
+ If400GEOduflexcbr.VALUE)
+ .put("IfOTU1ODU1{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OTU1-ODU1}",
+ IfOTU1ODU1.VALUE)
+ .put("IfOTU1ODU1{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OTU1-ODU1}",
+ IfOTU1ODU1.VALUE)
+ .put("IfOTU1ODU1{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-OTU1-ODU1}",
+ IfOTU1ODU1.VALUE)
+ .put("IfOTU2ODU2{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OTU2-ODU2}",
+ IfOTU2ODU2.VALUE)
+ .put("IfOTU2ODU2{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OTU2-ODU2}",
+ IfOTU2ODU2.VALUE)
+ .put("IfOTU2ODU2{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-OTU2-ODU2}",
+ IfOTU2ODU2.VALUE)
+ .put("IfOTU3ODU3{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OTU3-ODU3}",
+ IfOTU3ODU3.VALUE)
+ .put("IfOTU3ODU3{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OTU3-ODU3}",
+ IfOTU3ODU3.VALUE)
+ .put("IfOTU3ODU3{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-OTU3-ODU3}",
+ IfOTU3ODU3.VALUE)
+ .put("IfOTU4ODU4{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OTU4-ODU4}",
+ IfOTU4ODU4.VALUE)
+ .put("IfOTU4ODU4{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-OTU4-ODU4}",
+ IfOTU4ODU4.VALUE)
+ .put("IfOtsiOtsigroup{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-otsi-otsigroup}",
+ IfOtsiOtsigroup.VALUE)
+ .put("IfOtsiOtsigroup{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-otsi-otsigroup}",
+ IfOtsiOtsigroup.VALUE)
+ .put("IfOCH{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OCH}", IfOCH.VALUE)
+ .put("IfOCH{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OCH}", IfOCH.VALUE)
+ .put("IfOCH{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-OCH}", IfOCH.VALUE)
+ .put("IfOchOTU1ODU1{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OCH-OTU1-ODU1}",
+ IfOCHOTU1ODU1.VALUE)
+ .put("IfOchOTU1ODU1{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OCH-OTU1-ODU1}",
+ IfOCHOTU1ODU1.VALUE)
+ .put("IfOchOTU1ODU1{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-OCH-OTU1-ODU1}",
+ IfOCHOTU1ODU1.VALUE)
+ .put("IfOchOTU2ODU2{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OCH-OTU2-ODU2}",
+ IfOCHOTU2ODU2.VALUE)
+ .put("IfOchOTU2ODU2{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OCH-OTU2-ODU2}",
+ IfOCHOTU2ODU2.VALUE)
+ .put("IfOchOTU2ODU2{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-OCH-OTU2-ODU2}",
+ IfOCHOTU2ODU2.VALUE)
+ .put("IfOchOTU2EODU2E{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OCH-OTU2E-ODU2E}",
+ IfOCHOTU2EODU2E.VALUE)
+ .put("IfOchOTU2EODU2E{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OCH-OTU2E-ODU2E}",
+ IfOCHOTU2EODU2E.VALUE)
+ .put("IfOchOTU2EODU2E{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-OCH-OTU2E-ODU2E}",
+ IfOCHOTU2EODU2E.VALUE)
+ .put("IfOchOTU3ODU3{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OCH-OTU3-ODU3}",
+ IfOCHOTU3ODU3.VALUE)
+ .put("IfOchOTU3ODU3{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OCH-OTU3-ODU3}",
+ IfOCHOTU3ODU3.VALUE)
+ .put("IfOchOTU3ODU3{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-OCH-OTU3-ODU3}",
+ IfOCHOTU3ODU3.VALUE)
+ .put("IfOCHOTU4ODU4{qname=(http://org/openroadm/port/types?revision=2018-10-19)if-OCH-OTU4-ODU4}",
+ IfOCHOTU4ODU4.VALUE)
+ .put("IfOCHOTU4ODU4{qname=(http://org/openroadm/port/types?revision=2020-03-27)if-OCH-OTU4-ODU4}",
+ IfOCHOTU4ODU4.VALUE)
+ .put("IfOCHOTU4ODU4{qname=(http://org/openroadm/port/types?revision=2023-05-26)if-OCH-OTU4-ODU4}",
+ IfOCHOTU4ODU4.VALUE)
+ .put("IfOCHOTU4ODU4regen{qname=(http://org/openroadm/port/types?revision=2018-10-19)"
+ + "if-OCH-OTU4-ODU4-regen}", IfOCHOTU4ODU4Regen.VALUE)
+ .put("IfOCHOTU4ODU4uniregen{qname=(http://org/openroadm/port/types?revision=2018-10-19)"
+ + "if-OCH-OTU4-ODU4-uniregen}", IfOCHOTU4ODU4Uniregen.VALUE)
+ .put("IfOTUCnODUCn{qname=(http://org/openroadm/port/types?revision=2020-03-27)"
+ + "if-OTUCn-ODUCn}", IfOTUCnODUCn.VALUE)
+ .put("IfOTUCnODUCn{qname=(http://org/openroadm/port/types?revision=2023-05-26)"
+ + "if-OTUCn-ODUCn}", IfOTUCnODUCn.VALUE)
+ .put("IfOTUCnODUCnregen{qname=(http://org/openroadm/port/types?revision=2020-03-27)"
+ + "if-OTUCn-ODUCn-regen}", IfOTUCnODUCnRegen.VALUE)
+ .put("IfOTUCnODUCnregen{qname=(http://org/openroadm/port/types?revision=2023-05-26)"
+ + "if-OTUCn-ODUCn-regen}", IfOTUCnODUCnRegen.VALUE)
+ .put("IfOTUCnODUCnuniregen{qname=(http://org/openroadm/port/types?revision=2023-05-26)"
+ + "if-OTUCn-ODUCn-uniregen}", IfOTUCnODUCnUniregen.VALUE)
+ .put("IfOtsiOtucnOducn{qname=(http://org/openroadm/port/types?revision=2020-03-27)"
+ + "if-otsi-otucn-oducn}", IfOtsiOtucnOducn.VALUE)
+ .put("IfOtsiOtucnOducn{qname=(http://org/openroadm/port/types?revision=2023-05-26)"
+ + "if-otsi-otucn-oducn}", IfOtsiOtucnOducn.VALUE)
.build();
private final DataBroker dataBroker;
package org.opendaylight.transportpce.common.mapping;
+import com.google.common.collect.ImmutableMap;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
"{} : Updating old mapping data {} for {} by new mapping data {}";
public static final String XPDR_LIST_IN_CONF_LOGMSG =
"{} : list of Xponders {} in configuration";
+ public static final ImmutableMap<String, String> INTERFACE_RATE_MAP =
+ ImmutableMap.<String, String>builder()
+ .put("If1GE", "1")
+ .put("If10GE", "10")
+ .put("If40GE", "40")
+ .put("If100GE", "100")
+ .put("If200GE", "200")
+ .put("If400GE", "400")
+ .put("If1GEODU0", "1")
+ .put("If10GEODU2", "10")
+ .put("If10GEODU2e", "10")
+ .put("If10GEoduflexgfp", "10")
+ .put("If25GEoduflexcbr", "25")
+ .put("If40GEODU3", "40")
+ .put("If100GEODU4", "100")
+ .put("If100GEoduflexgfp", "100")
+ .put("If200GEoduflexcbr", "200")
+ .put("If400GEodufleximp", "400")
+ .put("If400GEoduflexcbr", "400")
+ .put("IfOCHOTU1ODU1", "1")
+ .put("IfOCHOTU2ODU2", "10")
+ .put("IfOCHOTU2EODU2E", "10")
+ .put("IfOCHOTU3ODU3", "40")
+ .put("IfOCHOTU4ODU4", "100")
+ .put("IfOCHOTU4ODU4uniregen", "100")
+ .put("IfOCHOTU4ODU4regen", "100")
+ .put("IfOCHOTUCnODUCn", "400")
+ .put("IfOCHOTUCnODUCnregen", "400")
+ .put("IfOCHOTUCnODUCnuniregen", "400")
+ .put("Ifotsiotucnoducn", "400")
+ .put("IfnOTU4ODU4", "100")
+ .put("IfOTU1ODU1", "1")
+ .put("IfOTU2ODU2", "10")
+ .put("IfOTU2eODU2e", "10")
+ .put("IfOTU3ODU3", "40")
+ .put("IfOTU4ODU4", "100")
+ .build();
+
+ //new HashMap<>(Map.of(IfOTU4ODU4.VALUE, "1"));
/**
* Implements the FNV-1 64bit algorithm.
String logicalConnectionPoint, String partnerLcp) {
Set<org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.SupportedIfCapability> supportedIntf =
new HashSet<>();
+ Integer maxrate = 0;
+ Integer rate = 0;
for (String sup: getSupIfCapList(port)) {
if (MappingUtilsImpl.convertSupIfCapa(sup) != null) {
supportedIntf.add(MappingUtilsImpl.convertSupIfCapa(sup));
+ var rateFromMap = PortMappingUtils.INTERFACE_RATE_MAP
+ .get(MappingUtilsImpl.convertSupIfCapa(sup).implementedInterface().getSimpleName());
+ rate = rateFromMap == null ? Integer.valueOf(0) : Integer.valueOf(rateFromMap);
+
}
+ maxrate = (rate > maxrate) ? rate : maxrate;
}
MappingBuilder mpBldr = new MappingBuilder()
.withKey(new MappingKey(logicalConnectionPoint))
.setPortDirection(port.getPortDirection().getName())
.setXpdrType(XpdrNodeTypes.Tpdr)
.setLcpHashVal(PortMappingUtils.fnv1size64(nodeId + "-" + logicalConnectionPoint))
- .setSupportedInterfaceCapability(supportedIntf);
+ .setSupportedInterfaceCapability(supportedIntf)
+ .setRate(String.valueOf(maxrate));
if (port.getPortQual() != null) {
mpBldr.setPortQual(port.getPortQual().getName());
}
String logicalConnectionPoint, String partnerLcp, XpdrNodeTypes xpdrNodeType) {
Set<org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.SupportedIfCapability> supportedIntf =
new HashSet<>();
+ Integer maxrate = 0;
+ Integer rate = 0;
for (String sup: getSupIfCapList(port)) {
if (MappingUtilsImpl.convertSupIfCapa(sup) != null) {
supportedIntf.add(MappingUtilsImpl.convertSupIfCapa(sup));
+ var rateFromMap = PortMappingUtils.INTERFACE_RATE_MAP
+ .get(MappingUtilsImpl.convertSupIfCapa(sup).implementedInterface().getSimpleName());
+ rate = rateFromMap == null ? Integer.valueOf(0) : Integer.valueOf(rateFromMap);
}
+ maxrate = (rate > maxrate) ? rate : maxrate;
}
MappingBuilder mpBldr = new MappingBuilder()
.withKey(new MappingKey(logicalConnectionPoint))
.setSupportingPort(port.getPortName())
.setPortDirection(port.getPortDirection().getName())
.setLcpHashVal(PortMappingUtils.fnv1size64(nodeId + "-" + logicalConnectionPoint))
- .setSupportedInterfaceCapability(supportedIntf);
+ .setSupportedInterfaceCapability(supportedIntf)
+ .setRate(String.valueOf(maxrate));
if (port.getPortQual() != null) {
mpBldr.setPortQual(port.getPortQual().getName());
}
mpBldr.setPartnerLcp(partnerLcp);
}
Collection<SupportedInterfaceCapability> supIntfCapaList = getSupIntfCapaList(port);
+ int maxRate = 0;
+ Integer rate;
+ int maxOpModeRate = 0;
+ int opModeRate;
if (supIntfCapaList != null) {
Set<org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.SupportedIfCapability>
supportedIntf = new HashSet<>();
Set<String> regenProfiles = new HashSet<>();
+ rate = 0;
+ LOG.debug("PORTMapping710 line1061, SupportedInterfaceCapa {}", supIntfCapaList);
for (SupportedInterfaceCapability sic : supIntfCapaList) {
// Here it could add null values and cause a null pointer exception
// Especially when the MappingUtilsImpl does not contain required supported-if-cap
+ LOG.debug("PORTMapping710 line1065, Scanning SupportedInterfaceCap, Interface {}", sic);
if (MappingUtilsImpl.convertSupIfCapa(sic.getIfCapType().toString()) != null) {
+ LOG.debug("PORTMapping710 line1067, Converted IfCapType, {}",
+ MappingUtilsImpl.convertSupIfCapa(sic.getIfCapType().toString()));
supportedIntf.add(MappingUtilsImpl.convertSupIfCapa(sic.getIfCapType().toString()));
+ var rateFromMap = PortMappingUtils.INTERFACE_RATE_MAP
+ .get(MappingUtilsImpl.convertSupIfCapa(sic.getIfCapType().toString())
+ .implementedInterface().getSimpleName());
+ rate = rateFromMap == null ? Integer.valueOf(0) : Integer.valueOf(rateFromMap);
}
+ maxRate = (rate > maxRate) ? rate : maxRate;
LOG.debug("This the xpdr-type {}", xpdrNodeType.getName());
// Here we use both types of Regen (bi/uni). Though initial support is only for bi-directional regen
if (xpdrNodeType == XpdrNodeTypes.Regen || xpdrNodeType == XpdrNodeTypes.RegenUni) {
.setMaxTribSlot(minMaxOpucnTribSlots.get(1))
.build());
}
+ opModeRate = 0;
+ Set<String> opModeList = sic.getOpticalOperationalModeProfileName();
+ if (opModeList != null && !opModeList.isEmpty()) {
+ mpBldr.setSupportedOperationalMode(sic.getOpticalOperationalModeProfileName());
+ for (String opMode : opModeList) {
+ //Extracting Max rate (from 100Gps to 1.6 Tbps) from Operational-modes
+ for (int subRateMultiplier = 1 ; subRateMultiplier < 17; subRateMultiplier++) {
+ if (opMode.contains(String.valueOf(subRateMultiplier * 100))) {
+ opModeRate = subRateMultiplier * 100;
+ }
+ }
+ maxOpModeRate = (opModeRate > maxOpModeRate) ? opModeRate : maxOpModeRate;
+ }
+ }
}
+ // maxRate is calculated from the type of supported interfaces. However for ODUCN and OTUCN, a default
+ // value of 400G is used. If Supported Operational Mode is populated, the real maximum rate shall be
+ // extrapolated from the operational mode that contains the rate rather than from default value of 400(G)
+ maxRate = (maxOpModeRate > 0) ? maxOpModeRate : maxRate;
mpBldr.setRegenProfiles(new RegenProfilesBuilder().setRegenProfile(regenProfiles).build())
.setSupportedInterfaceCapability(supportedIntf);
+ mpBldr.setRate(String.valueOf(maxRate));
}
if (port.getAdministrativeState() != null) {
mpBldr.setPortAdminState(port.getAdministrativeState().name());
import static org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.XpdrNodeTypes.Tpdr;
+import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.network.Nodes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Link1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Link1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev230526.FrequencyGHz;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.Node1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.DegreeAttributesBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.SrgAttributes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.SrgAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.XpdrNetworkAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.XpdrNetworkAttributesBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.OpenroadmLinkType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.OpenroadmNodeType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.OpenroadmTpType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev230526.xpdr.mode.attributes.SupportedOperationalModesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev230526.xpdr.mode.attributes.supported.operational.modes.OperationalMode;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev230526.xpdr.mode.attributes.supported.operational.modes.OperationalModeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev230526.xpdr.mode.attributes.supported.operational.modes.OperationalModeKey;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NetworkId;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.node.TerminationPointBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.node.TerminationPointKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Decimal64;
import org.opendaylight.yangtools.yang.common.Uint16;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
if (!isOtn && m.getConnectionMapLcp() != null) {
ocnTp1Bldr.setAssociatedConnectionMapTp(Set.of(new TpId(m.getConnectionMapLcp())));
}
+
TerminationPointBuilder ietfTpBldr = createTpBldr(m.getLogicalConnectionPoint())
- .addAugmentation(
- // Add openroadm-network-topology tp augmentations
- ocnTp1Bldr.build());
+ // Add openroadm-common tp augmentations
+ .addAugmentation(ocnTp1Bldr.build());
+
+ if (m.getPortQual().equals("xpdr-network") && m.getSupportedOperationalMode() != null
+ && !m.getSupportedOperationalMode().isEmpty()) {
+
+ Map<OperationalModeKey, OperationalMode> mapSopm = new HashMap<>();
+ for (String opMode : m.getSupportedOperationalMode()) {
+ mapSopm.put(new OperationalModeKey(opMode),
+ new OperationalModeBuilder()
+ .setModeId(opMode)
+ //TODO : fill SpectralWidth with from Catalog
+ .setSpectralWidth(new FrequencyGHz(Decimal64.valueOf(0.0, RoundingMode.DOWN)))
+ .build());
+ }
+ XpdrNetworkAttributes xna = new XpdrNetworkAttributesBuilder()
+ .setSupportedOperationalModes(
+ new SupportedOperationalModesBuilder().setOperationalMode(mapSopm).build())
+ .build();
+ // Add openroadm-network-topology tp augmentations
+ ietfTpBldr.addAugmentation(
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526
+ .TerminationPoint1Builder()
+ .setXpdrNetworkAttributes(xna)
+ .build());
+ }
+
TerminationPoint ietfTp = ietfTpBldr.build();
tpMap.put(ietfTp.key(),ietfTp);
+
}
+
// Create ietf node augmentation to support ietf tp-list
return ietfNodeBldr.addAugmentation(
new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1Builder()
response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-NETWORK1")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supporting-port': '1', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET',
- 'logical-connection-point': 'XPDR1-NETWORK1', 'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-CLIENT1', 'port-qual': 'xpdr-network',
- 'lcp-hash-val': 'OSvMgUyP+mE=', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-NETWORK1',
+ 'supporting-circuit-pack-name': '1/0/1-PLUG-NET', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': '1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-CLIENT1',
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr', 'port-qual': 'xpdr-network',
+ 'lcp-hash-val': 'OSvMgUyP+mE='},
response['mapping'])
def test_11_xpdr_portmapping_NETWORK2(self):
response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-NETWORK2")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supporting-port': '1', 'supporting-circuit-pack-name': '1/0/2-PLUG-NET',
- 'logical-connection-point': 'XPDR1-NETWORK2', 'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-CLIENT3', 'port-qual': 'xpdr-network',
- 'lcp-hash-val': 'OSvMgUyP+mI=', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-NETWORK2',
+ 'supporting-circuit-pack-name': '1/0/2-PLUG-NET', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': '1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-CLIENT3',
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr', 'port-qual': 'xpdr-network',
+ 'lcp-hash-val': 'OSvMgUyP+mI='},
response['mapping'])
def test_12_xpdr_portmapping_CLIENT1(self):
response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT1")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supporting-port': 'C1',
- 'supporting-circuit-pack-name': '1/0/C1-PLUG-CLIENT',
- 'logical-connection-point': 'XPDR1-CLIENT1', 'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-client',
- 'lcp-hash-val': 'AO9UFkY/TLYw', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-CLIENT1',
+ 'supporting-circuit-pack-name': '1/0/C1-PLUG-CLIENT', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': 'C1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-NETWORK1',
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr', 'port-qual': 'xpdr-client',
+ 'lcp-hash-val': 'AO9UFkY/TLYw'},
response['mapping'])
def test_13_xpdr_portmapping_CLIENT2(self):
response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT2")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supporting-port': 'C2',
- 'supporting-circuit-pack-name': '1/0/C2-PLUG-CLIENT',
- 'logical-connection-point': 'XPDR1-CLIENT2', 'port-direction': 'bidirectional',
- 'port-qual': 'xpdr-client',
- 'lcp-hash-val': 'AO9UFkY/TLYz', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-CLIENT2',
+ 'supporting-circuit-pack-name': '1/0/C2-PLUG-CLIENT', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': 'C2',
+ 'port-oper-state': 'InService', 'port-direction': 'bidirectional',
+ 'xpdr-type': 'tpdr', 'port-qual': 'xpdr-client', 'lcp-hash-val': 'AO9UFkY/TLYz'},
response['mapping'])
def test_14_xpdr_portmapping_CLIENT3(self):
response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT3")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supporting-port': 'C3', 'xpdr-type': 'tpdr',
- 'supporting-circuit-pack-name': '1/0/C3-PLUG-CLIENT',
- 'logical-connection-point': 'XPDR1-CLIENT3',
- 'connection-map-lcp': 'XPDR1-NETWORK2', 'port-direction': 'bidirectional',
- 'port-qual': 'xpdr-client', 'lcp-hash-val': 'AO9UFkY/TLYy',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-CLIENT3',
+ 'supporting-circuit-pack-name': '1/0/C3-PLUG-CLIENT', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': 'C3',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-NETWORK2',
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr',
+ 'port-qual': 'xpdr-client', 'lcp-hash-val': 'AO9UFkY/TLYy'},
response['mapping'])
def test_15_xpdr_portmapping_CLIENT4(self):
response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT4")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supporting-port': 'C4', 'xpdr-type': 'tpdr',
- 'supporting-circuit-pack-name': '1/0/C4-PLUG-CLIENT',
- 'logical-connection-point': 'XPDR1-CLIENT4', 'port-direction': 'bidirectional',
- 'port-qual': 'xpdr-client', 'lcp-hash-val': 'AO9UFkY/TLY1',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-CLIENT4',
+ 'supporting-circuit-pack-name': '1/0/C4-PLUG-CLIENT', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': 'C4',
+ 'port-oper-state': 'InService', 'port-direction': 'bidirectional',
+ 'xpdr-type': 'tpdr', 'port-qual': 'xpdr-client', 'lcp-hash-val': 'AO9UFkY/TLY1'},
response['mapping'])
def test_16_xpdr_device_disconnection(self):
response = test_utils.get_portmapping_node_attr("XPDRA01", None, None)
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supporting-port': '1', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET',
- 'logical-connection-point': 'XPDR1-NETWORK1', 'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-CLIENT1', 'port-qual': 'xpdr-network',
- 'lcp-hash-val': 'OSvMgUyP+mE=', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-NETWORK1',
+ 'supporting-circuit-pack-name': '1/0/1-PLUG-NET', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': '1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-CLIENT1',
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr',
+ 'port-qual': 'xpdr-network', 'lcp-hash-val': 'OSvMgUyP+mE='},
response['nodes'][0]['mapping'])
self.assertIn(
- {'supporting-port': 'C1',
- 'supporting-circuit-pack-name': '1/0/C1-PLUG-CLIENT',
- 'logical-connection-point': 'XPDR1-CLIENT1', 'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-client',
- 'lcp-hash-val': 'AO9UFkY/TLYw', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-CLIENT1',
+ 'supporting-circuit-pack-name': '1/0/C1-PLUG-CLIENT', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': 'C1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-NETWORK1',
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr',
+ 'port-qual': 'xpdr-client', 'lcp-hash-val': 'AO9UFkY/TLYw'},
response['nodes'][0]['mapping'])
def test_05_service_path_create(self):
response = test_utils.get_portmapping_node_attr("XPDR-A1", "mapping", "XPDR1-NETWORK1")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supported-interface-capability': ['org-openroadm-port-types:if-OCH'],
- 'supporting-port': '1', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET',
- 'logical-connection-point': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-network',
- 'port-direction': 'bidirectional', 'connection-map-lcp': 'XPDR1-CLIENT1',
- 'lcp-hash-val': 'AMkDwQ7xTmRI', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-NETWORK1',
+ 'supporting-circuit-pack-name': '1/0/1-PLUG-NET', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': '1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-CLIENT1',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-OCH'],
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr',
+ 'port-qual': 'xpdr-network', 'lcp-hash-val': 'AMkDwQ7xTmRI'},
response['mapping'])
def test_12_xpdr_portmapping_XPDR2_NETWORK1(self):
response = test_utils.get_portmapping_node_attr("XPDR-A1", "mapping", "XPDR1-NETWORK2")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supported-interface-capability': ['org-openroadm-port-types:if-OCH'],
- 'supporting-port': '1', 'supporting-circuit-pack-name': '1/0/2-PLUG-NET',
- 'logical-connection-point': 'XPDR1-NETWORK2', 'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-CLIENT2', 'port-qual': 'xpdr-network',
- 'lcp-hash-val': 'AMkDwQ7xTmRL', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-NETWORK2',
+ 'supporting-circuit-pack-name': '1/0/2-PLUG-NET', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': '1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-CLIENT2',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-OCH'],
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr',
+ 'port-qual': 'xpdr-network', 'lcp-hash-val': 'AMkDwQ7xTmRL'},
response['mapping'])
def test_13_xpdr_portmapping_XPDR1_CLIENT1(self):
response = test_utils.get_portmapping_node_attr("XPDR-A1", "mapping", "XPDR1-CLIENT1")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supported-interface-capability': ['org-openroadm-port-types:if-100GE'],
- 'supporting-port': 'C1',
- 'supporting-circuit-pack-name': '1/0/1-PLUG-CLIENT',
- 'logical-connection-point': 'XPDR1-CLIENT1', 'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-client',
- 'lcp-hash-val': 'AJUUr6I5fALj', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-CLIENT1',
+ 'supporting-circuit-pack-name': '1/0/1-PLUG-CLIENT', 'rate': '100',
+ 'port-admin-state': 'InService', 'supporting-port': 'C1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-NETWORK1',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-100GE'],
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr',
+ 'port-qual': 'xpdr-client', 'lcp-hash-val': 'AJUUr6I5fALj'},
response['mapping'])
def test_14_xpdr_portmapping_XPDR1_CLIENT2(self):
response = test_utils.get_portmapping_node_attr("XPDR-A1", "mapping", "XPDR1-CLIENT2")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supported-interface-capability': ['org-openroadm-port-types:if-100GE'],
- 'supporting-port': 'C1',
- 'supporting-circuit-pack-name': '1/0/2-PLUG-CLIENT',
- 'logical-connection-point': 'XPDR1-CLIENT2', 'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-NETWORK2', 'port-qual': 'xpdr-client',
- 'lcp-hash-val': 'AJUUr6I5fALg', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-CLIENT2',
+ 'supporting-circuit-pack-name': '1/0/2-PLUG-CLIENT', 'rate': '100',
+ 'port-admin-state': 'InService', 'supporting-port': 'C1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-NETWORK2',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-100GE'],
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr', 'port-qual': 'xpdr-client',
+ 'lcp-hash-val': 'AJUUr6I5fALg'},
response['mapping'])
def test_15_spdr_device_connection(self):
response = test_utils.get_portmapping_node_attr("SPDR-SA1", "mapping", "XPDR1-NETWORK1")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {"logical-connection-point": "XPDR1-NETWORK1",
- "supporting-circuit-pack-name": "CP1-CFP0",
- "supported-interface-capability": ["org-openroadm-port-types:if-OCH-OTU4-ODU4"],
- "supporting-port": "CP1-CFP0-P1",
- "lcp-hash-val": "Swfw02qXGyI=",
- "port-direction": "bidirectional",
- "port-admin-state": "InService",
- "xpdr-type": "mpdr",
- "port-qual": "xpdr-network",
- "port-oper-state": "InService"},
+ {'logical-connection-point': 'XPDR1-NETWORK1',
+ 'supporting-circuit-pack-name': 'CP1-CFP0', 'rate': '100',
+ 'port-admin-state': 'InService', 'supporting-port': 'CP1-CFP0-P1',
+ 'port-oper-state': 'InService',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-OCH-OTU4-ODU4'],
+ 'port-direction': 'bidirectional', 'xpdr-type': 'mpdr', 'port-qual': 'xpdr-network',
+ 'lcp-hash-val': 'Swfw02qXGyI='},
response['mapping'])
def test_24_spdr_portmapping_XPDR2_CLIENT2(self):
response = test_utils.get_portmapping_node_attr("SPDR-SA1", "mapping", "XPDR2-NETWORK2")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {"logical-connection-point": "XPDR2-NETWORK2",
- "supporting-circuit-pack-name": "CP6-CFP",
- "supported-interface-capability": ["org-openroadm-port-types:if-OCH-OTU4-ODU4"],
- "supporting-port": "CP6-CFP-P1",
- "lcp-hash-val": "exT821pFtOQ=",
- "port-direction": "bidirectional",
- "port-admin-state": "InService",
- "xpdr-type": "switch",
- "port-qual": "switch-network",
- "port-oper-state": "InService"},
+ {'logical-connection-point': 'XPDR2-NETWORK2',
+ 'supporting-circuit-pack-name': 'CP6-CFP', 'rate': '100',
+ 'port-admin-state': 'InService', 'supporting-port': 'CP6-CFP-P1',
+ 'port-oper-state': 'InService',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-OCH-OTU4-ODU4'],
+ 'port-direction': 'bidirectional', 'xpdr-type': 'switch',
+ 'port-qual': 'switch-network', 'lcp-hash-val': 'exT821pFtOQ='},
response['mapping'])
def test_26_spdr_portmapping_XPDR3_CLIENT3(self):
response = test_utils.get_portmapping_node_attr("SPDR-SA1", "mapping", "XPDR3-CLIENT3")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {"logical-connection-point": "XPDR3-CLIENT3",
- "supporting-circuit-pack-name": "CP3-SFP3",
- "supported-interface-capability": ["org-openroadm-port-types:if-1GE-ODU0"],
- "supporting-port": "CP3-SFP3-P1",
- "lcp-hash-val": "AKsQ/HRQdtdN",
- "port-direction": "bidirectional",
- "port-admin-state": "InService",
- "xpdr-type": "mpdr",
- "port-qual": "xpdr-client",
- "port-oper-state": "InService"},
+ {'logical-connection-point': 'XPDR3-CLIENT3',
+ 'supporting-circuit-pack-name': 'CP3-SFP3', 'rate': '1',
+ 'port-admin-state': 'InService', 'supporting-port': 'CP3-SFP3-P1',
+ 'port-oper-state': 'InService',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-1GE-ODU0'],
+ 'port-direction': 'bidirectional', 'xpdr-type': 'mpdr',
+ 'port-qual': 'xpdr-client', 'lcp-hash-val': 'AKsQ/HRQdtdN'},
response['mapping'])
def test_27_spdr_portmapping_XPDR3_NETWORK1(self):
response = test_utils.get_portmapping_node_attr("SPDR-SA1", "mapping", "XPDR3-NETWORK1")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {"logical-connection-point": "XPDR3-NETWORK1",
- "supporting-circuit-pack-name": "CP3-CFP0",
- "supported-interface-capability": ["org-openroadm-port-types:if-OCH-OTU4-ODU4"],
- "supporting-port": "CP3-CFP0-P1",
- "lcp-hash-val": "ANnxoi7K8q30",
- "port-direction": "bidirectional",
- "port-admin-state": "InService",
- "xpdr-type": "mpdr",
- "port-qual": "xpdr-network",
- "port-oper-state": "InService"},
+ {'logical-connection-point': 'XPDR3-NETWORK1',
+ 'supporting-circuit-pack-name': 'CP3-CFP0', 'rate': '100',
+ 'port-admin-state': 'InService', 'supporting-port': 'CP3-CFP0-P1',
+ 'port-oper-state': 'InService',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-OCH-OTU4-ODU4'],
+ 'port-direction': 'bidirectional', 'xpdr-type': 'mpdr', 'port-qual': 'xpdr-network',
+ 'lcp-hash-val': 'ANnxoi7K8q30'},
response['mapping'])
def test_28_spdr_device_disconnection(self):
response = test_utils.get_portmapping_node_attr("XPDR-A1", None, None)
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supported-interface-capability': ['org-openroadm-port-types:if-OCH'],
- 'supporting-port': '1', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET',
- 'logical-connection-point': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-network',
- 'port-direction': 'bidirectional', 'connection-map-lcp': 'XPDR1-CLIENT1',
- 'lcp-hash-val': 'AMkDwQ7xTmRI', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-NETWORK1',
+ 'supporting-circuit-pack-name': '1/0/1-PLUG-NET', 'rate': '0',
+ 'port-admin-state': 'InService', 'supporting-port': '1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-CLIENT1',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-OCH'],
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr',
+ 'port-qual': 'xpdr-network', 'lcp-hash-val': 'AMkDwQ7xTmRI'},
response['nodes'][0]['mapping'])
self.assertIn(
- {'supported-interface-capability': ['org-openroadm-port-types:if-100GE'],
- 'supporting-port': 'C1',
- 'supporting-circuit-pack-name': '1/0/1-PLUG-CLIENT',
- 'logical-connection-point': 'XPDR1-CLIENT1', 'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-client',
- 'lcp-hash-val': 'AJUUr6I5fALj', 'xpdr-type': 'tpdr',
- 'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+ {'logical-connection-point': 'XPDR1-CLIENT1',
+ 'supporting-circuit-pack-name': '1/0/1-PLUG-CLIENT', 'rate': '100',
+ 'port-admin-state': 'InService', 'supporting-port': 'C1',
+ 'port-oper-state': 'InService', 'connection-map-lcp': 'XPDR1-NETWORK1',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-100GE'],
+ 'port-direction': 'bidirectional', 'xpdr-type': 'tpdr',
+ 'port-qual': 'xpdr-client', 'lcp-hash-val': 'AJUUr6I5fALj'},
response['nodes'][0]['mapping'])
def test_05_service_path_create(self):
class TransportPCEtesting(unittest.TestCase):
processes = None
- NETWORK1_CHECK_DICT = {"logical-connection-point": "XPDR1-NETWORK1",
- "supporting-port": "CP1-CFP0-P1",
- "supported-interface-capability": [
- "org-openroadm-port-types:if-OCH-OTU4-ODU4"
- ],
- "port-direction": "bidirectional",
- "port-qual": "xpdr-network",
- "supporting-circuit-pack-name": "CP1-CFP0",
- "xpdr-type": "mpdr",
- 'lcp-hash-val': 'Swfw02qXGyI=',
+ NETWORK1_CHECK_DICT = {'logical-connection-point': 'XPDR1-NETWORK1',
+ 'supporting-circuit-pack-name': 'CP1-CFP0',
+ 'rate': '100',
'port-admin-state': 'InService',
- 'port-oper-state': 'InService'}
+ 'supporting-port': 'CP1-CFP0-P1',
+ 'port-oper-state': 'InService',
+ 'supported-interface-capability': [
+ 'org-openroadm-port-types:if-OCH-OTU4-ODU4'
+ ],
+ 'port-direction': 'bidirectional',
+ 'xpdr-type': 'mpdr', 'port-qual': 'xpdr-network',
+ 'lcp-hash-val': 'Swfw02qXGyI='}
NODE_VERSION = '2.2.1'
@classmethod
response = test_utils.get_portmapping_node_attr("XPDR-A2", "mapping", "XPDR1-NETWORK1")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supported-interface-capability':
- ['org-openroadm-port-types:if-otsi-otsigroup'],
- 'supporting-port': 'L1',
- 'supporting-circuit-pack-name': '1/1/2-PLUG-NET',
- 'logical-connection-point': 'XPDR1-NETWORK1',
- 'port-qual': 'xpdr-network',
- 'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-CLIENT1',
- 'lcp-hash-val': 'AIGiVAQ4gDil',
- 'port-admin-state': 'InService',
- 'port-oper-state': 'InService',
- 'xpdr-type': 'tpdr'
- },
+ {
+ 'logical-connection-point': 'XPDR1-NETWORK1',
+ 'supporting-circuit-pack-name': '1/1/2-PLUG-NET',
+ 'rate': '200',
+ 'supporting-port': 'L1',
+ 'port-oper-state': 'InService',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-otsi-otsigroup'],
+ 'port-direction': 'bidirectional',
+ 'port-qual': 'xpdr-network',
+ 'port-admin-state': 'InService',
+ 'connection-map-lcp': 'XPDR1-CLIENT1',
+ 'supported-operational-mode': ['OR-W-200G-oFEC-31.6Gbd', 'OR-W-100G-oFEC-31.6Gbd'],
+ 'xpdr-type': 'tpdr',
+ 'lcp-hash-val': 'AIGiVAQ4gDil'
+ },
response['mapping'])
def test_05_tpdr_portmapping_CLIENT1(self):
response = test_utils.get_portmapping_node_attr("XPDR-A2", "mapping", "XPDR1-CLIENT1")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supported-interface-capability': ['org-openroadm-port-types:if-400GE'],
- 'supporting-port': 'C1',
+ {'logical-connection-point': 'XPDR1-CLIENT1',
'supporting-circuit-pack-name': '1/1/1-PLUG-CLIENT',
- 'logical-connection-point': 'XPDR1-CLIENT1',
+ 'rate': '400', 'supporting-port': 'C1',
+ 'port-oper-state': 'InService',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-400GE'],
'port-direction': 'bidirectional',
- 'connection-map-lcp': 'XPDR1-NETWORK1',
'port-qual': 'xpdr-client',
- 'lcp-hash-val': 'AODABTVSOHH0',
'port-admin-state': 'InService',
- 'port-oper-state': 'InService',
- 'xpdr-type': 'tpdr'
+ 'connection-map-lcp': 'XPDR1-NETWORK1',
+ 'xpdr-type': 'tpdr',
+ 'lcp-hash-val': 'AODABTVSOHH0'
},
response['mapping']
)
response = test_utils.get_portmapping_node_attr("XPDR-A2", "mapping", "XPDR2-NETWORK1")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn(
- {'supported-interface-capability':
- ['org-openroadm-port-types:if-otsi-otsigroup'],
- 'supporting-port': 'L1',
+ {'logical-connection-point': 'XPDR2-NETWORK1',
'supporting-circuit-pack-name': '1/2/2-PLUG-NET',
- 'logical-connection-point': 'XPDR2-NETWORK1',
- 'port-qual': 'switch-network',
+ 'rate': '200',
+ 'supporting-port': 'L1',
+ 'port-oper-state': 'InService',
+ 'supported-interface-capability': ['org-openroadm-port-types:if-otsi-otsigroup'],
'port-direction': 'bidirectional',
- 'lcp-hash-val': 'LY9PxYJqUbw=',
+ 'port-qual': 'switch-network',
'port-admin-state': 'InService',
- 'port-oper-state': 'InService',
- 'xpdr-type': 'mpdr'
+ 'supported-operational-mode': ['OR-W-200G-oFEC-31.6Gbd', 'OR-W-100G-oFEC-31.6Gbd'],
+ 'xpdr-type': 'mpdr',
+ 'lcp-hash-val': 'LY9PxYJqUbw='
},
response['mapping'])
processes = None
NETWORK2_CHECK_DICT = {"logical-connection-point": "XPDR2-NETWORK1",
- "supporting-port": "L1",
- "supported-interface-capability": [
- "org-openroadm-port-types:if-otsi-otsigroup"
+ 'supporting-circuit-pack-name': '1/2/2-PLUG-NET',
+ 'rate': '200',
+ 'supporting-port': 'L1',
+ 'port-oper-state': 'InService',
+ 'supported-interface-capability': [
+ 'org-openroadm-port-types:if-otsi-otsigroup'
],
- "port-direction": "bidirectional",
- "port-qual": "switch-network",
- "supporting-circuit-pack-name": "1/2/2-PLUG-NET",
- "xpdr-type": "mpdr",
- 'lcp-hash-val': 'LY9PxYJqUbw=',
+ 'port-direction': 'bidirectional',
+ 'port-qual': 'switch-network',
'port-admin-state': 'InService',
- 'port-oper-state': 'InService'}
+ 'supported-operational-mode': [
+ 'OR-W-200G-oFEC-31.6Gbd', 'OR-W-100G-oFEC-31.6Gbd'
+ ],
+ 'xpdr-type': 'mpdr',
+ 'lcp-hash-val': 'LY9PxYJqUbw='}
NODE_VERSION = '7.1'
@classmethod
class TransportPCE400GPortMappingTesting(unittest.TestCase):
processes = None
- NETWORK1_CHECK_DICT = {"logical-connection-point": "XPDR3-NETWORK1",
- "supporting-port": "L1",
- "supported-interface-capability": [
- "org-openroadm-port-types:if-otsi-otsigroup"
+ NETWORK1_CHECK_DICT = {'logical-connection-point': 'XPDR3-NETWORK1',
+ 'supporting-circuit-pack-name': '1/1/4-PLUG-NET',
+ 'rate': '200',
+ 'supporting-port': 'L1',
+ 'port-oper-state': 'InService',
+ 'supported-interface-capability': [
+ 'org-openroadm-port-types:if-otsi-otsigroup'
],
- "port-direction": "bidirectional",
- "port-qual": "xpdr-network",
- "supporting-circuit-pack-name": "1/1/4-PLUG-NET",
- "xpdr-type": "tpdr",
- "port-admin-state": "InService",
- "port-oper-state": "InService"}
+ 'port-direction': 'bidirectional',
+ 'port-qual': 'xpdr-network',
+ 'port-admin-state': 'InService',
+ 'connection-map-lcp': 'XPDR3-CLIENT1',
+ 'supported-operational-mode': [
+ 'OR-W-200G-oFEC-31.6Gbd', 'OR-W-100G-oFEC-31.6Gbd'
+ ],
+ 'xpdr-type': 'tpdr',
+ 'supporting-otucn': 'XPDR3-NETWORK1-OTUC1',
+ 'lcp-hash-val': 'FDvaQIf2Z08='}
CLIENT_CAPABILITIES = ["org-openroadm-port-types:if-100GE",
"org-openroadm-port-types:if-OCH-OTU4-ODU4"]
NODE_VERSION = "7.1"
./build_karaf_for_tests.sh
[testenv:tests121]
-depends = buildcontroller,build_karaf_tests121,sims121,testsPCE
+depends = buildcontroller,build_karaf_tests121,sims121,testsPCE,tests221
# testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
allowlist_externals = launch_tests.sh
passenv = LAUNCHER