diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-07-28 10:09:19 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-07-30 15:18:35 +0900 |
commit | c355eb13682c7e1f6339094fdd51017eee9cb929 (patch) | |
tree | 74641fc8d712c1e03ff3612e43c595f939d6dd6f /test | |
parent | 5d78e89e5e84eb164e035b8af390503ea2986722 (diff) |
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 <iwase.yusuke0@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/gobgp.py | 6 |
1 files changed, 6 insertions, 0 deletions
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 '\ |