Bumped supported revisions of P4 tools
Includes:
- Use new P4Runtime "v1" package names
- Removed VALID match
- New table entry priority spec (1 is min priority, not 0)
- Fixed p4c-bm2-ss to include arch flag
- Re-compiled P4 programs with more recent p4c (with updated p4info)
Change-Id: I05908f40eda0f0c755009268fd261fb8bcc9be35
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 452a7a7..e23a49c 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
@@ -22,6 +22,7 @@
import com.google.protobuf.TextFormat;
import org.hamcrest.collection.IsIterableContainingInAnyOrder;
import org.hamcrest.collection.IsIterableContainingInOrder;
+import org.junit.Assert;
import org.junit.Test;
import org.onosproject.net.pi.model.PiActionId;
import org.onosproject.net.pi.model.PiActionModel;
@@ -40,22 +41,23 @@
import org.onosproject.net.pi.model.PiPipelineModel;
import org.onosproject.net.pi.model.PiTableId;
import org.onosproject.net.pi.model.PiTableModel;
-import p4.config.P4InfoOuterClass.Table;
-import p4.config.P4InfoOuterClass.P4Info;
-import p4.config.P4InfoOuterClass.MatchField;
-import p4.config.P4InfoOuterClass.ActionRef;
+import p4.config.v1.P4InfoOuterClass.ActionRef;
+import p4.config.v1.P4InfoOuterClass.MatchField;
+import p4.config.v1.P4InfoOuterClass.P4Info;
+import p4.config.v1.P4InfoOuterClass.Table;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.is;
import static org.hamcrest.core.IsNull.notNullValue;
/**
@@ -69,8 +71,6 @@
private static final Long DEFAULT_MAX_TABLE_SIZE = 1024L;
private static final Long DEFAULT_MAX_ACTION_PROFILE_SIZE = 64L;
- public P4InfoParserTest() throws MalformedURLException { }
-
/**
* Tests parse method.
* @throws Exception if equality group objects dose not match as expected
@@ -116,15 +116,14 @@
List<PiMatchFieldModel> piMatchFieldList = new ArrayList<>();
for (MatchField matchFieldIter : matchFieldList) {
- int matchTypeNumber = matchFieldIter.getMatchType().getNumber();
- PiMatchType piMatchType = PiMatchType.VALID;
- switch (matchTypeNumber) {
- case 1: piMatchType = PiMatchType.VALID; break;
- case 2: piMatchType = PiMatchType.EXACT; break;
- case 3: piMatchType = PiMatchType.LPM; break;
- case 4: piMatchType = piMatchType.TERNARY; break;
- case 5: piMatchType = piMatchType.RANGE; break;
- default: piMatchType = PiMatchType.VALID; break;
+ MatchField.MatchType matchType = matchFieldIter.getMatchType();
+ PiMatchType piMatchType;
+ switch (matchType) {
+ case EXACT: piMatchType = PiMatchType.EXACT; break;
+ case LPM: piMatchType = PiMatchType.LPM; break;
+ case TERNARY: piMatchType = PiMatchType.TERNARY; break;
+ case RANGE: piMatchType = PiMatchType.RANGE; break;
+ default: Assert.fail(); return;
}
piMatchFieldList.add(new P4MatchFieldModel(PiMatchFieldId.of(matchFieldIter.getName()),
matchFieldIter.getBitwidth(), piMatchType));