From: Martin Winter Date: Wed, 1 Nov 2017 09:18:56 +0000 (-0700) Subject: ldp-vpls-topo1: Allow ospf neighbor json command with list (new) and dict (old) X-Git-Tag: frr-7.1-dev~151^2~201 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=3d6c6f01ac2cb7548fa3b4d96f98b4f8b66d3699;p=mirror%2Ffrr.git ldp-vpls-topo1: Allow ospf neighbor json command with list (new) and dict (old) Signed-off-by: Martin Winter --- diff --git a/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref b/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref index 2270c3fdde..7c4d0ab58c 100644 --- a/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref +++ b/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref @@ -1,14 +1,18 @@ { - "2.2.2.2":{ - "priority":1, - "state":"Full/DR", - "address":"10.0.1.2", - "ifaceName":"r1-eth1:10.0.1.1" - }, - "3.3.3.3":{ - "priority":1, - "state":"Full/DR", - "address":"10.0.2.3", - "ifaceName":"r1-eth2:10.0.2.1" - } + "2.2.2.2":[ + { + "priority":1, + "state":"Full/DR", + "address":"10.0.1.2", + "ifaceName":"r1-eth1:10.0.1.1" + } + ], + "3.3.3.3":[ + { + "priority":1, + "state":"Full/DR", + "address":"10.0.2.3", + "ifaceName":"r1-eth2:10.0.2.1" + } + ] } diff --git a/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref-old-nolist b/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref-old-nolist new file mode 100644 index 0000000000..2270c3fdde --- /dev/null +++ b/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref-old-nolist @@ -0,0 +1,14 @@ +{ + "2.2.2.2":{ + "priority":1, + "state":"Full/DR", + "address":"10.0.1.2", + "ifaceName":"r1-eth1:10.0.1.1" + }, + "3.3.3.3":{ + "priority":1, + "state":"Full/DR", + "address":"10.0.2.3", + "ifaceName":"r1-eth2:10.0.2.1" + } +} diff --git a/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref b/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref index 18ffbc2f8a..a982c1cbd3 100644 --- a/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref +++ b/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref @@ -1,14 +1,18 @@ { - "1.1.1.1":{ - "priority":1, - "state":"Full/Backup", - "address":"10.0.1.1", - "ifaceName":"r2-eth1:10.0.1.2" - }, - "3.3.3.3":{ - "priority":1, - "state":"Full/DR", - "address":"10.0.3.3", - "ifaceName":"r2-eth2:10.0.3.2" - } + "1.1.1.1":[ + { + "priority":1, + "state":"Full/Backup", + "address":"10.0.1.1", + "ifaceName":"r2-eth1:10.0.1.2" + } + ], + "3.3.3.3":[ + { + "priority":1, + "state":"Full/DR", + "address":"10.0.3.3", + "ifaceName":"r2-eth2:10.0.3.2" + } + ] } diff --git a/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref-old-nolist b/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref-old-nolist new file mode 100644 index 0000000000..18ffbc2f8a --- /dev/null +++ b/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref-old-nolist @@ -0,0 +1,14 @@ +{ + "1.1.1.1":{ + "priority":1, + "state":"Full/Backup", + "address":"10.0.1.1", + "ifaceName":"r2-eth1:10.0.1.2" + }, + "3.3.3.3":{ + "priority":1, + "state":"Full/DR", + "address":"10.0.3.3", + "ifaceName":"r2-eth2:10.0.3.2" + } +} diff --git a/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref b/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref index b0669742ab..d7e0e42405 100644 --- a/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref +++ b/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref @@ -1,14 +1,18 @@ { - "1.1.1.1":{ - "priority":1, - "state":"Full/Backup", - "address":"10.0.2.1", - "ifaceName":"r3-eth1:10.0.2.3" - }, - "2.2.2.2":{ - "priority":1, - "state":"Full/Backup", - "address":"10.0.3.2", - "ifaceName":"r3-eth2:10.0.3.3" - } + "1.1.1.1":[ + { + "priority":1, + "state":"Full/Backup", + "address":"10.0.2.1", + "ifaceName":"r3-eth1:10.0.2.3" + } + ], + "2.2.2.2":[ + { + "priority":1, + "state":"Full/Backup", + "address":"10.0.3.2", + "ifaceName":"r3-eth2:10.0.3.3" + } + ] } diff --git a/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref-old-nolist b/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref-old-nolist new file mode 100644 index 0000000000..b0669742ab --- /dev/null +++ b/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref-old-nolist @@ -0,0 +1,14 @@ +{ + "1.1.1.1":{ + "priority":1, + "state":"Full/Backup", + "address":"10.0.2.1", + "ifaceName":"r3-eth1:10.0.2.3" + }, + "2.2.2.2":{ + "priority":1, + "state":"Full/Backup", + "address":"10.0.3.2", + "ifaceName":"r3-eth2:10.0.3.3" + } +} diff --git a/tests/topotests/ldp-vpls-topo1/test_ldp_vpls_topo1.py b/tests/topotests/ldp-vpls-topo1/test_ldp_vpls_topo1.py index f96f0fd7d0..1218a6ca72 100755 --- a/tests/topotests/ldp-vpls-topo1/test_ldp_vpls_topo1.py +++ b/tests/topotests/ldp-vpls-topo1/test_ldp_vpls_topo1.py @@ -180,8 +180,19 @@ def test_ospf_convergence(): if tgen.routers_have_failure(): pytest.skip(tgen.errors) + # Old output (before FRR PR1383) didn't show a list of neighbors. + # Check for dict object and compare to old output if this is the case + tgen = get_topogen() + router = tgen.gears['r1'] + output = router.vtysh_cmd("show ip ospf neighbor json", isjson=True) + + if isinstance(output["2.2.2.2"], dict): + reffile = "show_ip_ospf_neighbor.ref-old-nolist" + else: + reffile = "show_ip_ospf_neighbor.ref" + for rname in ['r1', 'r2', 'r3']: - router_compare_json_output(rname, "show ip ospf neighbor json", "show_ip_ospf_neighbor.ref") + router_compare_json_output(rname, "show ip ospf neighbor json", reffile) def test_rib(): logger.info("Test: verify RIB")