]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: add OSPFv3 graceful restart topotest
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 30 Jun 2021 18:12:30 +0000 (15:12 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Thu, 16 Sep 2021 15:26:48 +0000 (12:26 -0300)
Add a new topotest that features a topology with seven routers spread
across four OSPF areas:
* 1 backbone area;
* 1 regular non-backbone area (0.0.0.1);
* 1 stub area (0.0.0.2);
* 1 NSSA area (0.0.0.3).

All routers have both GR and GR helper functionality enabled in
the configuration. The test consists of restarting each router,
one at time, and checking that all forwarding planes (and LSDBs)
are kept intact during those restarts.

A successful run takes about three minutes to finish.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
44 files changed:
tests/topotests/ospf6_gr_topo1/__init__.py [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt1/ospf6d.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_ospf_database.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_ospf_neighbor.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_ospf_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt1/zebra.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt2/ospf6d.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_ospf_database.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_ospf_neighbor.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_ospf_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt2/zebra.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt3/ospf6d.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_ospf_database.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_ospf_neighbor.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_ospf_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt3/zebra.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt4/ospf6d.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_ospf_database.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_ospf_neighbor.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_ospf_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt4/zebra.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt5/ospf6d.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_ospf_database.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_ospf_neighbor.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_ospf_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt5/zebra.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt6/ospf6d.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_ospf_database.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_ospf_neighbor.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_ospf_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt6/zebra.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt7/ospf6d.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_ospf_database.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_ospf_neighbor.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_ospf_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_route.json [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/rt7/zebra.conf [new file with mode: 0644]
tests/topotests/ospf6_gr_topo1/test_ospf6_gr_topo1.py [new file with mode: 0755]

diff --git a/tests/topotests/ospf6_gr_topo1/__init__.py b/tests/topotests/ospf6_gr_topo1/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/topotests/ospf6_gr_topo1/rt1/ospf6d.conf b/tests/topotests/ospf6_gr_topo1/rt1/ospf6d.conf
new file mode 100644 (file)
index 0000000..1ee1189
--- /dev/null
@@ -0,0 +1,30 @@
+:assword 1
+hostname rt1
+log file ospf6d.log
+log commands
+!
+debug ospf6 lsa router originate
+debug ospf6 lsa router flooding
+debug ospf6 zebra
+debug ospf6 interface
+debug ospf6 neighbor
+debug ospf6 flooding
+debug ospf6 graceful-restart
+debug ospf6 spf process
+!
+interface lo
+ ipv6 ospf area 1
+ ipv6 ospf network point-to-point
+!
+interface eth-rt2
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 1
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+router ospf6
+ ospf6 router-id 1.1.1.1
+ redistribute connected
+ graceful-restart grace-period 120
+ graceful-restart helper-only
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_ospf_database.json b/tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_ospf_database.json
new file mode 100644 (file)
index 0000000..58fc114
--- /dev/null
@@ -0,0 +1,95 @@
+{
+  "areaScopedLinkStateDb":[
+    {
+      "areaId":"1",
+      "lsa":[
+        {
+          "type":"Rtr",
+          "advRouter":"1.1.1.1"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"2.2.2.2"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::2\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::3\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::4\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::6\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::5\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::7\/128"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"2.2.2.2",
+          "payload":"7.7.7.7"
+        },
+        {
+          "type":"INP",
+          "advRouter":"1.1.1.1",
+          "payload":"2001:db8:1000::1\/128"
+        }
+      ]
+    }
+  ],
+  "interfaceScopedLinkStateDb":[
+    {
+      "areaId":"1",
+      "interface":"eth-rt2",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"1.1.1.1"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"2.2.2.2"
+        }
+      ]
+    },
+    {
+      "areaId":"1",
+      "interface":"lo",
+      "lsa":[
+      ]
+    }
+  ],
+  "asScopedLinkStateDb":[
+    {
+      "lsa":[
+        {
+          "type":"ASE",
+          "advRouter":"1.1.1.1",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"ASE",
+          "advRouter":"7.7.7.7",
+          "payload":"2001:db8:1000::7\/128"
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_ospf_neighbor.json b/tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_ospf_neighbor.json
new file mode 100644 (file)
index 0000000..cb88358
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "neighbors":[
+    {
+      "neighborId":"2.2.2.2",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt2",
+      "interfaceState":"PointToPoint"
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_ospf_route.json b/tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_ospf_route.json
new file mode 100644 (file)
index 0000000..0c69310
--- /dev/null
@@ -0,0 +1,74 @@
+{
+  "routes":{
+    "2001:db8:1000::1\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"lo"
+        }
+      ]
+    },
+    "2001:db8:1000::2\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt2"
+        }
+      ]
+    },
+    "2001:db8:1000::3\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt2"
+        }
+      ]
+    },
+    "2001:db8:1000::4\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt2"
+        }
+      ]
+    },
+    "2001:db8:1000::5\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt2"
+        }
+      ]
+    },
+    "2001:db8:1000::6\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt2"
+        }
+      ]
+    },
+    "2001:db8:1000::7\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt2"
+        }
+      ]
+    }
+  }
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_route.json b/tests/topotests/ospf6_gr_topo1/rt1/show_ipv6_route.json
new file mode 100644 (file)
index 0000000..66ee57c
--- /dev/null
@@ -0,0 +1,139 @@
+{
+  "2001:db8:1000::1\/128":[
+    {
+      "prefix":"2001:db8:1000::1\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "distance":110,
+      "metric":10,
+      "nexthops":[
+        {
+          "directlyConnected":true,
+          "interfaceName":"lo",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::2\/128":[
+    {
+      "prefix":"2001:db8:1000::2\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt2",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::3\/128":[
+    {
+      "prefix":"2001:db8:1000::3\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt2",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::4\/128":[
+    {
+      "prefix":"2001:db8:1000::4\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt2",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::5\/128":[
+    {
+      "prefix":"2001:db8:1000::5\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":50,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt2",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::6\/128":[
+    {
+      "prefix":"2001:db8:1000::6\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt2",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::7\/128":[
+    {
+      "prefix":"2001:db8:1000::7\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":50,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt2",
+          "active":true
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt1/zebra.conf b/tests/topotests/ospf6_gr_topo1/rt1/zebra.conf
new file mode 100644 (file)
index 0000000..f29f5b7
--- /dev/null
@@ -0,0 +1,22 @@
+password 1
+hostname rt1
+log file zebra.log
+log commands
+!
+debug zebra event
+debug zebra packet
+debug zebra rib
+debug zebra kernel
+!
+interface lo
+ ip address 1.1.1.1/32
+ ipv6 address 2001:db8:1000::1/128
+!
+interface stub1
+!
+interface eth-rt2
+!
+ip forwarding
+!
+line vty
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt2/ospf6d.conf b/tests/topotests/ospf6_gr_topo1/rt2/ospf6d.conf
new file mode 100644 (file)
index 0000000..6cd8d1a
--- /dev/null
@@ -0,0 +1,35 @@
+password 1
+hostname rt2
+log file ospf6d.log
+log commands
+!
+debug ospf6 lsa router originate
+debug ospf6 lsa router flooding
+debug ospf6 zebra
+debug ospf6 interface
+debug ospf6 neighbor
+debug ospf6 flooding
+debug ospf6 graceful-restart
+debug ospf6 spf process
+!
+interface lo
+ ipv6 ospf area 0
+ ipv6 ospf network point-to-point
+!
+interface eth-rt1
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 1
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+interface eth-rt3
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 0
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+router ospf6
+ ospf6 router-id 2.2.2.2
+ graceful-restart grace-period 120
+ graceful-restart helper-only
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_ospf_database.json b/tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_ospf_database.json
new file mode 100644 (file)
index 0000000..fb16326
--- /dev/null
@@ -0,0 +1,183 @@
+{
+  "areaScopedLinkStateDb":[
+    {
+      "areaId":"0",
+      "lsa":[
+        {
+          "type":"Rtr",
+          "advRouter":"2.2.2.2"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"4.4.4.4"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"6.6.6.6"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::5\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::7\/128"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"2.2.2.2",
+          "payload":"1.1.1.1"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"6.6.6.6",
+          "payload":"7.7.7.7"
+        },
+        {
+          "type":"INP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::2\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"3.3.3.3",
+          "payload":"2001:db8:1000::3\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::4\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::6\/128"
+        }
+      ]
+    },
+    {
+      "areaId":"1",
+      "lsa":[
+        {
+          "type":"Rtr",
+          "advRouter":"1.1.1.1"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"2.2.2.2"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::2\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::3\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::4\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::6\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::5\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::7\/128"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"2.2.2.2",
+          "payload":"7.7.7.7"
+        },
+        {
+          "type":"INP",
+          "advRouter":"1.1.1.1",
+          "payload":"2001:db8:1000::1\/128"
+        }
+      ]
+    }
+  ],
+  "interfaceScopedLinkStateDb":[
+    {
+      "areaId":"0",
+      "interface":"eth-rt3",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"2.2.2.2"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"3.3.3.3"
+        }
+      ]
+    },
+    {
+      "areaId":"0",
+      "interface":"lo",
+      "lsa":[
+      ]
+    },
+    {
+      "areaId":"1",
+      "interface":"eth-rt1",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"1.1.1.1"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"2.2.2.2"
+        }
+      ]
+    }
+  ],
+  "asScopedLinkStateDb":[
+    {
+      "lsa":[
+        {
+          "type":"ASE",
+          "advRouter":"1.1.1.1",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"ASE",
+          "advRouter":"7.7.7.7",
+          "payload":"2001:db8:1000::7\/128"
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_ospf_neighbor.json b/tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_ospf_neighbor.json
new file mode 100644 (file)
index 0000000..e4f27bf
--- /dev/null
@@ -0,0 +1,20 @@
+{
+  "neighbors":[
+    {
+      "neighborId":"3.3.3.3",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt3",
+      "interfaceState":"PointToPoint"
+    },
+    {
+      "neighborId":"1.1.1.1",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt1",
+      "interfaceState":"PointToPoint"
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_ospf_route.json b/tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_ospf_route.json
new file mode 100644 (file)
index 0000000..34013a1
--- /dev/null
@@ -0,0 +1,74 @@
+{
+  "routes":{
+    "2001:db8:1000::1\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt1"
+        }
+      ]
+    },
+    "2001:db8:1000::2\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"lo"
+        }
+      ]
+    },
+    "2001:db8:1000::3\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::4\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::5\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::6\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::7\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    }
+  }
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_route.json b/tests/topotests/ospf6_gr_topo1/rt2/show_ipv6_route.json
new file mode 100644 (file)
index 0000000..624ff70
--- /dev/null
@@ -0,0 +1,139 @@
+{
+  "2001:db8:1000::1\/128":[
+    {
+      "prefix":"2001:db8:1000::1\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt1",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::2\/128":[
+    {
+      "prefix":"2001:db8:1000::2\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "distance":110,
+      "metric":10,
+      "nexthops":[
+        {
+          "directlyConnected":true,
+          "interfaceName":"lo",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::3\/128":[
+    {
+      "prefix":"2001:db8:1000::3\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::4\/128":[
+    {
+      "prefix":"2001:db8:1000::4\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::5\/128":[
+    {
+      "prefix":"2001:db8:1000::5\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::6\/128":[
+    {
+      "prefix":"2001:db8:1000::6\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::7\/128":[
+    {
+      "prefix":"2001:db8:1000::7\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt2/zebra.conf b/tests/topotests/ospf6_gr_topo1/rt2/zebra.conf
new file mode 100644 (file)
index 0000000..e4fe762
--- /dev/null
@@ -0,0 +1,22 @@
+password 1
+hostname rt2
+log file zebra.log
+log commands
+!
+debug zebra event
+debug zebra packet
+debug zebra rib
+debug zebra kernel
+!
+interface lo
+ ip address 2.2.2.2/32
+ ipv6 address 2001:db8:1000::2/128
+!
+interface eth-rt1
+!
+interface eth-rt3
+!
+ip forwarding
+!
+line vty
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt3/ospf6d.conf b/tests/topotests/ospf6_gr_topo1/rt3/ospf6d.conf
new file mode 100644 (file)
index 0000000..6a63d8f
--- /dev/null
@@ -0,0 +1,41 @@
+password 1
+hostname rt3
+log file ospf6d.log
+log commands
+!
+debug ospf6 lsa router originate
+debug ospf6 lsa router flooding
+debug ospf6 zebra
+debug ospf6 interface
+debug ospf6 neighbor
+debug ospf6 flooding
+debug ospf6 graceful-restart
+debug ospf6 spf process
+!
+interface lo
+ ipv6 ospf area 0
+ ipv6 ospf network point-to-point
+!
+interface eth-rt2
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 0
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+interface eth-rt4
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 0
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+interface eth-rt6
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 0
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+router ospf6
+ ospf6 router-id 3.3.3.3
+ graceful-restart grace-period 120
+ graceful-restart helper-only
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_ospf_database.json b/tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_ospf_database.json
new file mode 100644 (file)
index 0000000..f8a8f76
--- /dev/null
@@ -0,0 +1,144 @@
+{
+  "areaScopedLinkStateDb":[
+    {
+      "areaId":"0",
+      "lsa":[
+        {
+          "type":"Rtr",
+          "advRouter":"2.2.2.2"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"4.4.4.4"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"6.6.6.6"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::5\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::7\/128"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"2.2.2.2",
+          "payload":"1.1.1.1"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"6.6.6.6",
+          "payload":"7.7.7.7"
+        },
+        {
+          "type":"INP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::2\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"3.3.3.3",
+          "payload":"2001:db8:1000::3\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::4\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::6\/128"
+        }
+      ]
+    }
+  ],
+  "interfaceScopedLinkStateDb":[
+    {
+      "areaId":"0",
+      "interface":"eth-rt2",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"2.2.2.2"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"3.3.3.3"
+        }
+      ]
+    },
+    {
+      "areaId":"0",
+      "interface":"eth-rt4",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"4.4.4.4"
+        }
+      ]
+    },
+    {
+      "areaId":"0",
+      "interface":"eth-rt6",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"6.6.6.6"
+        }
+      ]
+    },
+    {
+      "areaId":"0",
+      "interface":"lo",
+      "lsa":[
+      ]
+    }
+  ],
+  "asScopedLinkStateDb":[
+    {
+      "lsa":[
+        {
+          "type":"ASE",
+          "advRouter":"1.1.1.1",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"ASE",
+          "advRouter":"7.7.7.7",
+          "payload":"2001:db8:1000::7\/128"
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_ospf_neighbor.json b/tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_ospf_neighbor.json
new file mode 100644 (file)
index 0000000..d0d7f45
--- /dev/null
@@ -0,0 +1,28 @@
+{
+  "neighbors":[
+    {
+      "neighborId":"2.2.2.2",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt2",
+      "interfaceState":"PointToPoint"
+    },
+    {
+      "neighborId":"4.4.4.4",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt4",
+      "interfaceState":"PointToPoint"
+    },
+    {
+      "neighborId":"6.6.6.6",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt6",
+      "interfaceState":"PointToPoint"
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_ospf_route.json b/tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_ospf_route.json
new file mode 100644 (file)
index 0000000..ee516b9
--- /dev/null
@@ -0,0 +1,74 @@
+{
+  "routes":{
+    "2001:db8:1000::1\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt2"
+        }
+      ]
+    },
+    "2001:db8:1000::2\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt2"
+        }
+      ]
+    },
+    "2001:db8:1000::3\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"lo"
+        }
+      ]
+    },
+    "2001:db8:1000::4\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt4"
+        }
+      ]
+    },
+    "2001:db8:1000::5\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt4"
+        }
+      ]
+    },
+    "2001:db8:1000::6\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt6"
+        }
+      ]
+    },
+    "2001:db8:1000::7\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt6"
+        }
+      ]
+    }
+  }
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_route.json b/tests/topotests/ospf6_gr_topo1/rt3/show_ipv6_route.json
new file mode 100644 (file)
index 0000000..f9b43dc
--- /dev/null
@@ -0,0 +1,139 @@
+{
+  "2001:db8:1000::1\/128":[
+    {
+      "prefix":"2001:db8:1000::1\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt2",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::2\/128":[
+    {
+      "prefix":"2001:db8:1000::2\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt2",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::3\/128":[
+    {
+      "prefix":"2001:db8:1000::3\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "distance":110,
+      "metric":10,
+      "nexthops":[
+        {
+          "directlyConnected":true,
+          "interfaceName":"lo",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::4\/128":[
+    {
+      "prefix":"2001:db8:1000::4\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt4",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::5\/128":[
+    {
+      "prefix":"2001:db8:1000::5\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt4",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::6\/128":[
+    {
+      "prefix":"2001:db8:1000::6\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt6",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::7\/128":[
+    {
+      "prefix":"2001:db8:1000::7\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt6",
+          "active":true
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt3/zebra.conf b/tests/topotests/ospf6_gr_topo1/rt3/zebra.conf
new file mode 100644 (file)
index 0000000..3a9de21
--- /dev/null
@@ -0,0 +1,24 @@
+password 1
+hostname rt3
+log file zebra.log
+log commands
+!
+debug zebra event
+debug zebra packet
+debug zebra rib
+debug zebra kernel
+!
+interface lo
+ ip address 3.3.3.3/32
+ ipv6 address 2001:db8:1000::3/128
+!
+interface eth-rt2
+!
+interface eth-rt4
+!
+interface eth-rt6
+!
+ip forwarding
+!
+line vty
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt4/ospf6d.conf b/tests/topotests/ospf6_gr_topo1/rt4/ospf6d.conf
new file mode 100644 (file)
index 0000000..dff33d4
--- /dev/null
@@ -0,0 +1,35 @@
+password 1
+hostname rt4
+log file ospf6d.log
+log commands
+!
+debug ospf6 lsa router originate
+debug ospf6 lsa router flooding
+debug ospf6 zebra
+debug ospf6 interface
+debug ospf6 neighbor
+debug ospf6 flooding
+debug ospf6 graceful-restart
+debug ospf6 spf process
+!
+interface lo
+ ipv6 ospf area 0
+ ipv6 ospf network point-to-point
+!
+interface eth-rt3
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 0
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+interface eth-rt5
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 2
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+router ospf6
+ ospf6 router-id 4.4.4.4
+ graceful-restart grace-period 120
+ graceful-restart helper-only
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_ospf_database.json b/tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_ospf_database.json
new file mode 100644 (file)
index 0000000..0954d1b
--- /dev/null
@@ -0,0 +1,188 @@
+{
+  "areaScopedLinkStateDb":[
+    {
+      "areaId":"0",
+      "lsa":[
+        {
+          "type":"Rtr",
+          "advRouter":"2.2.2.2"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"4.4.4.4"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"6.6.6.6"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::5\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::7\/128"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"2.2.2.2",
+          "payload":"1.1.1.1"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"6.6.6.6",
+          "payload":"7.7.7.7"
+        },
+        {
+          "type":"INP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::2\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"3.3.3.3",
+          "payload":"2001:db8:1000::3\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::4\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::6\/128"
+        }
+      ]
+    },
+    {
+      "areaId":"2",
+      "lsa":[
+        {
+          "type":"Rtr",
+          "advRouter":"4.4.4.4"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"5.5.5.5"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::4\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::2\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::3\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::6\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::7\/128"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"4.4.4.4",
+          "payload":"1.1.1.1"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"4.4.4.4",
+          "payload":"7.7.7.7"
+        },
+        {
+          "type":"INP",
+          "advRouter":"5.5.5.5",
+          "payload":"2001:db8:1000::5\/128"
+        }
+      ]
+    }
+  ],
+  "interfaceScopedLinkStateDb":[
+    {
+      "areaId":"0",
+      "interface":"eth-rt3",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"4.4.4.4"
+        }
+      ]
+    },
+    {
+      "areaId":"0",
+      "interface":"lo",
+      "lsa":[
+      ]
+    },
+    {
+      "areaId":"2",
+      "interface":"eth-rt5",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"4.4.4.4"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"5.5.5.5"
+        }
+      ]
+    }
+  ],
+  "asScopedLinkStateDb":[
+    {
+      "lsa":[
+        {
+          "type":"ASE",
+          "advRouter":"1.1.1.1",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"ASE",
+          "advRouter":"7.7.7.7",
+          "payload":"2001:db8:1000::7\/128"
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_ospf_neighbor.json b/tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_ospf_neighbor.json
new file mode 100644 (file)
index 0000000..36abba4
--- /dev/null
@@ -0,0 +1,20 @@
+{
+  "neighbors":[
+    {
+      "neighborId":"3.3.3.3",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt3",
+      "interfaceState":"PointToPoint"
+    },
+    {
+      "neighborId":"5.5.5.5",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt5",
+      "interfaceState":"PointToPoint"
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_ospf_route.json b/tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_ospf_route.json
new file mode 100644 (file)
index 0000000..3e5f17f
--- /dev/null
@@ -0,0 +1,74 @@
+{
+  "routes":{
+    "2001:db8:1000::1\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::2\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::3\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::4\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"lo"
+        }
+      ]
+    },
+    "2001:db8:1000::5\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt5"
+        }
+      ]
+    },
+    "2001:db8:1000::6\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::7\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    }
+  }
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_route.json b/tests/topotests/ospf6_gr_topo1/rt4/show_ipv6_route.json
new file mode 100644 (file)
index 0000000..f5212da
--- /dev/null
@@ -0,0 +1,139 @@
+{
+  "2001:db8:1000::1\/128":[
+    {
+      "prefix":"2001:db8:1000::1\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::2\/128":[
+    {
+      "prefix":"2001:db8:1000::2\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::3\/128":[
+    {
+      "prefix":"2001:db8:1000::3\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::4\/128":[
+    {
+      "prefix":"2001:db8:1000::4\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "distance":110,
+      "metric":10,
+      "nexthops":[
+        {
+          "directlyConnected":true,
+          "interfaceName":"lo",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::5\/128":[
+    {
+      "prefix":"2001:db8:1000::5\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt5",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::6\/128":[
+    {
+      "prefix":"2001:db8:1000::6\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::7\/128":[
+    {
+      "prefix":"2001:db8:1000::7\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt4/zebra.conf b/tests/topotests/ospf6_gr_topo1/rt4/zebra.conf
new file mode 100644 (file)
index 0000000..eeea417
--- /dev/null
@@ -0,0 +1,22 @@
+password 1
+hostname rt4
+log file zebra.log
+log commands
+!
+debug zebra event
+debug zebra packet
+debug zebra rib
+debug zebra kernel
+!
+interface lo
+ ip address 4.4.4.4/32
+ ipv6 address 2001:db8:1000::4/128
+!
+interface eth-rt3
+!
+interface eth-rt5
+!
+ip forwarding
+!
+line vty
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt5/ospf6d.conf b/tests/topotests/ospf6_gr_topo1/rt5/ospf6d.conf
new file mode 100644 (file)
index 0000000..49c3a8b
--- /dev/null
@@ -0,0 +1,29 @@
+password 1
+hostname rt5
+log file ospf6d.log
+log commands
+!
+debug ospf6 lsa router originate
+debug ospf6 lsa router flooding
+debug ospf6 zebra
+debug ospf6 interface
+debug ospf6 neighbor
+debug ospf6 flooding
+debug ospf6 graceful-restart
+debug ospf6 spf process
+!
+interface lo
+ ipv6 ospf area 2
+ ipv6 ospf network point-to-point
+!
+interface eth-rt4
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 2
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+router ospf6
+ ospf6 router-id 5.5.5.5
+ graceful-restart grace-period 120
+ graceful-restart helper-only
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_ospf_database.json b/tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_ospf_database.json
new file mode 100644 (file)
index 0000000..4a163b9
--- /dev/null
@@ -0,0 +1,100 @@
+{
+  "areaScopedLinkStateDb":[
+    {
+      "areaId":"2",
+      "lsa":[
+        {
+          "type":"Rtr",
+          "advRouter":"4.4.4.4"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"5.5.5.5"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::4\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::2\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::3\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::6\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::7\/128"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"4.4.4.4",
+          "payload":"1.1.1.1"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"4.4.4.4",
+          "payload":"7.7.7.7"
+        },
+        {
+          "type":"INP",
+          "advRouter":"5.5.5.5",
+          "payload":"2001:db8:1000::5\/128"
+        }
+      ]
+    }
+  ],
+  "interfaceScopedLinkStateDb":[
+    {
+      "areaId":"2",
+      "interface":"eth-rt4",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"4.4.4.4"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"5.5.5.5"
+        }
+      ]
+    },
+    {
+      "areaId":"2",
+      "interface":"lo",
+      "lsa":[
+      ]
+    }
+  ],
+  "asScopedLinkStateDb":[
+    {
+      "lsa":[
+        {
+          "type":"ASE",
+          "advRouter":"1.1.1.1",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"ASE",
+          "advRouter":"7.7.7.7",
+          "payload":"2001:db8:1000::7\/128"
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_ospf_neighbor.json b/tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_ospf_neighbor.json
new file mode 100644 (file)
index 0000000..9b6ac91
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "neighbors":[
+    {
+      "neighborId":"4.4.4.4",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt4",
+      "interfaceState":"PointToPoint"
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_ospf_route.json b/tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_ospf_route.json
new file mode 100644 (file)
index 0000000..a56c326
--- /dev/null
@@ -0,0 +1,74 @@
+{
+  "routes":{
+    "2001:db8:1000::1\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt4"
+        }
+      ]
+    },
+    "2001:db8:1000::2\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt4"
+        }
+      ]
+    },
+    "2001:db8:1000::3\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt4"
+        }
+      ]
+    },
+    "2001:db8:1000::4\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt4"
+        }
+      ]
+    },
+    "2001:db8:1000::5\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"lo"
+        }
+      ]
+    },
+    "2001:db8:1000::6\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt4"
+        }
+      ]
+    },
+    "2001:db8:1000::7\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt4"
+        }
+      ]
+    }
+  }
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_route.json b/tests/topotests/ospf6_gr_topo1/rt5/show_ipv6_route.json
new file mode 100644 (file)
index 0000000..5ea4f69
--- /dev/null
@@ -0,0 +1,139 @@
+{
+  "2001:db8:1000::1\/128":[
+    {
+      "prefix":"2001:db8:1000::1\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":50,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt4",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::2\/128":[
+    {
+      "prefix":"2001:db8:1000::2\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt4",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::3\/128":[
+    {
+      "prefix":"2001:db8:1000::3\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt4",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::4\/128":[
+    {
+      "prefix":"2001:db8:1000::4\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt4",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::5\/128":[
+    {
+      "prefix":"2001:db8:1000::5\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "distance":110,
+      "metric":10,
+      "nexthops":[
+        {
+          "directlyConnected":true,
+          "interfaceName":"lo",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::6\/128":[
+    {
+      "prefix":"2001:db8:1000::6\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt4",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::7\/128":[
+    {
+      "prefix":"2001:db8:1000::7\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":50,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt4",
+          "active":true
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt5/zebra.conf b/tests/topotests/ospf6_gr_topo1/rt5/zebra.conf
new file mode 100644 (file)
index 0000000..0cdb90b
--- /dev/null
@@ -0,0 +1,20 @@
+password 1
+hostname rt5
+log file zebra.log
+log commands
+!
+debug zebra event
+debug zebra packet
+debug zebra rib
+debug zebra kernel
+!
+interface lo
+ ip address 5.5.5.5/32
+ ipv6 address 2001:db8:1000::5/128
+!
+interface eth-rt4
+!
+ip forwarding
+!
+line vty
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt6/ospf6d.conf b/tests/topotests/ospf6_gr_topo1/rt6/ospf6d.conf
new file mode 100644 (file)
index 0000000..5d6d328
--- /dev/null
@@ -0,0 +1,35 @@
+password 1
+hostname rt6
+log file ospf6d.log
+log commands
+!
+debug ospf6 lsa router originate
+debug ospf6 lsa router flooding
+debug ospf6 zebra
+debug ospf6 interface
+debug ospf6 neighbor
+debug ospf6 flooding
+debug ospf6 graceful-restart
+debug ospf6 spf process
+!
+interface lo
+ ipv6 ospf area 0
+ ipv6 ospf network point-to-point
+!
+interface eth-rt3
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 0
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+interface eth-rt7
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 3
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+router ospf6
+ ospf6 router-id 6.6.6.6
+ graceful-restart grace-period 120
+ graceful-restart helper-only
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_ospf_database.json b/tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_ospf_database.json
new file mode 100644 (file)
index 0000000..71872d1
--- /dev/null
@@ -0,0 +1,183 @@
+{
+  "areaScopedLinkStateDb":[
+    {
+      "areaId":"0",
+      "lsa":[
+        {
+          "type":"Rtr",
+          "advRouter":"2.2.2.2"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"4.4.4.4"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"6.6.6.6"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::5\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::7\/128"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"2.2.2.2",
+          "payload":"1.1.1.1"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"6.6.6.6",
+          "payload":"7.7.7.7"
+        },
+        {
+          "type":"INP",
+          "advRouter":"2.2.2.2",
+          "payload":"2001:db8:1000::2\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"3.3.3.3",
+          "payload":"2001:db8:1000::3\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"4.4.4.4",
+          "payload":"2001:db8:1000::4\/128"
+        },
+        {
+          "type":"INP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::6\/128"
+        }
+      ]
+    },
+    {
+      "areaId":"3",
+      "lsa":[
+        {
+          "type":"Rtr",
+          "advRouter":"6.6.6.6"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"7.7.7.7"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::6\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::2\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::3\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::4\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::5\/128"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"6.6.6.6",
+          "payload":"1.1.1.1"
+        },
+        {
+          "type":"INP",
+          "advRouter":"7.7.7.7",
+          "payload":"2001:db8:1000::7\/128"
+        }
+      ]
+    }
+  ],
+  "interfaceScopedLinkStateDb":[
+    {
+      "areaId":"0",
+      "interface":"eth-rt3",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"3.3.3.3"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"6.6.6.6"
+        }
+      ]
+    },
+    {
+      "areaId":"0",
+      "interface":"lo",
+      "lsa":[
+      ]
+    },
+    {
+      "areaId":"3",
+      "interface":"eth-rt7",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"6.6.6.6"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"7.7.7.7"
+        }
+      ]
+    }
+  ],
+  "asScopedLinkStateDb":[
+    {
+      "lsa":[
+        {
+          "type":"ASE",
+          "advRouter":"1.1.1.1",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"ASE",
+          "advRouter":"7.7.7.7",
+          "payload":"2001:db8:1000::7\/128"
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_ospf_neighbor.json b/tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_ospf_neighbor.json
new file mode 100644 (file)
index 0000000..aba181b
--- /dev/null
@@ -0,0 +1,20 @@
+{
+  "neighbors":[
+    {
+      "neighborId":"3.3.3.3",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt3",
+      "interfaceState":"PointToPoint"
+    },
+    {
+      "neighborId":"7.7.7.7",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt7",
+      "interfaceState":"PointToPoint"
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_ospf_route.json b/tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_ospf_route.json
new file mode 100644 (file)
index 0000000..c9494a9
--- /dev/null
@@ -0,0 +1,74 @@
+{
+  "routes":{
+    "2001:db8:1000::1\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::2\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::3\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::4\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::5\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt3"
+        }
+      ]
+    },
+    "2001:db8:1000::6\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"lo"
+        }
+      ]
+    },
+    "2001:db8:1000::7\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt7"
+        }
+      ]
+    }
+  }
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_route.json b/tests/topotests/ospf6_gr_topo1/rt6/show_ipv6_route.json
new file mode 100644 (file)
index 0000000..862f1ba
--- /dev/null
@@ -0,0 +1,139 @@
+{
+  "2001:db8:1000::1\/128":[
+    {
+      "prefix":"2001:db8:1000::1\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::2\/128":[
+    {
+      "prefix":"2001:db8:1000::2\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::3\/128":[
+    {
+      "prefix":"2001:db8:1000::3\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::4\/128":[
+    {
+      "prefix":"2001:db8:1000::4\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::5\/128":[
+    {
+      "prefix":"2001:db8:1000::5\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt3",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::6\/128":[
+    {
+      "prefix":"2001:db8:1000::6\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "distance":110,
+      "metric":10,
+      "nexthops":[
+        {
+          "directlyConnected":true,
+          "interfaceName":"lo",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::7\/128":[
+    {
+      "prefix":"2001:db8:1000::7\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt7",
+          "active":true
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt6/zebra.conf b/tests/topotests/ospf6_gr_topo1/rt6/zebra.conf
new file mode 100644 (file)
index 0000000..3c2312d
--- /dev/null
@@ -0,0 +1,22 @@
+password 1
+hostname rt6
+log file zebra.log
+log commands
+!
+debug zebra event
+debug zebra packet
+debug zebra rib
+debug zebra kernel
+!
+interface lo
+ ip address 6.6.6.6/32
+ ipv6 address 2001:db8:1000::6/128
+!
+interface eth-rt3
+!
+interface eth-rt7
+!
+ip forwarding
+!
+line vty
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt7/ospf6d.conf b/tests/topotests/ospf6_gr_topo1/rt7/ospf6d.conf
new file mode 100644 (file)
index 0000000..f504fba
--- /dev/null
@@ -0,0 +1,30 @@
+password 1
+hostname rt7
+log file ospf6d.log
+log commands
+!
+debug ospf6 lsa router originate
+debug ospf6 lsa router flooding
+debug ospf6 zebra
+debug ospf6 interface
+debug ospf6 neighbor
+debug ospf6 flooding
+debug ospf6 graceful-restart
+debug ospf6 spf process
+!
+interface lo
+ ipv6 ospf area 3
+ ipv6 ospf network point-to-point
+!
+interface eth-rt6
+ ipv6 ospf network point-to-point
+ ipv6 ospf area 3
+ ipv6 ospf hello-interval 3
+ ipv6 ospf dead-interval 9
+!
+router ospf6
+ ospf6 router-id 7.7.7.7
+ redistribute connected
+ graceful-restart grace-period 120
+ graceful-restart helper-only
+!
diff --git a/tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_ospf_database.json b/tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_ospf_database.json
new file mode 100644 (file)
index 0000000..e70eb57
--- /dev/null
@@ -0,0 +1,95 @@
+{
+  "areaScopedLinkStateDb":[
+    {
+      "areaId":"3",
+      "lsa":[
+        {
+          "type":"Rtr",
+          "advRouter":"6.6.6.6"
+        },
+        {
+          "type":"Rtr",
+          "advRouter":"7.7.7.7"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::6\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::2\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::3\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::4\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"IAP",
+          "advRouter":"6.6.6.6",
+          "payload":"2001:db8:1000::5\/128"
+        },
+        {
+          "type":"IAR",
+          "advRouter":"6.6.6.6",
+          "payload":"1.1.1.1"
+        },
+        {
+          "type":"INP",
+          "advRouter":"7.7.7.7",
+          "payload":"2001:db8:1000::7\/128"
+        }
+      ]
+    }
+  ],
+  "interfaceScopedLinkStateDb":[
+    {
+      "areaId":"3",
+      "interface":"eth-rt6",
+      "lsa":[
+        {
+          "type":"Lnk",
+          "advRouter":"6.6.6.6"
+        },
+        {
+          "type":"Lnk",
+          "advRouter":"7.7.7.7"
+        }
+      ]
+    },
+    {
+      "areaId":"3",
+      "interface":"lo",
+      "lsa":[
+      ]
+    }
+  ],
+  "asScopedLinkStateDb":[
+    {
+      "lsa":[
+        {
+          "type":"ASE",
+          "advRouter":"1.1.1.1",
+          "payload":"2001:db8:1000::1\/128"
+        },
+        {
+          "type":"ASE",
+          "advRouter":"7.7.7.7",
+          "payload":"2001:db8:1000::7\/128"
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_ospf_neighbor.json b/tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_ospf_neighbor.json
new file mode 100644 (file)
index 0000000..5548691
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "neighbors":[
+    {
+      "neighborId":"6.6.6.6",
+      "priority":1,
+      "state":"Full",
+      "ifState":"PointToPoint",
+      "interfaceName":"eth-rt6",
+      "interfaceState":"PointToPoint"
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_ospf_route.json b/tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_ospf_route.json
new file mode 100644 (file)
index 0000000..42ca54f
--- /dev/null
@@ -0,0 +1,74 @@
+{
+  "routes":{
+    "2001:db8:1000::1\/128":{
+      "isBestRoute":false,
+      "destinationType":"N",
+      "pathType":"E2",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt6"
+        }
+      ]
+    },
+    "2001:db8:1000::2\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt6"
+        }
+      ]
+    },
+    "2001:db8:1000::3\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt6"
+        }
+      ]
+    },
+    "2001:db8:1000::4\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt6"
+        }
+      ]
+    },
+    "2001:db8:1000::5\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt6"
+        }
+      ]
+    },
+    "2001:db8:1000::6\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IE",
+      "nextHops":[
+        {
+          "interfaceName":"eth-rt6"
+        }
+      ]
+    },
+    "2001:db8:1000::7\/128":{
+      "isBestRoute":true,
+      "destinationType":"N",
+      "pathType":"IA",
+      "nextHops":[
+        {
+          "interfaceName":"lo"
+        }
+      ]
+    }
+  }
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_route.json b/tests/topotests/ospf6_gr_topo1/rt7/show_ipv6_route.json
new file mode 100644 (file)
index 0000000..f5f8f71
--- /dev/null
@@ -0,0 +1,139 @@
+{
+  "2001:db8:1000::1\/128":[
+    {
+      "prefix":"2001:db8:1000::1\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":50,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt6",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::2\/128":[
+    {
+      "prefix":"2001:db8:1000::2\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt6",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::3\/128":[
+    {
+      "prefix":"2001:db8:1000::3\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":30,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt6",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::4\/128":[
+    {
+      "prefix":"2001:db8:1000::4\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":40,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt6",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::5\/128":[
+    {
+      "prefix":"2001:db8:1000::5\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":50,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt6",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::6\/128":[
+    {
+      "prefix":"2001:db8:1000::6\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "selected":true,
+      "destSelected":true,
+      "distance":110,
+      "metric":20,
+      "installed":true,
+      "nexthops":[
+        {
+          "afi":"ipv6",
+          "interfaceName":"eth-rt6",
+          "active":true
+        }
+      ]
+    }
+  ],
+  "2001:db8:1000::7\/128":[
+    {
+      "prefix":"2001:db8:1000::7\/128",
+      "protocol":"ospf6",
+      "vrfId":0,
+      "vrfName":"default",
+      "distance":110,
+      "metric":10,
+      "nexthops":[
+        {
+          "directlyConnected":true,
+          "interfaceName":"lo",
+          "active":true
+        }
+      ]
+    }
+  ]
+}
diff --git a/tests/topotests/ospf6_gr_topo1/rt7/zebra.conf b/tests/topotests/ospf6_gr_topo1/rt7/zebra.conf
new file mode 100644 (file)
index 0000000..9cc8c29
--- /dev/null
@@ -0,0 +1,22 @@
+password 1
+hostname rt7
+log file zebra.log
+log commands
+!
+debug zebra event
+debug zebra packet
+debug zebra rib
+debug zebra kernel
+!
+interface lo
+ ip address 7.7.7.7/32
+ ipv6 address 2001:db8:1000::7/128
+!
+interface stub1
+!
+interface eth-rt6
+!
+ip forwarding
+!
+line vty
+!
diff --git a/tests/topotests/ospf6_gr_topo1/test_ospf6_gr_topo1.py b/tests/topotests/ospf6_gr_topo1/test_ospf6_gr_topo1.py
new file mode 100755 (executable)
index 0000000..ccbcadb
--- /dev/null
@@ -0,0 +1,381 @@
+#!/usr/bin/env python
+
+#
+# test_ospf6_gr_topo1.py
+# Part of NetDEF Topology Tests
+#
+# Copyright (c) 2021 by
+# Network Device Education Foundation, Inc. ("NetDEF")
+#
+# Permission to use, copy, modify, and/or distribute this software
+# for any purpose with or without fee is hereby granted, provided
+# that the above copyright notice and this permission notice appear
+# in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+
+"""
+test_ospf6_gr_topo1.py:
+
+             +---------+
+             |   RT1   |
+             | 1.1.1.1 |
+             +---------+
+                  |eth-rt2
+                  |
+                  |eth-rt1
+             +---------+
+             |   RT2   |
+             | 2.2.2.2 |
+             +---------+
+                  |eth-rt3
+                  |
+                  |eth-rt2
+             +---------+
+             |   RT3   |
+             | 3.3.3.3 |
+             +---------+
+          eth-rt4|  |eth-rt6
+                 |  |
+       +---------+  +--------+
+       |                     |
+       |eth-rt3              |eth-rt3
+  +---------+           +---------+
+  |   RT4   |           |   RT6   |
+  | 4.4.4.4 |           | 6.6.6.6 |
+  +---------+           +---------+
+       |eth-rt5              |eth-rt7
+       |                     |
+       |eth-rt4              |eth-rt6
+  +---------+           +---------+
+  |   RT5   |           |   RT7   |
+  | 5.5.5.5 |           | 7.7.7.7 |
+  +---------+           +---------+
+"""
+
+import os
+import sys
+import pytest
+import json
+from time import sleep
+from functools import partial
+
+# Save the Current Working Directory to find configuration files.
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+
+# pylint: disable=C0413
+# Import topogen and topotest helpers
+from lib import topotest
+from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topolog import logger
+from lib.common_config import (
+    kill_router_daemons,
+    start_router_daemons,
+)
+
+pytestmark = [pytest.mark.ospf6d]
+
+# Global multi-dimensional dictionary containing all expected outputs
+outputs = {}
+
+
+def build_topo(tgen):
+    #
+    # Define FRR Routers
+    #
+    for router in ["rt1", "rt2", "rt3", "rt4", "rt5", "rt6", "rt7"]:
+        tgen.add_router(router)
+
+    #
+    # Define connections
+    #
+    switch = tgen.add_switch("s1")
+    switch.add_link(tgen.gears["rt1"], nodeif="eth-rt2")
+    switch.add_link(tgen.gears["rt2"], nodeif="eth-rt1")
+
+    switch = tgen.add_switch("s2")
+    switch.add_link(tgen.gears["rt1"], nodeif="stub1")
+
+    switch = tgen.add_switch("s3")
+    switch.add_link(tgen.gears["rt2"], nodeif="eth-rt3")
+    switch.add_link(tgen.gears["rt3"], nodeif="eth-rt2")
+
+    switch = tgen.add_switch("s4")
+    switch.add_link(tgen.gears["rt3"], nodeif="eth-rt4")
+    switch.add_link(tgen.gears["rt4"], nodeif="eth-rt3")
+
+    switch = tgen.add_switch("s5")
+    switch.add_link(tgen.gears["rt3"], nodeif="eth-rt6")
+    switch.add_link(tgen.gears["rt6"], nodeif="eth-rt3")
+
+    switch = tgen.add_switch("s6")
+    switch.add_link(tgen.gears["rt4"], nodeif="eth-rt5")
+    switch.add_link(tgen.gears["rt5"], nodeif="eth-rt4")
+
+    switch = tgen.add_switch("s7")
+    switch.add_link(tgen.gears["rt6"], nodeif="eth-rt7")
+    switch.add_link(tgen.gears["rt7"], nodeif="eth-rt6")
+
+    switch = tgen.add_switch("s8")
+    switch.add_link(tgen.gears["rt7"], nodeif="stub1")
+
+
+def setup_module(mod):
+    "Sets up the pytest environment"
+    tgen = Topogen(build_topo, mod.__name__)
+    tgen.start_topology()
+
+    router_list = tgen.routers()
+
+    # For all registered routers, load the zebra configuration file
+    for rname, router in router_list.items():
+        router.load_config(
+            TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
+        )
+        router.load_config(
+            TopoRouter.RD_OSPF6, os.path.join(CWD, "{}/ospf6d.conf".format(rname))
+        )
+
+    tgen.start_router()
+
+
+def teardown_module(mod):
+    "Teardown the pytest environment"
+    tgen = get_topogen()
+
+    # This function tears down the whole topology.
+    tgen.stop_topology()
+
+
+def router_compare_json_output(rname, command, reference, tries):
+    "Compare router JSON output"
+
+    logger.info('Comparing router "%s" "%s" output', rname, command)
+
+    tgen = get_topogen()
+    filename = "{}/{}/{}".format(CWD, rname, reference)
+    expected = json.loads(open(filename).read())
+
+    test_func = partial(topotest.router_json_cmp, tgen.gears[rname], command, expected)
+    _, diff = topotest.run_and_expect(test_func, None, count=tries, wait=0.5)
+    assertmsg = '"{}" JSON output mismatches the expected result'.format(rname)
+    assert diff is None, assertmsg
+
+
+def check_routers(initial_convergence=False, exiting=None, restarting=None):
+    for rname in ["rt1", "rt2", "rt3", "rt4", "rt5", "rt6", "rt7"]:
+        # Check the RIB first, which should be preserved across restarts in
+        # all routers of the routing domain.
+        if initial_convergence == True:
+            tries = 240
+        else:
+            tries = 1
+        router_compare_json_output(
+            rname, "show ipv6 route ospf json", "show_ipv6_route.json", tries
+        )
+
+        # Check that all adjacencies are up and running (except when there's
+        # an OSPF instance that is shutting down).
+        if exiting == None:
+            tries = 240
+            router_compare_json_output(
+                rname,
+                "show ipv6 ospf neighbor json",
+                "show_ipv6_ospf_neighbor.json",
+                tries,
+            )
+
+        # Check the OSPF RIB and LSDB.
+        # In the restarting router, wait up to one minute for the LSDB to converge.
+        if exiting != rname:
+            if initial_convergence == True or restarting == rname:
+                tries = 240
+            else:
+                tries = 1
+            router_compare_json_output(
+                rname,
+                "show ipv6 ospf database json",
+                "show_ipv6_ospf_database.json",
+                tries,
+            )
+            router_compare_json_output(
+                rname, "show ipv6 ospf route json", "show_ipv6_ospf_route.json", tries
+            )
+
+
+#
+# Test initial network convergence
+#
+def test_initial_convergence():
+    logger.info("Test: verify initial network convergence")
+    tgen = get_topogen()
+
+    # Skip if previous fatal error condition is raised
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    check_routers(initial_convergence=True)
+
+
+#
+# Test rt1 performing a graceful restart
+#
+def test_gr_rt1():
+    logger.info("Test: verify rt1 performing a graceful restart")
+    tgen = get_topogen()
+
+    # Skip if previous fatal error condition is raised
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    tgen.net["rt1"].cmd('vtysh -c "graceful-restart prepare ipv6 ospf"')
+    sleep(5)
+    kill_router_daemons(tgen, "rt1", ["ospf6d"], save_config=False)
+    check_routers(exiting="rt1")
+
+    start_router_daemons(tgen, "rt1", ["ospf6d"])
+    check_routers(restarting="rt1")
+
+
+#
+# Test rt2 performing a graceful restart
+#
+def test_gr_rt2():
+    logger.info("Test: verify rt2 performing a graceful restart")
+    tgen = get_topogen()
+
+    # Skip if previous fatal error condition is raised
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    tgen.net["rt2"].cmd('vtysh -c "graceful-restart prepare ipv6 ospf"')
+    sleep(5)
+    kill_router_daemons(tgen, "rt2", ["ospf6d"], save_config=False)
+    check_routers(exiting="rt2")
+
+    start_router_daemons(tgen, "rt2", ["ospf6d"])
+    check_routers(restarting="rt2")
+
+
+#
+# Test rt3 performing a graceful restart
+#
+def test_gr_rt3():
+    logger.info("Test: verify rt3 performing a graceful restart")
+    tgen = get_topogen()
+
+    # Skip if previous fatal error condition is raised
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    tgen.net["rt3"].cmd('vtysh -c "graceful-restart prepare ipv6 ospf"')
+    sleep(5)
+    kill_router_daemons(tgen, "rt3", ["ospf6d"], save_config=False)
+    check_routers(exiting="rt3")
+
+    start_router_daemons(tgen, "rt3", ["ospf6d"])
+    check_routers(restarting="rt3")
+
+
+#
+# Test rt4 performing a graceful restart
+#
+def test_gr_rt4():
+    logger.info("Test: verify rt4 performing a graceful restart")
+    tgen = get_topogen()
+
+    # Skip if previous fatal error condition is raised
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    tgen.net["rt4"].cmd('vtysh -c "graceful-restart prepare ipv6 ospf"')
+    sleep(5)
+    kill_router_daemons(tgen, "rt4", ["ospf6d"], save_config=False)
+    check_routers(exiting="rt4")
+
+    start_router_daemons(tgen, "rt4", ["ospf6d"])
+    check_routers(restarting="rt4")
+
+
+#
+# Test rt5 performing a graceful restart
+#
+def test_gr_rt5():
+    logger.info("Test: verify rt5 performing a graceful restart")
+    tgen = get_topogen()
+
+    # Skip if previous fatal error condition is raised
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    tgen.net["rt5"].cmd('vtysh -c "graceful-restart prepare ipv6 ospf"')
+    sleep(5)
+    kill_router_daemons(tgen, "rt5", ["ospf6d"], save_config=False)
+    check_routers(exiting="rt5")
+
+    start_router_daemons(tgen, "rt5", ["ospf6d"])
+    check_routers(restarting="rt5")
+
+
+#
+# Test rt6 performing a graceful restart
+#
+def test_gr_rt6():
+    logger.info("Test: verify rt6 performing a graceful restart")
+    tgen = get_topogen()
+
+    # Skip if previous fatal error condition is raised
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    tgen.net["rt6"].cmd('vtysh -c "graceful-restart prepare ipv6 ospf"')
+    sleep(5)
+    kill_router_daemons(tgen, "rt6", ["ospf6d"], save_config=False)
+    check_routers(exiting="rt6")
+
+    start_router_daemons(tgen, "rt6", ["ospf6d"])
+    check_routers(restarting="rt6")
+
+
+#
+# Test rt7 performing a graceful restart
+#
+def test_gr_rt7():
+    logger.info("Test: verify rt7 performing a graceful restart")
+    tgen = get_topogen()
+
+    # Skip if previous fatal error condition is raised
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    tgen.net["rt7"].cmd('vtysh -c "graceful-restart prepare ipv6 ospf"')
+    sleep(5)
+    kill_router_daemons(tgen, "rt7", ["ospf6d"], save_config=False)
+    check_routers(exiting="rt7")
+
+    start_router_daemons(tgen, "rt7", ["ospf6d"])
+    check_routers(restarting="rt7")
+
+
+# Memory leak test template
+def test_memory_leak():
+    "Run the memory leak test and report results."
+    tgen = get_topogen()
+    if not tgen.is_memleak_enabled():
+        pytest.skip("Memory leak test/report is disabled")
+
+    tgen.report_memory_leaks()
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))