From 2e79d5abc91a6ec9f719f5c73abee77215e433ef Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 11 Nov 2013 14:43:23 +0900 Subject: [PATCH] bgp: add tests for extended communities Signed-off-by: YAMAMOTO Takashi Signed-off-by: FUJITA Tomonori --- ryu/tests/unit/packet/test_bgp.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ryu/tests/unit/packet/test_bgp.py b/ryu/tests/unit/packet/test_bgp.py index e2ffc0ba..fafa23f7 100644 --- a/ryu/tests/unit/packet/test_bgp.py +++ b/ryu/tests/unit/packet/test_bgp.py @@ -85,6 +85,23 @@ class Test_bgp(unittest.TestCase): bgp.BGP_COMMUNITY_NO_EXPORT, bgp.BGP_COMMUNITY_NO_ADVERTISE, ] + ecommunities = [ + bgp.BGPTwoOctetAsSpecificExtendedCommunity(subtype=1, + as_number=65500, + local_administrator= + 3908876543), + bgp.BGPFourOctetAsSpecificExtendedCommunity(subtype=2, + as_number=10000000, + local_administrator= + 59876), + bgp.BGPIPv4AddressSpecificExtendedCommunity(subtype=3, + ipv4_address= + '192.0.2.1', + local_administrator= + 65432), + bgp.BGPOpaqueExtendedCommunity(opaque='abcdefg'), + bgp.BGPUnknownExtendedCommunity(type_=99, value='abcdefg'), + ] path_attributes = [ bgp.BGPPathAttributeOrigin(value=1), bgp.BGPPathAttributeAsPath(value=[[1000], set([1001, 1002]), @@ -96,6 +113,7 @@ class Test_bgp(unittest.TestCase): bgp.BGPPathAttributeAggregator(as_number=40000, addr='192.0.2.99'), bgp.BGPPathAttributeCommunities(communities=communities), + bgp.BGPPathAttributeExtendedCommunities(communities=ecommunities), bgp.BGPPathAttributeAs4Path(value=[[1000000], set([1000001, 1002]), [1003, 1000004]]), bgp.BGPPathAttributeAs4Aggregator(as_number=100040000,