]> git.proxmox.com Git - mirror_frr.git/commitdiff
ldp-vpls-topo1: Allow ospf neighbor json command with list (new) and dict (old)
authorMartin Winter <mwinter@opensourcerouting.org>
Wed, 1 Nov 2017 09:18:56 +0000 (02:18 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:12 +0000 (20:22 -0500)
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref
tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref-old-nolist [new file with mode: 0644]
tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref
tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref-old-nolist [new file with mode: 0644]
tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref
tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref-old-nolist [new file with mode: 0644]
tests/topotests/ldp-vpls-topo1/test_ldp_vpls_topo1.py

index 2270c3fddef904d3d15bf6e7bfb5ed3a397908d2..7c4d0ab58ccb3f2fbccf8cd552146aeb4e7eb276 100644 (file)
@@ -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 (file)
index 0000000..2270c3f
--- /dev/null
@@ -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"
+  }
+}
index 18ffbc2f8aa6dd1671b0a9c5a62a0459b2938cc8..a982c1cbd35e7590f4acafd477e2c6e5a9d7a084 100644 (file)
@@ -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 (file)
index 0000000..18ffbc2
--- /dev/null
@@ -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"
+  }
+}
index b0669742abcf9afb8a5b976acefa151d53a108b9..d7e0e424053129e937f5863c01c2f5cdd421284d 100644 (file)
@@ -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 (file)
index 0000000..b066974
--- /dev/null
@@ -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"
+  }
+}
index f96f0fd7d03f510cbbcdc7ba20aaca020143d669..1218a6ca72c3094a11597d6f14813ded79e9128d 100755 (executable)
@@ -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")