diff options
| author | Lou Berger <lberger@labn.net> | 2018-06-02 15:06:47 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-11-27 20:22:14 -0500 |
| commit | 6c700097d66fe8b9f529a23e8d986cf2c7a0f6c7 (patch) | |
| tree | 8d04b06796a02dfc94648166c0eb7e9cbd12f071 | |
| parent | b0f0d980b5bbee764b5c7fe89ce9642ef4239c30 (diff) | |
lib: bgprib - get human readable verson of json commands for log
Signed-off-by: Lou Berger <lberger@labn.net>
| -rw-r--r-- | tests/topotests/lib/bgprib.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/topotests/lib/bgprib.py b/tests/topotests/lib/bgprib.py index de1a1846f4..0a00b5e5a6 100644 --- a/tests/topotests/lib/bgprib.py +++ b/tests/topotests/lib/bgprib.py @@ -71,7 +71,9 @@ class BgpRib: def RequireVpnRoutes(self, target, title, wantroutes, debug=0): import json - ret = luCommand(target,'vtysh -c "show bgp ipv4 vpn json"','.*','None','Get VPN RIB') + #non json form for humans + luCommand(target,'vtysh -c "show bgp ipv4 vpn"','.','None','Get VPN RIB (non-json)') + ret = luCommand(target,'vtysh -c "show bgp ipv4 vpn json"','.*','None','Get VPN RIB (json)') if re.search(r'^\s*$', ret): # degenerate case: empty json means no routes if len(wantroutes) > 0: @@ -107,9 +109,12 @@ class BgpRib: if (afi != 'ipv4') and (afi != 'ipv6'): print "ERROR invalid afi"; - str = 'show bgp %s %s unicast json' % (vrfstr, afi) + str = 'show bgp %s %s unicast' % (vrfstr, afi) + #non json form for humans cmd = 'vtysh -c "%s"' % str - ret = luCommand(target,cmd,'.*','None','Get %s %s RIB' % (vrfstr, afi)) + luCommand(target,cmd,'.','None','Get %s %s RIB (non-json)' % (vrfstr, afi)) + cmd = 'vtysh -c "%s json"' % str + ret = luCommand(target,cmd,'.*','None','Get %s %s RIB (json)' % (vrfstr, afi)) if re.search(r'^\s*$', ret): # degenerate case: empty json means no routes if len(wantroutes) > 0: |
