summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp')
-rw-r--r--framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrNodeFlagBitTlvTest.java51
-rw-r--r--framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrRouterIdV6Test.java50
-rw-r--r--framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrMaxLinkBandwidthTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrIgpMetricTest.java)22
-rw-r--r--framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrProtectionTypeTest.java57
-rw-r--r--[-rwxr-xr-x]framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrTeDefaultMetricTest.java (renamed from framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/NextHopTest.java)27
-rw-r--r--framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOpaqueDataTest.java42
-rw-r--r--framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOspfFwdAddrTest.java52
7 files changed, 67 insertions, 234 deletions
diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrNodeFlagBitTlvTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrNodeFlagBitTlvTest.java
deleted file mode 100644
index 5f1411ff..00000000
--- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrNodeFlagBitTlvTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2015 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.bgp;
-
-import org.junit.Test;
-import org.onosproject.bgpio.types.attr.BgpAttrNodeFlagBitTlv;
-
-import com.google.common.testing.EqualsTester;
-
-/**
- * Test for BGP attribute node flag.
- */
-public class BgpAttrNodeFlagBitTlvTest {
-
- private final boolean bOverloadBit = true;
- private final boolean bAttachedBit = true;
- private final boolean bExternalBit = true;
- private final boolean bABRBit = true;
-
- private final boolean bOverloadBit1 = false;
- private final boolean bAttachedBit1 = false;
- private final boolean bExternalBit1 = false;
- private final boolean bABRBit1 = false;
-
- private final BgpAttrNodeFlagBitTlv data = BgpAttrNodeFlagBitTlv
- .of(bOverloadBit, bAttachedBit, bExternalBit, bABRBit);
- private final BgpAttrNodeFlagBitTlv sameAsData = BgpAttrNodeFlagBitTlv
- .of(bOverloadBit, bAttachedBit, bExternalBit, bABRBit);
- private final BgpAttrNodeFlagBitTlv diffData = BgpAttrNodeFlagBitTlv
- .of(bOverloadBit1, bAttachedBit1, bExternalBit1, bABRBit1);
-
- @Test
- public void basics() {
-
- new EqualsTester().addEqualityGroup(data, sameAsData)
- .addEqualityGroup(diffData).testEquals();
- }
-} \ No newline at end of file
diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrRouterIdV6Test.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrRouterIdV6Test.java
deleted file mode 100644
index 72ca5dbf..00000000
--- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpAttrRouterIdV6Test.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2015 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.bgp;
-
-import org.junit.Test;
-import org.onlab.packet.Ip6Address;
-import org.onosproject.bgpio.types.attr.BgpAttrRouterIdV6;
-
-import com.google.common.testing.EqualsTester;
-
-/**
- * Test for BGP attribute node router ID.
- */
-public class BgpAttrRouterIdV6Test {
-
- private final short sType = 1;
- private final Ip6Address ip6RouterId = Ip6Address
- .valueOf("2001:0db8:0a0b:12f0:0000:0000:0000:0001");
-
- private final short sType1 = 2;
- private final Ip6Address ip6RouterId1 = Ip6Address
- .valueOf("2004:0db8:0a0b:12f0:0000:0000:0000:0004");
-
- private final BgpAttrRouterIdV6 data = BgpAttrRouterIdV6.of(ip6RouterId,
- sType);
- private final BgpAttrRouterIdV6 sameAsData = BgpAttrRouterIdV6
- .of(ip6RouterId, sType);
- private final BgpAttrRouterIdV6 diffData = BgpAttrRouterIdV6
- .of(ip6RouterId1, sType1);
-
- @Test
- public void basics() {
-
- new EqualsTester().addEqualityGroup(data, sameAsData)
- .addEqualityGroup(diffData).testEquals();
- }
-} \ No newline at end of file
diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrIgpMetricTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrMaxLinkBandwidthTest.java
index 32280a79..d4c3b610 100644
--- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrIgpMetricTest.java
+++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrMaxLinkBandwidthTest.java
@@ -16,24 +16,24 @@
package org.onosproject.bgp;
import org.junit.Test;
-import org.onosproject.bgpio.types.attr.BgpLinkAttrIgpMetric;
+import org.onosproject.bgpio.types.attr.BgpLinkAttrMaxLinkBandwidth;
import com.google.common.testing.EqualsTester;
/**
- * Test for BGP link IGP metric attribute.
+ * Test for BGP link max bandwidth attribute.
*/
-public class BgpLinkAttrIgpMetricTest {
- private final int val = 0x010203;
- private final int valLen = 3;
- private final int val1 = 0x01020304;
- private final int val1Len = 4;
+public class BgpLinkAttrMaxLinkBandwidthTest {
+ private final float val = 0x010203;
+ private final short valLen = 3;
+ private final float val1 = 0x01020304;
+ private final short val1Len = 4;
- private final BgpLinkAttrIgpMetric data = BgpLinkAttrIgpMetric.of(val,
- valLen);
- private final BgpLinkAttrIgpMetric sameAsData = BgpLinkAttrIgpMetric
+ private final BgpLinkAttrMaxLinkBandwidth data = BgpLinkAttrMaxLinkBandwidth
.of(val, valLen);
- private final BgpLinkAttrIgpMetric diffData = BgpLinkAttrIgpMetric
+ private final BgpLinkAttrMaxLinkBandwidth sameAsData = BgpLinkAttrMaxLinkBandwidth
+ .of(val, valLen);
+ private final BgpLinkAttrMaxLinkBandwidth diffData = BgpLinkAttrMaxLinkBandwidth
.of(val1, val1Len);
@Test
diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrProtectionTypeTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrProtectionTypeTest.java
deleted file mode 100644
index 89f97a83..00000000
--- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrProtectionTypeTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2015 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.bgp;
-
-import org.junit.Test;
-import org.onosproject.bgpio.types.attr.BgpLinkAttrProtectionType;
-
-import com.google.common.testing.EqualsTester;
-
-/**
- * Test for MPLS protocol mask attribute.
- */
-public class BgpLinkAttrProtectionTypeTest {
- boolean bExtraTraffic = true;
- boolean bUnprotected = true;
- boolean bShared = true;
- boolean bDedOneIstoOne = true;
- boolean bDedOnePlusOne = true;
- boolean bEnhanced = true;
-
- boolean bExtraTraffic1 = false;
- boolean bUnprotected1 = false;
- boolean bShared1 = false;
- boolean bDedOneIstoOne1 = false;
- boolean bDedOnePlusOne1 = false;
- boolean bEnhanced1 = false;
-
- private final BgpLinkAttrProtectionType data = BgpLinkAttrProtectionType
- .of(bExtraTraffic, bUnprotected, bShared, bDedOneIstoOne,
- bDedOnePlusOne, bEnhanced);
- private final BgpLinkAttrProtectionType sameAsData = BgpLinkAttrProtectionType
- .of(bExtraTraffic, bUnprotected, bShared, bDedOneIstoOne,
- bDedOnePlusOne, bEnhanced);
- private final BgpLinkAttrProtectionType diffData = BgpLinkAttrProtectionType
- .of(bExtraTraffic1, bUnprotected1, bShared1, bDedOneIstoOne1,
- bDedOnePlusOne1, bEnhanced1);
-
- @Test
- public void basics() {
-
- new EqualsTester().addEqualityGroup(data, sameAsData)
- .addEqualityGroup(diffData).testEquals();
- }
-} \ No newline at end of file
diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/NextHopTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrTeDefaultMetricTest.java
index 109197bb..b6453c45 100755..100644
--- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/NextHopTest.java
+++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpLinkAttrTeDefaultMetricTest.java
@@ -16,26 +16,27 @@
package org.onosproject.bgp;
import org.junit.Test;
-import org.onlab.packet.Ip4Address;
-import org.onosproject.bgpio.types.NextHop;
+import org.onosproject.bgpio.types.attr.BgpLinkAttrTeDefaultMetric;
import com.google.common.testing.EqualsTester;
/**
- * Test for NextHop BGP Path Attribute.
+ * Test for BGP link TE default metric attribute.
*/
-public class NextHopTest {
- private final Ip4Address value1 = Ip4Address.valueOf("12.12.12.12");
- private final Ip4Address value2 = Ip4Address.valueOf("12.12.12.13");
- private final NextHop attr1 = new NextHop(value1);
- private final NextHop sameAsAttr1 = new NextHop(value1);
- private final NextHop attr2 = new NextHop(value2);
+public class BgpLinkAttrTeDefaultMetricTest {
+ private final int val = 0x010203;
+ private final int val1 = 0x01020304;
+
+ private final BgpLinkAttrTeDefaultMetric data = BgpLinkAttrTeDefaultMetric
+ .of(val);
+ private final BgpLinkAttrTeDefaultMetric sameAsData = BgpLinkAttrTeDefaultMetric
+ .of(val);
+ private final BgpLinkAttrTeDefaultMetric diffData = BgpLinkAttrTeDefaultMetric
+ .of(val1);
@Test
public void basics() {
- new EqualsTester()
- .addEqualityGroup(attr1, sameAsAttr1)
- .addEqualityGroup(attr2)
- .testEquals();
+ new EqualsTester().addEqualityGroup(data, sameAsData)
+ .addEqualityGroup(diffData).testEquals();
}
} \ No newline at end of file
diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOpaqueDataTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOpaqueDataTest.java
new file mode 100644
index 00000000..7ba6a880
--- /dev/null
+++ b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOpaqueDataTest.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2015 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.bgp;
+
+import org.junit.Test;
+import org.onosproject.bgpio.types.attr.BgpPrefixAttrOpaqueData;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test for prefix attribute opaque data Tlv.
+ */
+public class BgpPrefixAttrOpaqueDataTest {
+ private final byte[] array = new byte[] {0x01, 0x02, 0x03, 0x04};
+ private final byte[] array1 = new byte[] {0x01, 0x02, 0x03, 0x01};
+
+ private final BgpPrefixAttrOpaqueData isisData = BgpPrefixAttrOpaqueData
+ .of(array);
+ private final BgpPrefixAttrOpaqueData sameAsIsisData = BgpPrefixAttrOpaqueData
+ .of(array);
+ private final BgpPrefixAttrOpaqueData isisDiff = BgpPrefixAttrOpaqueData
+ .of(array1);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(isisData, sameAsIsisData)
+ .addEqualityGroup(isisDiff).testEquals();
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOspfFwdAddrTest.java b/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOspfFwdAddrTest.java
deleted file mode 100644
index f736bead..00000000
--- a/framework/src/onos/bgp/bgpio/src/test/java/org/onosproject/bgp/BgpPrefixAttrOspfFwdAddrTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2015 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.bgp;
-
-import org.junit.Test;
-import org.onlab.packet.Ip4Address;
-import org.onlab.packet.Ip6Address;
-import org.onosproject.bgpio.types.attr.BgpPrefixAttrOspfFwdAddr;
-
-import com.google.common.testing.EqualsTester;
-
-/**
- * Test for BGP prefix metric attribute.
- */
-public class BgpPrefixAttrOspfFwdAddrTest {
-
- private final short lsAttrLength = 4;
- private final Ip4Address ip4RouterId = Ip4Address.valueOf("192.168.1.1");
- private final Ip6Address ip6RouterId = Ip6Address
- .valueOf("2001:0db8:0a0b:12f0:0000:0000:0000:0001");
-
- private final short lsAttrLength1 = 16;
- private final Ip4Address ip4RouterId1 = Ip4Address.valueOf("192.168.1.2");
- private final Ip6Address ip6RouterId1 = Ip6Address
- .valueOf("1002:0db8:0a0b:12f0:0000:0000:0000:0002");
-
- private final BgpPrefixAttrOspfFwdAddr data = BgpPrefixAttrOspfFwdAddr
- .of(lsAttrLength, ip4RouterId, ip6RouterId);
- private final BgpPrefixAttrOspfFwdAddr sameAsData = BgpPrefixAttrOspfFwdAddr
- .of(lsAttrLength, ip4RouterId, ip6RouterId);
- private final BgpPrefixAttrOspfFwdAddr diffData = BgpPrefixAttrOspfFwdAddr
- .of(lsAttrLength1, ip4RouterId1, ip6RouterId1);
-
- @Test
- public void basics() {
- new EqualsTester().addEqualityGroup(data, sameAsData)
- .addEqualityGroup(diffData).testEquals();
- }
-} \ No newline at end of file