From c355eb13682c7e1f6339094fdd51017eee9cb929 Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Fri, 28 Jul 2017 10:09:19 +0900 Subject: test/lib/gobgp: Add route with identifier and community This patch enables GoBGPContainer to add routes with "identifier" and "community" via add_route() method. Signed-off-by: IWASE Yusuke --- test/lib/gobgp.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/lib') diff --git a/test/lib/gobgp.py b/test/lib/gobgp.py index b4beef73..ce4fe2a7 100644 --- a/test/lib/gobgp.py +++ b/test/lib/gobgp.py @@ -505,12 +505,18 @@ class GoBGPContainer(BGPContainer): r = CmdBuffer(' ') r << 'gobgp global -a {0}'.format(v['rf']) r << 'rib add {0}'.format(v['prefix']) + if v['identifier']: + r << 'identifier {0}'.format(v['identifier']) if v['next-hop']: r << 'nexthop {0}'.format(v['next-hop']) if v['local-pref']: r << 'local-pref {0}'.format(v['local-pref']) if v['med']: r << 'med {0}'.format(v['med']) + if v['community']: + r << 'community {0}'.format( + ','.join(v['community']) + if isinstance(v['community'], (list, tuple)) else v['community']) cmd = str(r) elif v['rf'] == 'ipv4-flowspec' or v['rf'] == 'ipv6-flowspec': cmd = 'gobgp global '\ -- cgit v1.2.3