summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2016-08-22 17:21:25 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-08-25 13:32:48 +0900
commitc51c46b584eee1db6d2152aacbfa9e9a17a7e13b (patch)
treea7ff57b48fcc1603fbd619623b195189834f0e32
parentc4dac34bad59dd90a2dad63b22cb5631a1fefa5e (diff)
test_bgp: Add unit tests for Ethernet VPN
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/tests/packet_data/bgp4/evpn_esi_arbitrary.pcapbin0 -> 156 bytes
-rw-r--r--ryu/tests/packet_data/bgp4/evpn_esi_as_based.pcapbin0 -> 156 bytes
-rw-r--r--ryu/tests/packet_data/bgp4/evpn_esi_l2_bridge.pcapbin0 -> 156 bytes
-rw-r--r--ryu/tests/packet_data/bgp4/evpn_esi_lacp.pcapbin0 -> 156 bytes
-rw-r--r--ryu/tests/packet_data/bgp4/evpn_esi_mac_base.pcapbin0 -> 156 bytes
-rw-r--r--ryu/tests/packet_data/bgp4/evpn_esi_router_id.pcapbin0 -> 156 bytes
-rw-r--r--ryu/tests/packet_data/bgp4/evpn_nlri_eth_a-d.pcapbin0 -> 156 bytes
-rw-r--r--ryu/tests/packet_data/bgp4/evpn_nlri_eth_seg.pcapbin0 -> 154 bytes
-rw-r--r--ryu/tests/packet_data/bgp4/evpn_nlri_inc_multi_eth_tag.pcapbin0 -> 148 bytes
-rw-r--r--ryu/tests/packet_data/bgp4/evpn_nlri_mac_ip_ad.pcapbin0 -> 168 bytes
-rw-r--r--ryu/tests/unit/packet/test_bgp.py26
11 files changed, 24 insertions, 2 deletions
diff --git a/ryu/tests/packet_data/bgp4/evpn_esi_arbitrary.pcap b/ryu/tests/packet_data/bgp4/evpn_esi_arbitrary.pcap
new file mode 100644
index 00000000..490ee839
--- /dev/null
+++ b/ryu/tests/packet_data/bgp4/evpn_esi_arbitrary.pcap
Binary files differ
diff --git a/ryu/tests/packet_data/bgp4/evpn_esi_as_based.pcap b/ryu/tests/packet_data/bgp4/evpn_esi_as_based.pcap
new file mode 100644
index 00000000..d17183a7
--- /dev/null
+++ b/ryu/tests/packet_data/bgp4/evpn_esi_as_based.pcap
Binary files differ
diff --git a/ryu/tests/packet_data/bgp4/evpn_esi_l2_bridge.pcap b/ryu/tests/packet_data/bgp4/evpn_esi_l2_bridge.pcap
new file mode 100644
index 00000000..0f8d3f95
--- /dev/null
+++ b/ryu/tests/packet_data/bgp4/evpn_esi_l2_bridge.pcap
Binary files differ
diff --git a/ryu/tests/packet_data/bgp4/evpn_esi_lacp.pcap b/ryu/tests/packet_data/bgp4/evpn_esi_lacp.pcap
new file mode 100644
index 00000000..833109b5
--- /dev/null
+++ b/ryu/tests/packet_data/bgp4/evpn_esi_lacp.pcap
Binary files differ
diff --git a/ryu/tests/packet_data/bgp4/evpn_esi_mac_base.pcap b/ryu/tests/packet_data/bgp4/evpn_esi_mac_base.pcap
new file mode 100644
index 00000000..3b6fa798
--- /dev/null
+++ b/ryu/tests/packet_data/bgp4/evpn_esi_mac_base.pcap
Binary files differ
diff --git a/ryu/tests/packet_data/bgp4/evpn_esi_router_id.pcap b/ryu/tests/packet_data/bgp4/evpn_esi_router_id.pcap
new file mode 100644
index 00000000..b69ce620
--- /dev/null
+++ b/ryu/tests/packet_data/bgp4/evpn_esi_router_id.pcap
Binary files differ
diff --git a/ryu/tests/packet_data/bgp4/evpn_nlri_eth_a-d.pcap b/ryu/tests/packet_data/bgp4/evpn_nlri_eth_a-d.pcap
new file mode 100644
index 00000000..434c898a
--- /dev/null
+++ b/ryu/tests/packet_data/bgp4/evpn_nlri_eth_a-d.pcap
Binary files differ
diff --git a/ryu/tests/packet_data/bgp4/evpn_nlri_eth_seg.pcap b/ryu/tests/packet_data/bgp4/evpn_nlri_eth_seg.pcap
new file mode 100644
index 00000000..a99804b3
--- /dev/null
+++ b/ryu/tests/packet_data/bgp4/evpn_nlri_eth_seg.pcap
Binary files differ
diff --git a/ryu/tests/packet_data/bgp4/evpn_nlri_inc_multi_eth_tag.pcap b/ryu/tests/packet_data/bgp4/evpn_nlri_inc_multi_eth_tag.pcap
new file mode 100644
index 00000000..293722db
--- /dev/null
+++ b/ryu/tests/packet_data/bgp4/evpn_nlri_inc_multi_eth_tag.pcap
Binary files differ
diff --git a/ryu/tests/packet_data/bgp4/evpn_nlri_mac_ip_ad.pcap b/ryu/tests/packet_data/bgp4/evpn_nlri_mac_ip_ad.pcap
new file mode 100644
index 00000000..f9152e80
--- /dev/null
+++ b/ryu/tests/packet_data/bgp4/evpn_nlri_mac_ip_ad.pcap
Binary files differ
diff --git a/ryu/tests/unit/packet/test_bgp.py b/ryu/tests/unit/packet/test_bgp.py
index d23b2592..a8900a5f 100644
--- a/ryu/tests/unit/packet/test_bgp.py
+++ b/ryu/tests/unit/packet/test_bgp.py
@@ -115,7 +115,13 @@ class Test_bgp(unittest.TestCase):
bgp.BGPIPv4AddressSpecificExtendedCommunity(
subtype=3, ipv4_address='192.0.2.1',
local_administrator=65432),
- bgp.BGPOpaqueExtendedCommunity(opaque=b'abcdefg'),
+ bgp.BGPOpaqueExtendedCommunity(subtype=13, opaque=b'abcdef'),
+ bgp.BGPEvpnMacMobilityExtendedCommunity(
+ subtype=0, flags=0xff, sequence_number=0x11223344),
+ bgp.BGPEvpnEsiLabelExtendedCommunity(
+ subtype=1, flags=0xff, esi_label=0x112233),
+ bgp.BGPEvpnEsImportRTExtendedCommunity(
+ subtype=2, es_import="aa:bb:cc:dd:ee:ff"),
bgp.BGPUnknownExtendedCommunity(type_=99, value=b'abcdefg'),
]
path_attributes = [
@@ -206,6 +212,16 @@ class Test_bgp(unittest.TestCase):
# 2. quagga always uses EXTENDED for AS_PATH
# 'bgp4-update',
'bgp4-keepalive',
+ 'evpn_esi_arbitrary',
+ 'evpn_esi_lacp',
+ 'evpn_esi_l2_bridge',
+ 'evpn_esi_mac_base',
+ 'evpn_esi_router_id',
+ 'evpn_esi_as_based',
+ 'evpn_nlri_eth_a-d',
+ 'evpn_nlri_mac_ip_ad',
+ 'evpn_nlri_inc_multi_eth_tag',
+ 'evpn_nlri_eth_seg',
]
for f in files:
@@ -263,7 +279,13 @@ class Test_bgp(unittest.TestCase):
bgp.BGPIPv4AddressSpecificExtendedCommunity(
subtype=3, ipv4_address='192.0.2.1',
local_administrator=65432),
- bgp.BGPOpaqueExtendedCommunity(opaque=b'abcdefg'),
+ bgp.BGPOpaqueExtendedCommunity(subtype=13, opaque=b'abcdef'),
+ bgp.BGPEvpnMacMobilityExtendedCommunity(
+ subtype=0, flags=0xff, sequence_number=0x11223344),
+ bgp.BGPEvpnEsiLabelExtendedCommunity(
+ subtype=1, flags=0xff, esi_label=0x112233),
+ bgp.BGPEvpnEsImportRTExtendedCommunity(
+ subtype=2, es_import="aa:bb:cc:dd:ee:ff"),
bgp.BGPUnknownExtendedCommunity(type_=99, value=b'abcdefg'),
]
path_attributes = [