summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schweizer <dschweizer@opensourcerouting.org>2021-02-22 10:49:36 +0100
committerDavid Schweizer <dschweizer@opensourcerouting.org>2021-02-22 10:49:36 +0100
commit92cf76677bb408a0b0a7bf0db16f88a0793454e2 (patch)
tree1e7562c44723ff8253c1591dc7d47e6cb5dd1488
parent4e3828b7710f48c49597a70cef860d544c90348d (diff)
tests: example using new "jsoncmp_pass" command
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
-rw-r--r--tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py
index d55169a19e..c8c03025c2 100644
--- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py
+++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py
@@ -551,14 +551,23 @@ luCommand(
)
luCommand(
"ce4",
- 'vtysh -c "show bgp vrf ce4-cust2 ipv4 6.0.1.0"',
- "2 available, best .*192.168.2.1.* Local.* 192.168.2.1 from 192.168.2.1 .192.168.2.1"
- + ".* Origin IGP, metric 98, localpref 123, valid, internal"
- + ".* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:56"
- + ".* Local.* 99.0.0.4 from 0.0.0.0 .99.0.0.4"
- + ".* Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best .Weight"
- + ".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:56",
- "pass",
+ 'vtysh -c "show bgp vrf ce4-cust2 ipv4 6.0.1.0 json"',
+ (
+ '{"paths":['
+ + '{"aspath":{"string":"Local"},"origin":"IGP","metric":200,"locPrf":50,'
+ + '"weight":32768,"valid":true,"sourced":true,"local":true,'
+ + '"bestpath":{"overall":true,"selectionReason":"Weight"},'
+ + '"community":{"string":"0:67"},"extendedCommunity":{"string":"RT:89:123"},'
+ + '"largeCommunity":{"string":"12:34:56"},'
+ + '"peer":{"peerId":"0.0.0.0","routerId":"99.0.0.4"}},'
+ + '{"aspath":{"string":"Local"},"origin":"IGP","metric":98,"locPrf":123,'
+ + '"valid":true,'
+ + '"community":{"string":"0:67"},"extendedCommunity":{'
+ + '"string":"RT:52:100 RT:89:123"},"largeCommunity":{"string":"12:34:56"},'
+ + '"peer":{"peerId":"192.168.2.1","routerId":"192.168.2.1"}}'
+ + "]}"
+ ),
+ "jsoncmp_pass",
"Redundant route 1 details",
)