diff options
Diffstat (limited to 'test/scenario_test/quagga_access.py')
-rw-r--r-- | test/scenario_test/quagga_access.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/scenario_test/quagga_access.py b/test/scenario_test/quagga_access.py index df2eb938..1e51afaf 100644 --- a/test/scenario_test/quagga_access.py +++ b/test/scenario_test/quagga_access.py @@ -82,7 +82,13 @@ def show_rib(tn): tn.write("show ip bgp\n") tn.read_until(" Network Next Hop Metric LocPrf Weight Path") rib = tn.read_until("bgpd#") - # print header + return rib_parser(rib) + + +def show_ipv6_rib(tn): + tn.write("show bgp ipv6\n") + tn.read_until(" Network Next Hop Metric LocPrf Weight Path") + rib = tn.read_until("bgpd#") return rib_parser(rib) @@ -90,6 +96,7 @@ def clear_ip_bgp(tn): tn.write("clear ip bgp *\n") tn.read_until("bgpd#") + def rib_parser(rib): lines = rib.split("\n") paths = [] @@ -99,10 +106,6 @@ def rib_parser(rib): elems = line.split() path['Network'] = elems[1] path['Next Hop'] = elems[2] - # path['Metric'] = elems[3] - # path['LocPrf'] = elems[4] - # path['Weight'] = elems[5] - # path['Path'] = elems[6] if len(path) > 0: paths.append(path) return paths |