]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: example using new "jsoncmp_pass" command
authorDavid Schweizer <dschweizer@opensourcerouting.org>
Mon, 22 Feb 2021 09:49:36 +0000 (10:49 +0100)
committerDavid Schweizer <dschweizer@opensourcerouting.org>
Mon, 22 Feb 2021 09:49:36 +0000 (10:49 +0100)
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py

index d55169a19efceed85c8edf7f38a4b7ba0289c5f5..c8c03025c28c7681932cf2dd086cbc6f578f36ed 100644 (file)
@@ -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",
 )