]> git.proxmox.com Git - mirror_frr.git/commitdiff
ldp-vpls-topo1: new format for ospf neighbor json
authorMartin Winter <mwinter@opensourcerouting.org>
Sat, 27 Jan 2018 14:06:22 +0000 (06:06 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:13 +0000 (20:22 -0500)
Accept new format in ospf neighbor json output in addition to
old version. New format was introduced with PR1659

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-no-neigh [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-no-neigh [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-no-neigh [new file with mode: 0644]
tests/topotests/ldp-vpls-topo1/test_ldp_vpls_topo1.py

index 7c4d0ab58ccb3f2fbccf8cd552146aeb4e7eb276..fb193265be34c7951998d6b4e664e740a3a88cc7 100644 (file)
@@ -1,18 +1,31 @@
 {
-  "2.2.2.2":[
+  "neighbors":[
     {
-      "priority":1,
-      "state":"Full/DR",
-      "address":"10.0.1.2",
-      "ifaceName":"r1-eth1:10.0.1.1"
-    }
-  ],
-  "3.3.3.3":[
+      "2.2.2.2":[
+        {
+          "priority":1,
+          "state":"Full/DR",
+          "address":"10.0.1.2",
+          "ifaceName":"r1-eth1:10.0.1.1",
+          "retransmitCounter":0,
+          "requestCounter":0,
+          "dbSummaryCounter":0
+        }
+      ]
+    },
     {
-      "priority":1,
-      "state":"Full/DR",
-      "address":"10.0.2.3",
-      "ifaceName":"r1-eth2:10.0.2.1"
+      "3.3.3.3":[
+        {
+          "priority":1,
+          "state":"Full/DR",
+          "address":"10.0.2.3",
+          "ifaceName":"r1-eth2:10.0.2.1",
+          "retransmitCounter":0,
+          "requestCounter":0,
+          "dbSummaryCounter":0
+        }
+      ]
     }
   ]
 }
+
diff --git a/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref-no-neigh b/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.ref-no-neigh
new file mode 100644 (file)
index 0000000..7c4d0ab
--- /dev/null
@@ -0,0 +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"
+    }
+  ]
+}
index a982c1cbd35e7590f4acafd477e2c6e5a9d7a084..13765797570d35ee72b44e9b39274e72d1be6007 100644 (file)
@@ -1,18 +1,30 @@
 {
-  "1.1.1.1":[
+  "neighbors":[
     {
-      "priority":1,
-      "state":"Full/Backup",
-      "address":"10.0.1.1",
-      "ifaceName":"r2-eth1:10.0.1.2"
-    }
-  ],
-  "3.3.3.3":[
+      "1.1.1.1":[
+        {
+          "priority":1,
+          "state":"Full/Backup",
+          "address":"10.0.1.1",
+          "ifaceName":"r2-eth1:10.0.1.2",
+          "retransmitCounter":0,
+          "requestCounter":0,
+          "dbSummaryCounter":0
+        }
+      ]
+    },
     {
-      "priority":1,
-      "state":"Full/DR",
-      "address":"10.0.3.3",
-      "ifaceName":"r2-eth2:10.0.3.2"
+      "3.3.3.3":[
+        {
+          "priority":1,
+          "state":"Full/DR",
+          "address":"10.0.3.3",
+          "ifaceName":"r2-eth2:10.0.3.2",
+          "retransmitCounter":0,
+          "requestCounter":0,
+          "dbSummaryCounter":0
+        }
+      ]
     }
   ]
 }
diff --git a/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref-no-neigh b/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.ref-no-neigh
new file mode 100644 (file)
index 0000000..a982c1c
--- /dev/null
@@ -0,0 +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"
+    }
+  ]
+}
index d7e0e424053129e937f5863c01c2f5cdd421284d..41de304b2b5743a60ef594946de3f5beb455e8e3 100644 (file)
@@ -1,18 +1,30 @@
 {
-  "1.1.1.1":[
+  "neighbors":[
     {
-      "priority":1,
-      "state":"Full/Backup",
-      "address":"10.0.2.1",
-      "ifaceName":"r3-eth1:10.0.2.3"
-    }
-  ],
-  "2.2.2.2":[
+      "1.1.1.1":[
+        {
+          "priority":1,
+          "state":"Full/Backup",
+          "address":"10.0.2.1",
+          "ifaceName":"r3-eth1:10.0.2.3",
+          "retransmitCounter":0,
+          "requestCounter":0,
+          "dbSummaryCounter":0
+        }
+      ]
+    },
     {
-      "priority":1,
-      "state":"Full/Backup",
-      "address":"10.0.3.2",
-      "ifaceName":"r3-eth2:10.0.3.3"
+      "2.2.2.2":[
+        {
+          "priority":1,
+          "state":"Full/Backup",
+          "address":"10.0.3.2",
+          "ifaceName":"r3-eth2:10.0.3.3",
+          "retransmitCounter":0,
+          "requestCounter":0,
+          "dbSummaryCounter":0
+        }
+      ]
     }
   ]
 }
diff --git a/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref-no-neigh b/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.ref-no-neigh
new file mode 100644 (file)
index 0000000..d7e0e42
--- /dev/null
@@ -0,0 +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"
+    }
+  ]
+}
index 1218a6ca72c3094a11597d6f14813ded79e9128d..32e958fa5651ab3423836870119d91e0b203d967 100755 (executable)
@@ -186,9 +186,15 @@ def test_ospf_convergence():
     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:
+    # We could have either old format (without "neighbors" and direct list
+    # of IP's or new format from PR1659 with "neighbors".
+    # Trying old formats first and fall back to new format
+    try:
+        if isinstance(output["2.2.2.2"], dict):
+            reffile = "show_ip_ospf_neighbor.ref-old-nolist"
+        else:
+            reffile = "show_ip_ospf_neighbor.ref-no-neigh"
+    except:
         reffile = "show_ip_ospf_neighbor.ref"
 
     for rname in ['r1', 'r2', 'r3']: