[ONOS-4612]Update SFC flows inline with the Official OVS NSH patch
Change-Id: If58517841096a939860d88aa78eca7cae46b9935
diff --git a/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraEncapEthDstTest.java b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraEncapEthDstTest.java
new file mode 100644
index 0000000..971a700
--- /dev/null
+++ b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraEncapEthDstTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.driver.extensions;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import org.junit.Test;
+import org.onlab.packet.MacAddress;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for NiciraEncapEthDstTest class.
+ */
+public class NiciraEncapEthDstTest {
+
+ private final MacAddress mac1 = MacAddress.valueOf("fa:16:3e:da:45:23");
+ private final MacAddress mac2 = MacAddress.valueOf("fa:16:3e:f3:d1:fe");
+
+ /**
+ * Checks the operation of equals() methods.
+ */
+ @Test
+ public void testEquals() {
+ final NiciraEncapEthDst encapEthDst1 = new NiciraEncapEthDst(mac1);
+ final NiciraEncapEthDst sameAsEncapEthDst1 = new NiciraEncapEthDst(mac1);
+ final NiciraEncapEthDst encapEthDst2 = new NiciraEncapEthDst(mac2);
+
+ new EqualsTester().addEqualityGroup(encapEthDst1, sameAsEncapEthDst1).addEqualityGroup(encapEthDst2)
+ .testEquals();
+ }
+
+ /**
+ * Checks the construction of a NiciraEncapEthDstTest object.
+ */
+ @Test
+ public void testConstruction() {
+ final NiciraEncapEthDst encapEthDst1 = new NiciraEncapEthDst(mac1);
+ assertThat(encapEthDst1, is(notNullValue()));
+ assertThat(encapEthDst1.encapEthDst(), is(mac1));
+ }
+}
diff --git a/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraEncapEthSrcTest.java b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraEncapEthSrcTest.java
new file mode 100644
index 0000000..f54f8b2
--- /dev/null
+++ b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraEncapEthSrcTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.driver.extensions;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import org.junit.Test;
+import org.onlab.packet.MacAddress;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for NiciraEncapEthSrcTest class.
+ */
+public class NiciraEncapEthSrcTest {
+
+ private final MacAddress mac1 = MacAddress.valueOf("fa:16:3e:11:00:01");
+ private final MacAddress mac2 = MacAddress.valueOf("fa:16:3e:22:00:02");
+
+ /**
+ * Checks the operation of equals() methods.
+ */
+ @Test
+ public void testEquals() {
+ final NiciraEncapEthDst encapEthDst1 = new NiciraEncapEthDst(mac1);
+ final NiciraEncapEthDst sameAsEncapEthDst1 = new NiciraEncapEthDst(mac1);
+ final NiciraEncapEthDst encapEthDst2 = new NiciraEncapEthDst(mac2);
+
+ new EqualsTester().addEqualityGroup(encapEthDst1, sameAsEncapEthDst1).addEqualityGroup(encapEthDst2)
+ .testEquals();
+ }
+
+ /**
+ * Checks the construction of a NiciraEncapEthSrcTest object.
+ */
+ @Test
+ public void testConstruction() {
+
+ final NiciraEncapEthDst encapEthDst1 = new NiciraEncapEthDst(mac1);
+ assertThat(encapEthDst1, is(notNullValue()));
+ assertThat(encapEthDst1.encapEthDst(), is(mac1));
+ }
+}
diff --git a/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraEncapEthTypeTest.java b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraEncapEthTypeTest.java
new file mode 100644
index 0000000..311c81c
--- /dev/null
+++ b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraEncapEthTypeTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.driver.extensions;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import org.junit.Test;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for NiciraEncapEthType class.
+ */
+public class NiciraEncapEthTypeTest {
+ final short ethType1 = (short) 0x894f;
+ final short ethType2 = (short) 0x800;
+
+ /**
+ * Checks the operation of equals() methods.
+ */
+ @Test
+ public void testEquals() {
+ final NiciraEncapEthType encapEthType1 = new NiciraEncapEthType(ethType1);
+ final NiciraEncapEthType sameAsEncapEthType1 = new NiciraEncapEthType(ethType1);
+ final NiciraEncapEthType encapEthType2 = new NiciraEncapEthType(ethType2);
+
+ new EqualsTester().addEqualityGroup(encapEthType1, sameAsEncapEthType1).addEqualityGroup(encapEthType2)
+ .testEquals();
+ }
+
+ /**
+ * Checks the construction of a NiciraEncapEthType object.
+ */
+ @Test
+ public void testConstruction() {
+ final NiciraEncapEthType encapEthType = new NiciraEncapEthType(ethType1);
+ assertThat(encapEthType, is(notNullValue()));
+ assertThat(encapEthType.encapEthType(), is(ethType1));
+ }
+}
diff --git a/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraMatchEncapEthTypeTest.java b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraMatchEncapEthTypeTest.java
new file mode 100644
index 0000000..b4b38f8
--- /dev/null
+++ b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraMatchEncapEthTypeTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.driver.extensions;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import org.junit.Test;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for NiciraMatchEncapEthType class.
+ */
+public class NiciraMatchEncapEthTypeTest {
+ final short ethType1 = (short) 0x894f;
+ final short ethType2 = (short) 0x800;
+
+ /**
+ * Checks the operation of equals() methods.
+ */
+ @Test
+ public void testEquals() {
+ final NiciraMatchEncapEthType encapEthType1 = new NiciraMatchEncapEthType(ethType1);
+ final NiciraMatchEncapEthType sameAsEncapEthType1 = new NiciraMatchEncapEthType(ethType1);
+ final NiciraMatchEncapEthType encapEthType2 = new NiciraMatchEncapEthType(ethType2);
+
+ new EqualsTester().addEqualityGroup(encapEthType1, sameAsEncapEthType1).addEqualityGroup(encapEthType2)
+ .testEquals();
+ }
+
+ /**
+ * Checks the construction of a NiciraMatchEncapEthType object.
+ */
+ @Test
+ public void testConstruction() {
+ final NiciraMatchEncapEthType encapEthType = new NiciraMatchEncapEthType(ethType1);
+ assertThat(encapEthType, is(notNullValue()));
+ assertThat(encapEthType.encapEthType(), is(ethType1));
+ }
+}
diff --git a/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraNshMdTypeTest.java b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraNshMdTypeTest.java
new file mode 100644
index 0000000..8c299bd
--- /dev/null
+++ b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraNshMdTypeTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.driver.extensions;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import org.junit.Test;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for NiciraNshMdType class.
+ */
+public class NiciraNshMdTypeTest {
+ final byte mdType1 = (byte) 1;
+ final byte mdType2 = (byte) 2;
+
+ /**
+ * Checks the operation of equals() methods.
+ */
+ @Test
+ public void testEquals() {
+ final NiciraNshMdType nshMdType1 = new NiciraNshMdType(mdType1);
+ final NiciraNshMdType sameAsnshMdType1 = new NiciraNshMdType(mdType1);
+ final NiciraNshMdType nshMdType2 = new NiciraNshMdType(mdType2);
+
+ new EqualsTester().addEqualityGroup(nshMdType1, sameAsnshMdType1).addEqualityGroup(nshMdType2)
+ .testEquals();
+ }
+
+ /**
+ * Checks the construction of a NiciraNshMdType object.
+ */
+ @Test
+ public void testConstruction() {
+ final NiciraNshMdType nshMdType = new NiciraNshMdType(mdType1);
+ assertThat(nshMdType, is(notNullValue()));
+ assertThat(nshMdType.nshMdType(), is(mdType1));
+ }
+}
diff --git a/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraNshNpTest.java b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraNshNpTest.java
new file mode 100644
index 0000000..17ed7ae
--- /dev/null
+++ b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraNshNpTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.driver.extensions;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import org.junit.Test;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for NiciraNshNp class.
+ */
+public class NiciraNshNpTest {
+ final byte np1 = (byte) 1;
+ final byte np2 = (byte) 4;
+
+ /**
+ * Checks the operation of equals() methods.
+ */
+ @Test
+ public void testEquals() {
+ final NiciraNshNp nshNp1 = new NiciraNshNp(np1);
+ final NiciraNshNp sameAsNshNp1 = new NiciraNshNp(np1);
+ final NiciraNshNp nshNp2 = new NiciraNshNp(np2);
+
+ new EqualsTester().addEqualityGroup(nshNp1, sameAsNshNp1).addEqualityGroup(nshNp2)
+ .testEquals();
+ }
+
+ /**
+ * Checks the construction of a NiciraNshNp object.
+ */
+ @Test
+ public void testConstruction() {
+ final NiciraNshNp nshNp1 = new NiciraNshNp(np1);
+ assertThat(nshNp1, is(notNullValue()));
+ assertThat(nshNp1.nshNp(), is(np1));
+ }
+}
diff --git a/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraTunGpeNpTest.java b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraTunGpeNpTest.java
new file mode 100644
index 0000000..259ebb5
--- /dev/null
+++ b/drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraTunGpeNpTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.driver.extensions;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import org.junit.Test;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for NiciraTunGpeNp class.
+ */
+public class NiciraTunGpeNpTest {
+ final byte np1 = (byte) 1;
+ final byte np2 = (byte) 2;
+
+ /**
+ * Checks the operation of equals() methods.
+ */
+ @Test
+ public void testEquals() {
+ final NiciraTunGpeNp tunGpeNp1 = new NiciraTunGpeNp(np1);
+ final NiciraTunGpeNp sameAsTunGpeNp1 = new NiciraTunGpeNp(np1);
+ final NiciraTunGpeNp tunGpeNp2 = new NiciraTunGpeNp(np2);
+
+ new EqualsTester().addEqualityGroup(tunGpeNp1, sameAsTunGpeNp1).addEqualityGroup(tunGpeNp2)
+ .testEquals();
+ }
+
+ /**
+ * Checks the construction of a NiciraTunGpeNp object.
+ */
+ @Test
+ public void testConstruction() {
+ final NiciraTunGpeNp tunGpeNp1 = new NiciraTunGpeNp(np1);
+ assertThat(tunGpeNp1, is(notNullValue()));
+ assertThat(tunGpeNp1.tunGpeNp(), is(np1));
+ }
+}