From 1bf1652c08dde3368e098c2f28260cb24f4aa0f8 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Fri, 3 Jul 2015 15:16:11 +0900 Subject: server/table: support iBGP behavior also added scenario_test Signed-off-by: ISHIDA Wataru --- test/scenario_test/lib/gobgp.py | 2 +- test/scenario_test/lib/quagga.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'test/scenario_test/lib') 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)) -- cgit v1.2.3