diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-07-03 15:16:11 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-13 08:56:08 +0900 |
commit | 1bf1652c08dde3368e098c2f28260cb24f4aa0f8 (patch) | |
tree | ae57764ac55db79bdd7cee417ae88ad156129eb9 /test/scenario_test/lib | |
parent | b759f2b1ca7176ea134b3a86d8bfea44509712dd (diff) |
server/table: support iBGP behavior
also added scenario_test
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/lib')
-rw-r--r-- | test/scenario_test/lib/gobgp.py | 2 | ||||
-rw-r--r-- | test/scenario_test/lib/quagga.py | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/test/scenario_test/lib/gobgp.py b/test/scenario_test/lib/gobgp.py index 11eeeb96..c56337cd 100644 --- a/test/scenario_test/lib/gobgp.py +++ b/test/scenario_test/lib/gobgp.py @@ -53,7 +53,7 @@ class GoBGPContainer(BGPContainer): def _get_as_path(self, path): asps = (p['as_paths'] for p in path['attrs'] if - p['type'] == BGP_ATTR_TYPE_AS_PATH) + p['type'] == BGP_ATTR_TYPE_AS_PATH and 'as_paths' in p) asps = chain.from_iterable(asps) asns = (asp['asns'] for asp in asps) return list(chain.from_iterable(asns)) diff --git a/test/scenario_test/lib/quagga.py b/test/scenario_test/lib/quagga.py index 75c2f61c..5141ff7d 100644 --- a/test/scenario_test/lib/quagga.py +++ b/test/scenario_test/lib/quagga.py @@ -68,9 +68,15 @@ class QuaggaBGPContainer(BGPContainer): tn.read_until(' Network Next Hop Metric ' 'LocPrf Weight Path') for line in tn.read_until('bgpd#').split('\n'): - if line[0] == '*': + if line[:2] == '*>': + line = line[2:] + ibgp = False + if line[0] == 'i': + line = line[1:] + ibgp = True elems = line.split() - rib.append({'prefix': elems[1], 'nexthop': elems[2]}) + rib.append({'prefix': elems[0], 'nexthop': elems[1], + 'ibgp': ibgp}) return rib @@ -181,7 +187,7 @@ class QuaggaBGPContainer(BGPContainer): c << 'debug bgp fsm' c << 'debug bgp updates' c << 'debug bgp events' - c << 'log file {0}/bgpd.log'.format(self.SHARED_VOLUME) + c << 'log file /tmp/bgpd.log'.format(self.SHARED_VOLUME) with open('{0}/bgpd.conf'.format(self.config_dir), 'w') as f: print colors.yellow('[{0}\'s new config]'.format(self.name)) |