Fixed omission of new path setup type for segment routing 63/17563/3
authorDana Kutenicsova <dkutenic@cisco.com>
Wed, 1 Apr 2015 16:00:22 +0000 (18:00 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 2 Apr 2015 08:06:18 +0000 (08:06 +0000)
Change-Id: I7f7a41e004f391c0a91e8f4b55ccbfab3e811776
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/PathSetupTypeTlvParser.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPTlvParserTest.java

index 8f87502a7f9c80fa57737810b01bf4fb31791940..004077bc94792087d2b6284517c05c946eb6eaff 100644 (file)
@@ -31,12 +31,14 @@ public class PathSetupTypeTlvParser implements TlvParser, TlvSerializer {
     private static final int PST_LENGTH = 1;
     private static final int OFFSET = CONTENT_LENGTH - PST_LENGTH;
     private static final short RSVP_TE_PST = 0;
+    private static final short SR_PST = 1;
     private static final String UNSUPPORTED_PST = "Unsupported path setup type.";
 
     protected static final Set<Short> PSTS = Sets.newHashSet();
 
     public PathSetupTypeTlvParser() {
         PSTS.add(RSVP_TE_PST);
+        PSTS.add(SR_PST);
     }
 
     @Override
index cbd21943c81695ec5d096df95737b5a512c98787..19effd5ba7f101f1feee6e62095cfcc1707a9b5e 100644 (file)
@@ -68,7 +68,7 @@ public class PCEPTlvParserTest {
 
     private static final byte[] PST_TLV_BYTES = { 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
 
-    private static final byte[] PST_TLV_BYTES_UNSUPPORTED = { 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
+    private static final byte[] PST_TLV_BYTES_UNSUPPORTED = { 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x2 };
 
     private final AbstractVendorSpecificTlvParser vsParser = new AbstractVendorSpecificTlvParser() {
 
@@ -200,7 +200,7 @@ public class PCEPTlvParserTest {
     @Test(expected=IllegalArgumentException.class)
     public void testUnsupportedPSTSerializer() {
         final PathSetupTypeTlvParser parser = new PathSetupTypeTlvParser();
-        final PathSetupType pstTlv = new PathSetupTypeBuilder().setPst((short) 1).build();
+        final PathSetupType pstTlv = new PathSetupTypeBuilder().setPst((short) 2).build();
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeTlv(pstTlv, buff);
     }