Add Optional match fields support to PI subsystem
Change-Id: Ic458f59cab98340e40c04a0ad060d3c725ac5dbb
diff --git a/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4InfoParserTest.java b/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4InfoParserTest.java
index 0432a18..558acb1 100644
--- a/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4InfoParserTest.java
+++ b/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4InfoParserTest.java
@@ -281,11 +281,11 @@
}
/**
- * Tests parse method with P4Runtime translation fields.
+ * Tests parse method with P4Runtime translation fields and optional fields.
* @throws Exception if equality group objects dose not match as expected
*/
@Test
- public void testParseP4RuntimeTranslation() throws Exception {
+ public void testParseP4RuntimeTranslationAndOptional() throws Exception {
PiPipelineModel model = P4InfoParser.parse(p4InfoUrl2);
// Generate a P4Info object from the file
final P4Info p4info;
@@ -312,6 +312,7 @@
case LPM: piMatchType = PiMatchType.LPM; break;
case TERNARY: piMatchType = PiMatchType.TERNARY; break;
case RANGE: piMatchType = PiMatchType.RANGE; break;
+ case OPTIONAL: piMatchType = PiMatchType.OPTIONAL; break;
default: Assert.fail(); return;
}
if (matchFieldIter.getTypeName().getName().equals("mac_addr_t")) {