From 66e5fbe08f1e7107d0b9f79b50ffd269c1ea97bc Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 20 Nov 2020 12:43:27 -0300 Subject: [PATCH] tests: add IS-IS classic LFA topotest This new topotest comprises of 13 testing steps and tests essentially all implemented LFA knobs. Signed-off-by: Renato Westphal --- tests/topotests/isis-lfa-topo1/__init__.py | 0 tests/topotests/isis-lfa-topo1/rt1/isisd.conf | 52 ++ .../rt1/step1/show_ipv6_route.ref | 236 ++++++++ .../show_yang_interface_isis_adjacencies.ref | 101 ++++ .../rt1/step10/show_ipv6_route.ref.diff | 46 ++ .../rt1/step11/show_ipv6_route.ref.diff | 23 + .../rt1/step12/show_ipv6_route.ref.diff | 107 ++++ .../rt1/step13/show_ipv6_route.ref.diff | 45 ++ .../rt1/step2/show_ipv6_route.ref.diff | 164 ++++++ .../rt1/step3/show_ipv6_route.ref.diff | 164 ++++++ .../rt1/step4/show_ipv6_route.ref.diff | 142 +++++ .../rt1/step5/show_ipv6_route.ref.diff | 142 +++++ .../rt1/step6/show_ipv6_route.ref.diff | 164 ++++++ .../rt1/step7/show_ipv6_route.ref.diff | 37 ++ .../rt1/step8/show_ipv6_route.ref.diff | 129 +++++ .../rt1/step9/show_ipv6_route.ref.diff | 46 ++ tests/topotests/isis-lfa-topo1/rt1/zebra.conf | 16 + tests/topotests/isis-lfa-topo1/rt2/isisd.conf | 39 ++ .../rt2/step1/show_ipv6_route.ref | 162 ++++++ .../show_yang_interface_isis_adjacencies.ref | 63 ++ tests/topotests/isis-lfa-topo1/rt2/zebra.conf | 16 + tests/topotests/isis-lfa-topo1/rt3/isisd.conf | 38 ++ .../rt3/step1/show_ipv6_route.ref | 188 ++++++ .../show_yang_interface_isis_adjacencies.ref | 63 ++ tests/topotests/isis-lfa-topo1/rt3/zebra.conf | 16 + tests/topotests/isis-lfa-topo1/rt4/isisd.conf | 32 + .../rt4/step1/show_ipv6_route.ref | 172 ++++++ .../show_yang_interface_isis_adjacencies.ref | 44 ++ tests/topotests/isis-lfa-topo1/rt4/zebra.conf | 16 + tests/topotests/isis-lfa-topo1/rt5/isisd.conf | 32 + .../rt5/step1/show_ipv6_route.ref | 176 ++++++ .../show_yang_interface_isis_adjacencies.ref | 44 ++ tests/topotests/isis-lfa-topo1/rt5/zebra.conf | 16 + tests/topotests/isis-lfa-topo1/rt6/isisd.conf | 31 + .../rt6/step1/show_ipv6_route.ref | 172 ++++++ .../show_yang_interface_isis_adjacencies.ref | 44 ++ tests/topotests/isis-lfa-topo1/rt6/zebra.conf | 16 + tests/topotests/isis-lfa-topo1/rt7/isisd.conf | 51 ++ .../rt7/step1/show_ipv6_route.ref | 186 ++++++ .../show_yang_interface_isis_adjacencies.ref | 101 ++++ tests/topotests/isis-lfa-topo1/rt7/zebra.conf | 16 + .../isis-lfa-topo1/test_isis_lfa_topo1.py | 545 ++++++++++++++++++ 42 files changed, 3893 insertions(+) create mode 100644 tests/topotests/isis-lfa-topo1/__init__.py create mode 100644 tests/topotests/isis-lfa-topo1/rt1/isisd.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step10/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step11/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step12/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step13/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step2/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step3/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step4/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step5/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step6/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step7/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step8/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/step9/show_ipv6_route.ref.diff create mode 100644 tests/topotests/isis-lfa-topo1/rt1/zebra.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt2/isisd.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt2/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt2/zebra.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt3/isisd.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt3/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt3/zebra.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt4/isisd.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt4/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt4/zebra.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt5/isisd.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt5/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt5/zebra.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt6/isisd.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt6/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt6/zebra.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt7/isisd.conf create mode 100644 tests/topotests/isis-lfa-topo1/rt7/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt7/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-lfa-topo1/rt7/zebra.conf create mode 100755 tests/topotests/isis-lfa-topo1/test_isis_lfa_topo1.py diff --git a/tests/topotests/isis-lfa-topo1/__init__.py b/tests/topotests/isis-lfa-topo1/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/topotests/isis-lfa-topo1/rt1/isisd.conf b/tests/topotests/isis-lfa-topo1/rt1/isisd.conf new file mode 100644 index 0000000000..2ad8c12538 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/isisd.conf @@ -0,0 +1,52 @@ +password 1 +hostname rt1 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis lsp-gen +! +interface lo + ipv6 router isis 1 + isis passive +! +interface eth-rt2 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt3 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt4 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt5 + ipv6 router isis 1 + isis metric 20 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt6 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +router isis 1 + net 49.0000.0000.0000.0001.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast + !fast-reroute lfa tiebreaker node-protecting index 10 + !fast-reroute lfa tiebreaker downstream index 20 + !fast-reroute lfa tiebreaker lowest-backup-metric index 30 diff --git a/tests/topotests/isis-lfa-topo1/rt1/step1/show_ipv6_route.ref b/tests/topotests/isis-lfa-topo1/rt1/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..10c61d53e3 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step1/show_ipv6_route.ref @@ -0,0 +1,236 @@ +{ + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ + 0, + 1, + 2 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true, + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0, + 1, + 2, + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "2001:db8:1000::7\/128":[ + { + "prefix":"2001:db8:1000::7\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":25, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ + 0, + 1, + 2, + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-lfa-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-lfa-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d8a7c5a9c4 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,101 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0002", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt3", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0003", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt4", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0004", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt5", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0005", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt6", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0006", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-lfa-topo1/rt1/step10/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step10/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..d626cdca02 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step10/show_ipv6_route.ref.diff @@ -0,0 +1,46 @@ +--- a/rt1/step9/show_ipv6_route.ref ++++ b/rt1/step10/show_ipv6_route.ref +@@ -16,7 +16,8 @@ + "active":true, + "backupIndex":[ + 0, +- 1 ++ 1, ++ 2 + ] + } + ], +@@ -30,6 +31,11 @@ + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", ++ "active":true + } + ] + } +@@ -198,7 +204,8 @@ + "backupIndex":[ + 0, + 1, +- 2 ++ 2, ++ 3 + ] + } + ], +@@ -217,6 +224,11 @@ + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", ++ "active":true + } + ] + } diff --git a/tests/topotests/isis-lfa-topo1/rt1/step11/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step11/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..f7f99c276e --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step11/show_ipv6_route.ref.diff @@ -0,0 +1,23 @@ +--- a/rt1/step10/show_ipv6_route.ref ++++ b/rt1/step11/show_ipv6_route.ref +@@ -204,19 +204,13 @@ + "backupIndex":[ + 0, + 1, +- 2, +- 3 ++ 2 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", +- "interfaceName":"eth-rt3", +- "active":true +- }, +- { +- "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true + }, diff --git a/tests/topotests/isis-lfa-topo1/rt1/step12/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step12/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..3b767f1bf6 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step12/show_ipv6_route.ref.diff @@ -0,0 +1,107 @@ +--- a/rt1/step11/show_ipv6_route.ref ++++ b/rt1/step12/show_ipv6_route.ref +@@ -15,9 +15,7 @@ + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ +- 0, +- 1, +- 2 ++ 0 + ] + } + ], +@@ -26,16 +24,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", +- "active":true + } + ] + } +@@ -56,8 +44,7 @@ + "interfaceName":"eth-rt3", + "active":true, + "backupIndex":[ +- 0, +- 1 ++ 0 + ] + } + ], +@@ -66,11 +53,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true + } + ] + } +@@ -120,10 +102,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ +- 0, +- 1, +- 2, +- 3 ++ 0 + ] + } + ], +@@ -132,21 +111,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt3", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", +- "active":true + } + ] + } +@@ -203,19 +167,13 @@ + "active":true, + "backupIndex":[ + 0, +- 1, +- 2 ++ 1 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", +- "interfaceName":"eth-rt4", +- "active":true +- }, +- { +- "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true + }, diff --git a/tests/topotests/isis-lfa-topo1/rt1/step13/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step13/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..504af5ac58 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step13/show_ipv6_route.ref.diff @@ -0,0 +1,45 @@ +--- a/rt1/step12/show_ipv6_route.ref ++++ b/rt1/step13/show_ipv6_route.ref +@@ -131,8 +131,7 @@ + "interfaceName":"eth-rt6", + "active":true, + "backupIndex":[ +- 0, +- 1 ++ 0 + ] + } + ], +@@ -141,11 +140,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true + } + ] + } +@@ -166,19 +160,13 @@ + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ +- 0, +- 1 ++ 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true +- }, +- { +- "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true + } diff --git a/tests/topotests/isis-lfa-topo1/rt1/step2/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step2/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..efc56d9835 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step2/show_ipv6_route.ref.diff @@ -0,0 +1,164 @@ +--- a/rt1/step1/show_ipv6_route.ref ++++ b/rt1/step2/show_ipv6_route.ref +@@ -13,28 +13,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", +- "active":true, +- "backupIndex":[ +- 0, +- 1, +- 2 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt3", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", + "active":true + } + ] +@@ -54,22 +32,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3", +- "active":true, +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt2", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -89,16 +51,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true, +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -118,34 +70,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true, +- "backupIndex":[ +- 0, +- 1, +- 2, +- 3 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt2", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt3", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", + "active":true + } + ] +@@ -165,22 +89,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true, +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt2", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -200,34 +108,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", +- "active":true, +- "backupIndex":[ +- 0, +- 1, +- 2, +- 3 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt3", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", + "active":true + } + ] diff --git a/tests/topotests/isis-lfa-topo1/rt1/step3/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step3/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..cafbe490b5 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step3/show_ipv6_route.ref.diff @@ -0,0 +1,164 @@ +--- a/rt1/step2/show_ipv6_route.ref ++++ b/rt1/step3/show_ipv6_route.ref +@@ -13,6 +13,28 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1, ++ 2 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt3", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", + "active":true + } + ] +@@ -32,6 +54,22 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt2", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -51,6 +89,16 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", ++ "active":true, ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -70,6 +118,34 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1, ++ 2, ++ 3 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt2", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt3", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", + "active":true + } + ] +@@ -89,6 +165,22 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt2", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -108,6 +200,34 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1, ++ 2, ++ 3 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt3", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", + "active":true + } + ] diff --git a/tests/topotests/isis-lfa-topo1/rt1/step4/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step4/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..47d8334a05 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step4/show_ipv6_route.ref.diff @@ -0,0 +1,142 @@ +--- a/rt1/step3/show_ipv6_route.ref ++++ b/rt1/step4/show_ipv6_route.ref +@@ -15,9 +15,7 @@ + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ +- 0, +- 1, +- 2 ++ 0 + ] + } + ], +@@ -26,16 +24,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", +- "active":true + } + ] + } +@@ -56,8 +44,7 @@ + "interfaceName":"eth-rt3", + "active":true, + "backupIndex":[ +- 0, +- 1 ++ 0 + ] + } + ], +@@ -66,11 +53,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true + } + ] + } +@@ -120,10 +102,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ +- 0, +- 1, +- 2, +- 3 ++ 0 + ] + } + ], +@@ -132,21 +111,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt3", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", +- "active":true + } + ] + } +@@ -167,8 +131,7 @@ + "interfaceName":"eth-rt6", + "active":true, + "backupIndex":[ +- 0, +- 1 ++ 0 + ] + } + ], +@@ -177,11 +140,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true + } + ] + } +@@ -202,10 +160,7 @@ + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ +- 0, +- 1, +- 2, +- 3 ++ 0 + ] + } + ], +@@ -214,21 +169,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", +- "active":true + } + ] + } diff --git a/tests/topotests/isis-lfa-topo1/rt1/step5/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step5/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..b6a342df88 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step5/show_ipv6_route.ref.diff @@ -0,0 +1,142 @@ +--- a/rt1/step4/show_ipv6_route.ref ++++ b/rt1/step5/show_ipv6_route.ref +@@ -15,7 +15,9 @@ + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ +- 0 ++ 0, ++ 1, ++ 2 + ] + } + ], +@@ -24,6 +26,16 @@ + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", ++ "active":true + } + ] + } +@@ -44,7 +56,8 @@ + "interfaceName":"eth-rt3", + "active":true, + "backupIndex":[ +- 0 ++ 0, ++ 1 + ] + } + ], +@@ -53,6 +66,11 @@ + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", ++ "active":true + } + ] + } +@@ -102,7 +120,10 @@ + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ +- 0 ++ 0, ++ 1, ++ 2, ++ 3 + ] + } + ], +@@ -111,6 +132,21 @@ + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt3", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", ++ "active":true + } + ] + } +@@ -131,7 +167,8 @@ + "interfaceName":"eth-rt6", + "active":true, + "backupIndex":[ +- 0 ++ 0, ++ 1 + ] + } + ], +@@ -140,6 +177,11 @@ + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", ++ "active":true + } + ] + } +@@ -160,7 +202,10 @@ + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ +- 0 ++ 0, ++ 1, ++ 2, ++ 3 + ] + } + ], +@@ -169,6 +214,21 @@ + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", ++ "active":true + } + ] + } diff --git a/tests/topotests/isis-lfa-topo1/rt1/step6/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step6/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..fafa2999d1 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step6/show_ipv6_route.ref.diff @@ -0,0 +1,164 @@ +--- a/rt1/step5/show_ipv6_route.ref ++++ b/rt1/step6/show_ipv6_route.ref +@@ -13,28 +13,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", +- "active":true, +- "backupIndex":[ +- 0, +- 1, +- 2 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt3", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", + "active":true + } + ] +@@ -54,22 +32,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3", +- "active":true, +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt2", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -89,16 +51,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true, +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -118,34 +70,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true, +- "backupIndex":[ +- 0, +- 1, +- 2, +- 3 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt2", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt3", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", + "active":true + } + ] +@@ -165,22 +89,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true, +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt2", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -200,34 +108,6 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", +- "active":true, +- "backupIndex":[ +- 0, +- 1, +- 2, +- 3 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt3", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", + "active":true + } + ] diff --git a/tests/topotests/isis-lfa-topo1/rt1/step7/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step7/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..1803e2cf5c --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step7/show_ipv6_route.ref.diff @@ -0,0 +1,37 @@ +--- a/rt1/step6/show_ipv6_route.ref ++++ b/rt1/step7/show_ipv6_route.ref +@@ -108,6 +108,34 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1, ++ 2, ++ 3 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt3", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", + "active":true + } + ] diff --git a/tests/topotests/isis-lfa-topo1/rt1/step8/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step8/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..306f725340 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step8/show_ipv6_route.ref.diff @@ -0,0 +1,129 @@ +--- a/rt1/step7/show_ipv6_route.ref ++++ b/rt1/step8/show_ipv6_route.ref +@@ -13,6 +13,28 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1, ++ 2 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt3", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", + "active":true + } + ] +@@ -32,6 +54,22 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt2", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -51,6 +89,16 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", ++ "active":true, ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", + "active":true + } + ] +@@ -70,6 +118,34 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1, ++ 2, ++ 3 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt2", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt3", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", + "active":true + } + ] +@@ -89,6 +165,22 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt2", ++ "active":true ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", + "active":true + } + ] diff --git a/tests/topotests/isis-lfa-topo1/rt1/step9/show_ipv6_route.ref.diff b/tests/topotests/isis-lfa-topo1/rt1/step9/show_ipv6_route.ref.diff new file mode 100644 index 0000000000..3ffab46eeb --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/step9/show_ipv6_route.ref.diff @@ -0,0 +1,46 @@ +--- a/rt1/step8/show_ipv6_route.ref ++++ b/rt1/step9/show_ipv6_route.ref +@@ -16,8 +16,7 @@ + "active":true, + "backupIndex":[ + 0, +- 1, +- 2 ++ 1 + ] + } + ], +@@ -31,11 +30,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", +- "active":true + } + ] + } +@@ -204,8 +198,7 @@ + "backupIndex":[ + 0, + 1, +- 2, +- 3 ++ 2 + ] + } + ], +@@ -224,11 +217,6 @@ + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", +- "active":true + } + ] + } diff --git a/tests/topotests/isis-lfa-topo1/rt1/zebra.conf b/tests/topotests/isis-lfa-topo1/rt1/zebra.conf new file mode 100644 index 0000000000..317f1031df --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt1/zebra.conf @@ -0,0 +1,16 @@ +log file zebra.log +! +hostname rt1 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 1.1.1.1/32 + ipv6 address 2001:db8:1000::1/128 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-lfa-topo1/rt2/isisd.conf b/tests/topotests/isis-lfa-topo1/rt2/isisd.conf new file mode 100644 index 0000000000..39ff2570d4 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt2/isisd.conf @@ -0,0 +1,39 @@ +password 1 +hostname rt2 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis lsp-gen +! +interface lo + ipv6 router isis 1 + isis passive +! +interface eth-rt1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt3 + ipv6 router isis 1 + isis metric 5 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt7 + ipv6 router isis 1 + isis metric 5 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +router isis 1 + net 49.0000.0000.0000.0002.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast +! diff --git a/tests/topotests/isis-lfa-topo1/rt2/step1/show_ipv6_route.ref b/tests/topotests/isis-lfa-topo1/rt2/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..036bfe1f4f --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt2/step1/show_ipv6_route.ref @@ -0,0 +1,162 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":15, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":25, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":25, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::7\/128":[ + { + "prefix":"2001:db8:1000::7\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":15, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-lfa-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-lfa-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..681c5222ad --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,63 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0001", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt3", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0003", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt7", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0007", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-lfa-topo1/rt2/zebra.conf b/tests/topotests/isis-lfa-topo1/rt2/zebra.conf new file mode 100644 index 0000000000..9feaada791 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt2/zebra.conf @@ -0,0 +1,16 @@ +log file zebra.log +! +hostname rt2 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 2.2.2.2/32 + ipv6 address 2001:db8:1000::2/128 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-lfa-topo1/rt3/isisd.conf b/tests/topotests/isis-lfa-topo1/rt3/isisd.conf new file mode 100644 index 0000000000..8b0c7bd0dc --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt3/isisd.conf @@ -0,0 +1,38 @@ +password 1 +hostname rt3 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis lsp-gen +! +interface lo + ipv6 router isis 1 + isis passive +! +interface eth-rt1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt2 + ipv6 router isis 1 + isis metric 5 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt7 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +router isis 1 + net 49.0000.0000.0000.0003.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast +! diff --git a/tests/topotests/isis-lfa-topo1/rt3/step1/show_ipv6_route.ref b/tests/topotests/isis-lfa-topo1/rt3/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..a1aab400e4 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt3/step1/show_ipv6_route.ref @@ -0,0 +1,188 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true, + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":15, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true, + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::7\/128":[ + { + "prefix":"2001:db8:1000::7\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-lfa-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-lfa-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1495e32284 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,63 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0001", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt2", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0002", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt7", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0007", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-lfa-topo1/rt3/zebra.conf b/tests/topotests/isis-lfa-topo1/rt3/zebra.conf new file mode 100644 index 0000000000..48d732e72a --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt3/zebra.conf @@ -0,0 +1,16 @@ +log file zebra.log +! +hostname rt3 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 3.3.3.3/32 + ipv6 address 2001:db8:1000::3/128 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-lfa-topo1/rt4/isisd.conf b/tests/topotests/isis-lfa-topo1/rt4/isisd.conf new file mode 100644 index 0000000000..86edee6ab1 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt4/isisd.conf @@ -0,0 +1,32 @@ +password 1 +hostname rt4 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis lsp-gen +! +interface lo + ipv6 router isis 1 + isis passive +! +interface eth-rt1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt7 + ipv6 router isis 1 + isis metric 15 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +router isis 1 + net 49.0000.0000.0000.0004.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast +! diff --git a/tests/topotests/isis-lfa-topo1/rt4/step1/show_ipv6_route.ref b/tests/topotests/isis-lfa-topo1/rt4/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..6878e2fac0 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt4/step1/show_ipv6_route.ref @@ -0,0 +1,172 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":35, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::7\/128":[ + { + "prefix":"2001:db8:1000::7\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":25, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-lfa-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-lfa-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d8cd565b5b --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,44 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0001", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt7", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0007", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-lfa-topo1/rt4/zebra.conf b/tests/topotests/isis-lfa-topo1/rt4/zebra.conf new file mode 100644 index 0000000000..bff10860cc --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt4/zebra.conf @@ -0,0 +1,16 @@ +log file zebra.log +! +hostname rt4 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 4.4.4.4/32 + ipv6 address 2001:db8:1000::4/128 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-lfa-topo1/rt5/isisd.conf b/tests/topotests/isis-lfa-topo1/rt5/isisd.conf new file mode 100644 index 0000000000..7a7cfe557d --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt5/isisd.conf @@ -0,0 +1,32 @@ +password 1 +hostname rt5 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis lsp-gen +! +interface lo + ipv6 router isis 1 + isis passive +! +interface eth-rt1 + ipv6 router isis 1 + isis metric 20 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt7 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +router isis 1 + net 49.0000.0000.0000.0005.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast +! diff --git a/tests/topotests/isis-lfa-topo1/rt5/step1/show_ipv6_route.ref b/tests/topotests/isis-lfa-topo1/rt5/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..f8181c7769 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt5/step1/show_ipv6_route.ref @@ -0,0 +1,176 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":25, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":35, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::7\/128":[ + { + "prefix":"2001:db8:1000::7\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-lfa-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-lfa-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d8cd565b5b --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,44 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0001", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt7", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0007", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-lfa-topo1/rt5/zebra.conf b/tests/topotests/isis-lfa-topo1/rt5/zebra.conf new file mode 100644 index 0000000000..ee1e46c966 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt5/zebra.conf @@ -0,0 +1,16 @@ +log file zebra.log +! +hostname rt5 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 5.5.5.5/32 + ipv6 address 2001:db8:1000::5/128 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-lfa-topo1/rt6/isisd.conf b/tests/topotests/isis-lfa-topo1/rt6/isisd.conf new file mode 100644 index 0000000000..20cb7769a4 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt6/isisd.conf @@ -0,0 +1,31 @@ +password 1 +hostname rt6 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis lsp-gen +! +interface lo + ipv6 router isis 1 + isis passive +! +interface eth-rt1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt7 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +router isis 1 + net 49.0000.0000.0000.0006.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast +! diff --git a/tests/topotests/isis-lfa-topo1/rt6/step1/show_ipv6_route.ref b/tests/topotests/isis-lfa-topo1/rt6/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..e5f3c77ac5 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt6/step1/show_ipv6_route.ref @@ -0,0 +1,172 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":25, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ], + "2001:db8:1000::7\/128":[ + { + "prefix":"2001:db8:1000::7\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt7", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt1", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-lfa-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-lfa-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d8cd565b5b --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,44 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0001", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt7", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0007", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-lfa-topo1/rt6/zebra.conf b/tests/topotests/isis-lfa-topo1/rt6/zebra.conf new file mode 100644 index 0000000000..4108078896 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt6/zebra.conf @@ -0,0 +1,16 @@ +log file zebra.log +! +hostname rt6 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 6.6.6.6/32 + ipv6 address 2001:db8:1000::6/128 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-lfa-topo1/rt7/isisd.conf b/tests/topotests/isis-lfa-topo1/rt7/isisd.conf new file mode 100644 index 0000000000..713e6d39f4 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt7/isisd.conf @@ -0,0 +1,51 @@ +password 1 +hostname rt6 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis lsp-gen +! +interface lo + ipv6 router isis 1 + isis passive +! +interface eth-rt2 + ipv6 router isis 1 + isis metric 5 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt3 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt4 + ipv6 router isis 1 + isis metric 15 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt5 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +interface eth-rt6 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute lfa +! +router isis 1 + net 49.0000.0000.0000.0007.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast +! diff --git a/tests/topotests/isis-lfa-topo1/rt7/step1/show_ipv6_route.ref b/tests/topotests/isis-lfa-topo1/rt7/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..0dff15e3fd --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt7/step1/show_ipv6_route.ref @@ -0,0 +1,186 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":25, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ + 0, + 1, + 2, + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":15, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2", + "active":true + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":25, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt3", + "active":true + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-lfa-topo1/rt7/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-lfa-topo1/rt7/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d8a7c5a9c4 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt7/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,101 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0002", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt3", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0003", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt4", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0004", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt5", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0005", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt6", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0006", + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-lfa-topo1/rt7/zebra.conf b/tests/topotests/isis-lfa-topo1/rt7/zebra.conf new file mode 100644 index 0000000000..353c9efa93 --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/rt7/zebra.conf @@ -0,0 +1,16 @@ +log file zebra.log +! +hostname rt7 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 7.7.7.7/32 + ipv6 address 2001:db8:1000::7/128 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-lfa-topo1/test_isis_lfa_topo1.py b/tests/topotests/isis-lfa-topo1/test_isis_lfa_topo1.py new file mode 100755 index 0000000000..67edcae90e --- /dev/null +++ b/tests/topotests/isis-lfa-topo1/test_isis_lfa_topo1.py @@ -0,0 +1,545 @@ +#!/usr/bin/env python + +# +# test_isis_tilfa_topo1.py +# Part of NetDEF Topology Tests +# +# Copyright (c) 2020 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_isis_lfa_topo1.py: + + +---------+ + | | + +--------------------------------+ RT1 +-------------------------------+ + | +-------------+ +-------------+ | + | | | | | | + | | +----+----+ | | + | | | |20 | + | | | | | + | | | | | + +----+----+ +----+----+ +----+----+ +----+----+ +----+----+ + | | | | | | | | | | + | RT2 | 5 | RT3 | | RT4 | | RT5 | | RT6 | + | +--------+ | | | | | | | + | | | | | | | | | | + +----+----+ +----+----+ +----+----+ +----+----+ +----+----+ + | | | | | + | | |15 | | + |5 | | | | + | | +----+----+ | | + | | | | | | + | +-------------+ RT7 +-------------+ | + +--------------------------------+ +-------------------------------+ + | | + +---------+ +""" + +import os +import sys +import pytest +import json +import re +import tempfile +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 + +# Required to instantiate the topology builder class. +from mininet.topo import Topo + +# Global multi-dimensional dictionary containing all expected outputs +outputs = {} + +class TemplateTopo(Topo): + "Test topology builder" + def build(self, *_args, **_opts): + "Build function" + tgen = get_topogen(self) + + # + # 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['rt2'], nodeif="eth-rt3") + switch.add_link(tgen.gears['rt3'], nodeif="eth-rt2") + switch = tgen.add_switch('s3') + switch.add_link(tgen.gears['rt1'], nodeif="eth-rt3") + switch.add_link(tgen.gears['rt3'], nodeif="eth-rt1") + switch = tgen.add_switch('s4') + switch.add_link(tgen.gears['rt1'], nodeif="eth-rt4") + switch.add_link(tgen.gears['rt4'], nodeif="eth-rt1") + switch = tgen.add_switch('s5') + switch.add_link(tgen.gears['rt1'], nodeif="eth-rt5") + switch.add_link(tgen.gears['rt5'], nodeif="eth-rt1") + switch = tgen.add_switch('s6') + switch.add_link(tgen.gears['rt1'], nodeif="eth-rt6") + switch.add_link(tgen.gears['rt6'], nodeif="eth-rt1") + switch = tgen.add_switch('s7') + switch.add_link(tgen.gears['rt2'], nodeif="eth-rt7") + switch.add_link(tgen.gears['rt7'], nodeif="eth-rt2") + switch = tgen.add_switch('s8') + switch.add_link(tgen.gears['rt3'], nodeif="eth-rt7") + switch.add_link(tgen.gears['rt7'], nodeif="eth-rt3") + switch = tgen.add_switch('s9') + switch.add_link(tgen.gears['rt4'], nodeif="eth-rt7") + switch.add_link(tgen.gears['rt7'], nodeif="eth-rt4") + switch = tgen.add_switch('s10') + switch.add_link(tgen.gears['rt5'], nodeif="eth-rt7") + switch.add_link(tgen.gears['rt7'], nodeif="eth-rt5") + switch = tgen.add_switch('s11') + switch.add_link(tgen.gears['rt6'], nodeif="eth-rt7") + switch.add_link(tgen.gears['rt7'], nodeif="eth-rt6") + + # + # Populate multi-dimensional dictionary containing all expected outputs + # + files = ["show_ipv6_route.ref", + "show_yang_interface_isis_adjacencies.ref"] + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6', 'rt7']: + outputs[rname] = {} + for step in range(1, 13 + 1): + outputs[rname][step] = {} + for file in files: + if step == 1: + # Get snapshots relative to the expected initial network convergence + filename = '{}/{}/step{}/{}'.format(CWD, rname, step, file) + outputs[rname][step][file] = open(filename).read() + else: + if rname != "rt1": + continue + if file == "show_yang_interface_isis_adjacencies.ref": + continue + + # Get diff relative to the previous step + filename = '{}/{}/step{}/{}.diff'.format(CWD, rname, step, file) + + # Create temporary files in order to apply the diff + f_in = tempfile.NamedTemporaryFile() + f_in.write(outputs[rname][step - 1][file]) + f_in.flush() + f_out = tempfile.NamedTemporaryFile() + os.system("patch -s -o %s %s %s" %(f_out.name, f_in.name, filename)) + + # Store the updated snapshot and remove the temporary files + outputs[rname][step][file] = open(f_out.name).read() + f_in.close() + f_out.close() + +def setup_module(mod): + "Sets up the pytest environment" + tgen = Topogen(TemplateTopo, mod.__name__) + tgen.start_topology() + + router_list = tgen.routers() + + # For all registered routers, load the zebra configuration file + for rname, router in router_list.iteritems(): + router.load_config( + TopoRouter.RD_ZEBRA, + os.path.join(CWD, '{}/zebra.conf'.format(rname)) + ) + router.load_config( + TopoRouter.RD_ISIS, + os.path.join(CWD, '{}/isisd.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): + "Compare router JSON output" + + logger.info('Comparing router "%s" "%s" output', rname, command) + + tgen = get_topogen() + expected = json.loads(reference) + + # Run test function until we get an result. Wait at most 60 seconds. + test_func = partial(topotest.router_json_cmp, + tgen.gears[rname], command, expected) + _, diff = topotest.run_and_expect(test_func, None, count=120, wait=0.5) + assertmsg = '"{}" JSON output mismatches the expected result'.format(rname) + assert diff is None, assertmsg + +# +# Step 1 +# +# Test initial network convergence +# +def test_isis_adjacencies_step1(): + logger.info("Test (step 1): check IS-IS adjacencies") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6', 'rt7']: + router_compare_json_output(rname, "show yang operational-data /frr-interface:lib isisd", + outputs[rname][1]["show_yang_interface_isis_adjacencies.ref"]) + +def test_rib_ipv6_step1(): + logger.info("Test (step 1): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6', 'rt7']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][1]["show_ipv6_route.ref"]) + +# +# Step 2 +# +# Action(s): +# -Disable LFA protection on all interfaces +# +# Expected changes: +# -rt1 should uninstall all backup nexthops from all routes +# +def test_rib_ipv6_step2(): + logger.info("Test (step 2): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Disabling LFA protection on all rt1 interfaces') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt2" -c "no isis fast-reroute lfa"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt3" -c "no isis fast-reroute lfa"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt4" -c "no isis fast-reroute lfa"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt5" -c "no isis fast-reroute lfa"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt6" -c "no isis fast-reroute lfa"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][2]["show_ipv6_route.ref"]) + +# +# Step 3 +# +# Action(s): +# -Re-enable LFA protection on all interfaces +# +# Expected changes: +# -Revert changes from the previous step +# +def test_rib_ipv6_step3(): + logger.info("Test (step 3): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Re-enabling LFA protection on all rt1 interfaces') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt2" -c "isis fast-reroute lfa"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt3" -c "isis fast-reroute lfa"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt4" -c "isis fast-reroute lfa"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt5" -c "isis fast-reroute lfa"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt6" -c "isis fast-reroute lfa"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][3]["show_ipv6_route.ref"]) + +# +# Step 4 +# +# Action(s): +# -Disable LFA load-sharing +# +# Expected changes: +# -rt1 should use at most one backup nexthop for each route +# +def test_rib_ipv6_step4(): + logger.info("Test (step 4): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Disabling LFA load-sharing on rt1') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "fast-reroute load-sharing disable"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][4]["show_ipv6_route.ref"]) + +# +# Step 5 +# +# Action(s): +# -Re-enable LFA load-sharing +# +# Expected changes: +# -Revert changes from the previous step +# +def test_rib_ipv6_step5(): + logger.info("Test (step 5): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Re-enabling LFA load-sharing on rt1') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "no fast-reroute load-sharing disable"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][5]["show_ipv6_route.ref"]) + +# +# Step 6 +# +# Action(s): +# -Limit backup computation to critical priority prefixes only +# +# Expected changes: +# -rt1 should uninstall all backup nexthops from all routes +# +def test_rib_ipv6_step6(): + logger.info("Test (step 6): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Limiting backup computation to critical priority prefixes only') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "fast-reroute priority-limit critical"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][6]["show_ipv6_route.ref"]) + +# +# Step 7 +# +# Action(s): +# -Configure a prefix priority list to classify rt7's loopback as a +# critical-priority prefix +# +# Expected changes: +# -rt1 should install backup nexthops for rt7's loopback route. +# +def test_rib_ipv6_step7(): + logger.info("Test (step 7): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Configuring a prefix priority list') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "spf prefix-priority critical CRITICAL_DESTINATIONS"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "ipv6 access-list CRITICAL_DESTINATIONS seq 5 permit 2001:db8:1000::7/128"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][7]["show_ipv6_route.ref"]) + +# +# Step 8 +# +# Action(s): +# -Revert previous changes related to prefix priorities +# +# Expected changes: +# -Revert changes from the previous two steps +# +def test_rib_ipv6_step8(): + logger.info("Test (step 8): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Reverting previous changes related to prefix priorities') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "no ipv6 access-list CRITICAL_DESTINATIONS seq 5 permit 2001:db8:1000::7/128"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "no fast-reroute priority-limit critical"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "no spf prefix-priority critical CRITICAL_DESTINATIONS"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][8]["show_ipv6_route.ref"]) + +# +# Step 9 +# +# Action(s): +# -Exclude eth-rt6 from LFA computation for eth-rt2's failure +# +# Expected changes: +# -Uninstall the eth-rt2 protecting backup nexthops that go through eth-rt6 +# +def test_rib_ipv6_step9(): + logger.info("Test (step 9): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Excluding eth-rt6 from LFA computation for eth-rt2\'s failure') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt2" -c "isis fast-reroute lfa exclude interface eth-rt6"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][9]["show_ipv6_route.ref"]) + +# +# Step 10 +# +# Action(s): +# -Remove exclusion of eth-rt6 from LFA computation for eth-rt2's failure +# +# Expected changes: +# -Revert changes from the previous step +# +def test_rib_ipv6_step10(): + logger.info("Test (step 10): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Removing exclusion of eth-rt6 from LFA computation for eth-rt2\'s failure') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "interface eth-rt2" -c "no isis fast-reroute lfa exclude interface eth-rt6"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][10]["show_ipv6_route.ref"]) + +# +# Step 11 +# +# Action(s): +# -Add LFA tiebreaker: prefer node protecting backup path +# +# Expected changes: +# -rt1 should prefer backup nexthops that provide node protection +# +def test_rib_ipv6_step11(): + logger.info("Test (step 11): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Adding LFA tiebreaker: prefer node protecting backup path') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "fast-reroute lfa tiebreaker node-protecting index 10"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][11]["show_ipv6_route.ref"]) + +# +# Step 12 +# +# Action(s): +# -Add LFA tiebreaker: prefer backup path via downstream node +# +# Expected changes: +# -rt1 should prefer backup nexthops that satisfy the downstream condition +# +def test_rib_ipv6_step12(): + logger.info("Test (step 12): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Adding LFA tiebreaker: prefer backup path via downstream node') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "fast-reroute lfa tiebreaker downstream index 20"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][12]["show_ipv6_route.ref"]) + +# +# Step 13 +# +# Action(s): +# -Add LFA tiebreaker: prefer backup path with lowest total metric +# +# Expected changes: +# -rt1 should prefer backup nexthops that have the best metric +# +def test_rib_ipv6_step13(): + logger.info("Test (step 13): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Adding LFA tiebreaker: prefer backup path with lowest total metric') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "fast-reroute lfa tiebreaker lowest-backup-metric index 30"') + + for rname in ['rt1']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][13]["show_ipv6_route.ref"]) + +# 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)) -- 2.39.5