commit | c6f2f7f3c529217850ecd32e12a211f8c3e3fc64 | [log] [tgz] |
---|---|---|
author | Daniele Moro <daniele@opennetworking.org> | Fri Dec 18 10:55:57 2020 +0100 |
committer | Daniele Moro <daniele@opennetworking.org> | Fri Feb 05 19:03:05 2021 +0100 |
tree | 94471731457b0b6f5cd777d68910ad08c3114e75 | |
parent | 304b6644a1ac82c8929d1e04dc55ab69fffd65f4 [diff] |
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")) {
diff --git a/protocols/p4runtime/model/src/test/resources/org/onosproject/p4runtime/model/test_p4runtime_translation_p4info.txt b/protocols/p4runtime/model/src/test/resources/org/onosproject/p4runtime/model/test_p4runtime_translation_p4info.txt index 241d989..b984b4c 100644 --- a/protocols/p4runtime/model/src/test/resources/org/onosproject/p4runtime/model/test_p4runtime_translation_p4info.txt +++ b/protocols/p4runtime/model/src/test/resources/org/onosproject/p4runtime/model/test_p4runtime_translation_p4info.txt
@@ -36,7 +36,7 @@ id: 4 name: "hdr.ethernet.etherType" bitwidth: 16 - match_type: EXACT + match_type: OPTIONAL } action_refs { id: 27607748