From 61a7d55fb0341c0f7d826861a89cf531c22b77cd Mon Sep 17 00:00:00 2001 From: Pushpasis Sarkar Date: Mon, 22 Aug 2022 08:53:59 -0700 Subject: [PATCH] tests: Add Topotests for Flexible-Algorithm implementation in OSPFv2 This commit adds topotests for Flexible-Algorithm implementation in OSPFv2. Signed-off-by: Pushpasis Sarkar --- .../topotests/ospf_flexalgo_topo1/__init__.py | 0 .../ospf_flexalgo_topo1/rt1/ospfd.conf | 27 + .../ospf_flexalgo_topo1/rt1/ospfd_flxalg.conf | 37 + .../step1/show_ip_ospf_database_opaque.ref | 286 +++ .../rt1/step1/show_ip_ospf_flexalgo.ref | 17 + .../rt1/step1/show_ip_route.ref | 166 ++ .../step10/show_ip_ospf_database_opaque.ref | 286 +++ .../rt1/step10/show_ip_ospf_flexalgo.ref | 18 + .../step11/show_ip_ospf_database_opaque.ref | 280 +++ .../rt1/step11/show_ip_ospf_flexalgo.ref | 15 + .../step12/show_ip_ospf_database_opaque.ref | 286 +++ .../rt1/step12/show_ip_ospf_flexalgo.ref | 18 + .../step13/show_ip_ospf_database_opaque.ref | 280 +++ .../rt1/step13/show_ip_ospf_flexalgo.ref | 15 + .../step14/show_ip_ospf_database_opaque.ref | 286 +++ .../rt1/step14/show_ip_ospf_flexalgo.ref | 18 + .../step15/show_ip_ospf_database_opaque.ref | 280 +++ .../rt1/step15/show_ip_ospf_flexalgo.ref | 15 + .../step16/show_ip_ospf_database_opaque.ref | 227 ++ .../rt1/step16/show_ip_ospf_flexalgo.ref | 17 + .../step2/show_ip_ospf_database_opaque.ref | 296 +++ .../show_ip_ospf_database_opaque_mismatch.ref | 79 + .../rt1/step2/show_ip_ospf_flexalgo.ref | 17 + .../rt1/step2/show_ip_route.ref | 166 ++ .../step4/show_ip_ospf_database_opaque.ref | 286 +++ .../rt1/step4/show_ip_ospf_flexalgo.ref | 17 + .../step5/show_ip_ospf_database_opaque.ref | 286 +++ .../rt1/step5/show_ip_ospf_flexalgo.ref | 17 + .../step6/show_ip_ospf_database_opaque.ref | 286 +++ .../rt1/step6/show_ip_ospf_flexalgo.ref | 18 + .../step7/show_ip_ospf_database_opaque.ref | 280 +++ .../rt1/step7/show_ip_ospf_flexalgo.ref | 15 + .../step8/show_ip_ospf_database_opaque.ref | 286 +++ .../rt1/step8/show_ip_ospf_flexalgo.ref | 18 + .../step9/show_ip_ospf_database_opaque.ref | 280 +++ .../rt1/step9/show_ip_ospf_flexalgo.ref | 14 + .../ospf_flexalgo_topo1/rt1/zebra.conf | 21 + .../ospf_flexalgo_topo1/rt2/ospfd.conf | 30 + .../ospf_flexalgo_topo1/rt2/ospfd_flxalg.conf | 30 + .../step1/show_ip_ospf_database_opaque.ref | 286 +++ .../rt2/step1/show_ip_ospf_flexalgo.ref | 1 + .../rt2/step1/show_ip_route.ref | 168 ++ .../step10/show_ip_ospf_database_opaque.ref | 286 +++ .../rt2/step10/show_ip_ospf_flexalgo.ref | 1 + .../step11/show_ip_ospf_database_opaque.ref | 280 +++ .../rt2/step11/show_ip_ospf_flexalgo.ref | 1 + .../step12/show_ip_ospf_database_opaque.ref | 286 +++ .../rt2/step12/show_ip_ospf_flexalgo.ref | 1 + .../step13/show_ip_ospf_database_opaque.ref | 280 +++ .../rt2/step13/show_ip_ospf_flexalgo.ref | 1 + .../step14/show_ip_ospf_database_opaque.ref | 286 +++ .../rt2/step14/show_ip_ospf_flexalgo.ref | 1 + .../step15/show_ip_ospf_database_opaque.ref | 280 +++ .../rt2/step15/show_ip_ospf_flexalgo.ref | 1 + .../step16/show_ip_ospf_database_opaque.ref | 227 ++ .../rt2/step16/show_ip_ospf_flexalgo.ref | 1 + .../step2/show_ip_ospf_database_opaque.ref | 296 +++ .../show_ip_ospf_database_opaque_mismatch.ref | 79 + .../rt2/step2/show_ip_ospf_flexalgo.ref | 1 + .../rt2/step2/show_ip_route.ref | 168 ++ .../step4/show_ip_ospf_database_opaque.ref | 286 +++ .../rt2/step4/show_ip_ospf_flexalgo.ref | 1 + .../step5/show_ip_ospf_database_opaque.ref | 286 +++ .../rt2/step5/show_ip_ospf_flexalgo.ref | 1 + .../step6/show_ip_ospf_database_opaque.ref | 286 +++ .../rt2/step6/show_ip_ospf_flexalgo.ref | 1 + .../step7/show_ip_ospf_database_opaque.ref | 280 +++ .../rt2/step7/show_ip_ospf_flexalgo.ref | 1 + .../step8/show_ip_ospf_database_opaque.ref | 286 +++ .../rt2/step8/show_ip_ospf_flexalgo.ref | 1 + .../step9/show_ip_ospf_database_opaque.ref | 280 +++ .../rt2/step9/show_ip_ospf_flexalgo.ref | 1 + .../ospf_flexalgo_topo1/rt2/zebra.conf | 24 + .../ospf_flexalgo_topo1/rt3/ospfd.conf | 30 + .../ospf_flexalgo_topo1/rt3/ospfd_flxalg.conf | 30 + .../step1/show_ip_ospf_database_opaque.ref | 286 +++ .../rt3/step1/show_ip_ospf_flexalgo.ref | 1 + .../rt3/step1/show_ip_route.ref | 166 ++ .../step10/show_ip_ospf_database_opaque.ref | 286 +++ .../rt3/step10/show_ip_ospf_flexalgo.ref | 1 + .../step11/show_ip_ospf_database_opaque.ref | 280 +++ .../rt3/step11/show_ip_ospf_flexalgo.ref | 1 + .../step12/show_ip_ospf_database_opaque.ref | 286 +++ .../rt3/step12/show_ip_ospf_flexalgo.ref | 1 + .../step13/show_ip_ospf_database_opaque.ref | 280 +++ .../rt3/step13/show_ip_ospf_flexalgo.ref | 1 + .../step14/show_ip_ospf_database_opaque.ref | 286 +++ .../rt3/step14/show_ip_ospf_flexalgo.ref | 1 + .../step15/show_ip_ospf_database_opaque.ref | 280 +++ .../rt3/step15/show_ip_ospf_flexalgo.ref | 1 + .../step16/show_ip_ospf_database_opaque.ref | 227 ++ .../rt3/step16/show_ip_ospf_flexalgo.ref | 1 + .../step2/show_ip_ospf_database_opaque.ref | 296 +++ .../show_ip_ospf_database_opaque_mismatch.ref | 79 + .../rt3/step2/show_ip_ospf_flexalgo.ref | 1 + .../rt3/step2/show_ip_route.ref | 166 ++ .../step4/show_ip_ospf_database_opaque.ref | 286 +++ .../rt3/step4/show_ip_ospf_flexalgo.ref | 1 + .../step5/show_ip_ospf_database_opaque.ref | 286 +++ .../rt3/step5/show_ip_ospf_flexalgo.ref | 1 + .../step6/show_ip_ospf_database_opaque.ref | 286 +++ .../rt3/step6/show_ip_ospf_flexalgo.ref | 1 + .../step7/show_ip_ospf_database_opaque.ref | 280 +++ .../rt3/step7/show_ip_ospf_flexalgo.ref | 1 + .../step8/show_ip_ospf_database_opaque.ref | 286 +++ .../rt3/step8/show_ip_ospf_flexalgo.ref | 1 + .../step9/show_ip_ospf_database_opaque.ref | 280 +++ .../rt3/step9/show_ip_ospf_flexalgo.ref | 1 + .../ospf_flexalgo_topo1/rt3/zebra.conf | 24 + .../ospf_flexalgo_topo1/rt4/ospfd.conf | 27 + .../ospf_flexalgo_topo1/rt4/ospfd_flxalg.conf | 38 + .../step1/show_ip_ospf_database_opaque.ref | 286 +++ .../rt4/step1/show_ip_ospf_flexalgo.ref | 17 + .../rt4/step1/show_ip_route.ref | 166 ++ .../step10/show_ip_ospf_database_opaque.ref | 286 +++ .../rt4/step10/show_ip_ospf_flexalgo.ref | 17 + .../step11/show_ip_ospf_database_opaque.ref | 280 +++ .../rt4/step11/show_ip_ospf_flexalgo.ref | 17 + .../step12/show_ip_ospf_database_opaque.ref | 286 +++ .../rt4/step12/show_ip_ospf_flexalgo.ref | 17 + .../step13/show_ip_ospf_database_opaque.ref | 280 +++ .../rt4/step13/show_ip_ospf_flexalgo.ref | 17 + .../step14/show_ip_ospf_database_opaque.ref | 286 +++ .../rt4/step14/show_ip_ospf_flexalgo.ref | 17 + .../step15/show_ip_ospf_database_opaque.ref | 280 +++ .../rt4/step15/show_ip_ospf_flexalgo.ref | 17 + .../step16/show_ip_ospf_database_opaque.ref | 227 ++ .../rt4/step16/show_ip_ospf_flexalgo.ref | 16 + .../step2/show_ip_ospf_database_opaque.ref | 296 +++ .../show_ip_ospf_database_opaque_mismatch.ref | 79 + .../rt4/step2/show_ip_ospf_flexalgo.ref | 22 + .../rt4/step2/show_ip_route.ref | 166 ++ .../step4/show_ip_ospf_database_opaque.ref | 286 +++ .../rt4/step4/show_ip_ospf_flexalgo.ref | 17 + .../step5/show_ip_ospf_database_opaque.ref | 286 +++ .../rt4/step5/show_ip_ospf_flexalgo.ref | 17 + .../step6/show_ip_ospf_database_opaque.ref | 286 +++ .../rt4/step6/show_ip_ospf_flexalgo.ref | 17 + .../step7/show_ip_ospf_database_opaque.ref | 280 +++ .../rt4/step7/show_ip_ospf_flexalgo.ref | 17 + .../step8/show_ip_ospf_database_opaque.ref | 286 +++ .../rt4/step8/show_ip_ospf_flexalgo.ref | 17 + .../step9/show_ip_ospf_database_opaque.ref | 280 +++ .../rt4/step9/show_ip_ospf_flexalgo.ref | 17 + .../ospf_flexalgo_topo1/rt4/zebra.conf | 21 + .../test_ospf_flexalgo_topo1.py | 1963 +++++++++++++++++ 146 files changed, 21332 insertions(+) create mode 100644 tests/topotests/ospf_flexalgo_topo1/__init__.py create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/ospfd.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/ospfd_flxalg.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_route.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step15/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step15/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step16/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step16/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_database_opaque_mismatch.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_route.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt1/zebra.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/ospfd.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/ospfd_flxalg.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_route.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step15/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step15/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step16/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step16/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_database_opaque_mismatch.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_route.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt2/zebra.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/ospfd.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/ospfd_flxalg.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_route.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step15/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step15/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step16/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step16/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_database_opaque_mismatch.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_route.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt3/zebra.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/ospfd.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/ospfd_flxalg.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_route.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step15/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step15/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step16/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step16/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_database_opaque_mismatch.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_route.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_database_opaque.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_flexalgo.ref create mode 100644 tests/topotests/ospf_flexalgo_topo1/rt4/zebra.conf create mode 100644 tests/topotests/ospf_flexalgo_topo1/test_ospf_flexalgo_topo1.py diff --git a/tests/topotests/ospf_flexalgo_topo1/__init__.py b/tests/topotests/ospf_flexalgo_topo1/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/ospfd.conf b/tests/topotests/ospf_flexalgo_topo1/rt1/ospfd.conf new file mode 100644 index 000000000000..6b4e640a2af9 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/ospfd.conf @@ -0,0 +1,27 @@ +password 1 +hostname rt1 +log file ospfd.log +log syslog debugging +! +debug ospf sr +! debug ospf te +! debug ospf event +! debug ospf lsa +debug ospf lsa generate +! debug ospf zebra +! +interface lo + ip ospf area 0.0.0.0 + ip ospf passive +! +interface eth-rt1-1 + ip ospf area 0.0.0.0 +! +interface eth-rt1-2 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 1.1.1.1 + capability opaque + router-info area 0.0.0.0 +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/ospfd_flxalg.conf b/tests/topotests/ospf_flexalgo_topo1/rt1/ospfd_flxalg.conf new file mode 100644 index 000000000000..a33e66598ea4 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/ospfd_flxalg.conf @@ -0,0 +1,37 @@ +password 1 +hostname rt1 +log file ospfd.log +log syslog debugging +! +debug ospf sr +! debug ospf te +! debug ospf event +! debug ospf lsa +debug ospf lsa generate +! debug ospf zebra +! +interface lo + ip ospf area 0.0.0.0 +! +interface eth-rt1-1 + ip ospf area 0.0.0.0 +! +interface eth-rt1-2 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 1.1.1.1 + capability opaque + router-info area 0.0.0.0 + flexible-algorithm 128 metric-type igp + flexible-algorithm 128 calculation-type spf + flexible-algorithm 128 priority 10 + flexible-algorithm 128 exclude-admin-group 30 + flexible-algorithm 128 include-all-admin-group 20 + flexible-algorithm 128 include-any-admin-group 60 + flexible-algorithm 128 include-any-admin-group 70 + flexible-algorithm 128 exclude-srlg 10 + flexible-algorithm 128 flags 10 + flexible-algorithm 128 prefix-advertise-metric 100 + passive-interface lo +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..2cc210fa86ad --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9c235c36ede7 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_route.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_route.ref new file mode 100644 index 000000000000..990d5c1e80d7 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_route.ref @@ -0,0 +1,166 @@ +{ + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.20", + "afi":"ipv4", + "interfaceName":"eth-rt1-1", + "active":true + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.30", + "afi":"ipv4", + "interfaceName":"eth-rt1-2", + "active":true + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.20", + "afi":"ipv4", + "interfaceName":"eth-rt1-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.2.30", + "afi":"ipv4", + "interfaceName":"eth-rt1-2", + "active":true + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt1-1", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt1-2", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.20", + "afi":"ipv4", + "interfaceName":"eth-rt1-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.2.30", + "afi":"ipv4", + "interfaceName":"eth-rt1-2", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.20", + "afi":"ipv4", + "interfaceName":"eth-rt1-1", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.30", + "afi":"ipv4", + "interfaceName":"eth-rt1-2", + "active":true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..ba314c434880 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 40 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..3664a8379a3f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_flexalgo.ref @@ -0,0 +1,18 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + - 40 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..45aa61404982 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..40f1386d7e7b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_flexalgo.ref @@ -0,0 +1,15 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..9cbf2fa78576 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ 10, 40 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..a91abdb4288f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_flexalgo.ref @@ -0,0 +1,18 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + - 40 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..4c6de08ac073 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..a5ff3ef66fd0 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_flexalgo.ref @@ -0,0 +1,15 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..72bf8682c23d --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 8, + "flags": [ 10, 40 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..4059ca73179a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_flexalgo.ref @@ -0,0 +1,18 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + Flags: + - 10 + - 40 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step15/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step15/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..4ba74278d724 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step15/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step15/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step15/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..5d6fb87acc67 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step15/show_ip_ospf_flexalgo.ref @@ -0,0 +1,15 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step16/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step16/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..f79f5776635a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step16/show_ip_ospf_database_opaque.ref @@ -0,0 +1,227 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step16/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step16/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9c235c36ede7 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step16/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..168a1bbe54e1 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_database_opaque.ref @@ -0,0 +1,296 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 88, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 68, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 4, + "algorithmId": 129, + "priority": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_database_opaque_mismatch.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_database_opaque_mismatch.ref new file mode 100644 index 000000000000..4e536604f05b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_database_opaque_mismatch.ref @@ -0,0 +1,79 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 56, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 32, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + }, + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "algotithmId": 129 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 52, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 28, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + }, + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 129 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9c235c36ede7 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_route.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_route.ref new file mode 100644 index 000000000000..990d5c1e80d7 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_route.ref @@ -0,0 +1,166 @@ +{ + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.20", + "afi":"ipv4", + "interfaceName":"eth-rt1-1", + "active":true + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.30", + "afi":"ipv4", + "interfaceName":"eth-rt1-2", + "active":true + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.20", + "afi":"ipv4", + "interfaceName":"eth-rt1-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.2.30", + "afi":"ipv4", + "interfaceName":"eth-rt1-2", + "active":true + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt1-1", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt1-2", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.20", + "afi":"ipv4", + "interfaceName":"eth-rt1-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.2.30", + "afi":"ipv4", + "interfaceName":"eth-rt1-2", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.20", + "afi":"ipv4", + "interfaceName":"eth-rt1-1", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.30", + "afi":"ipv4", + "interfaceName":"eth-rt1-2", + "active":true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..9278aaacdd05 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..f4aa2103b146 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 20 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..02b1287a5dcb --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..e310746094d8 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 0 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..3a44e97f3cbf --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 8, + "adminGroups": [ 30, 40 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..4c8029ef5eab --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_flexalgo.ref @@ -0,0 +1,18 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + - 40 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..ed40c5f58d2a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..67fd1e398132 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_flexalgo.ref @@ -0,0 +1,15 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..1e18723a57d2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 60, 70, 40 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..00425bc22463 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_flexalgo.ref @@ -0,0 +1,18 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + - 40 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..eadbad48190a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 68, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 48, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 36, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..c3fab6e06d3f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_flexalgo.ref @@ -0,0 +1,14 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/zebra.conf b/tests/topotests/ospf_flexalgo_topo1/rt1/zebra.conf new file mode 100644 index 000000000000..72224fac0d7a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/zebra.conf @@ -0,0 +1,21 @@ +log file zebra.log +! +hostname rt1 +! +! debug zebra kernel +! debug zebra packet +! debug zebra mpls +! +interface lo + ip address 1.1.1.1/32 +! +interface eth-rt1-1 + ip address 10.0.1.10/24 +! +interface eth-rt1-2 + ip address 10.0.2.10/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/ospfd.conf b/tests/topotests/ospf_flexalgo_topo1/rt2/ospfd.conf new file mode 100644 index 000000000000..b74beffbc0a3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/ospfd.conf @@ -0,0 +1,30 @@ +password 1 +hostname rt2 +log file ospfd.log +log syslog debugging +! +debug ospf sr +! debug ospf te +! debug ospf event +! debug ospf lsa +debug ospf lsa generate +! debug ospf zebra +! +interface lo + ip ospf area 0.0.0.0 + ip ospf passive +! +interface eth-rt2-1 + ip ospf area 0.0.0.0 +! +interface eth-rt2-2 + ip ospf area 0.0.0.0 +! +interface eth-rt2-3 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 2.2.2.2 + capability opaque + router-info area 0.0.0.0 +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/ospfd_flxalg.conf b/tests/topotests/ospf_flexalgo_topo1/rt2/ospfd_flxalg.conf new file mode 100644 index 000000000000..b74beffbc0a3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/ospfd_flxalg.conf @@ -0,0 +1,30 @@ +password 1 +hostname rt2 +log file ospfd.log +log syslog debugging +! +debug ospf sr +! debug ospf te +! debug ospf event +! debug ospf lsa +debug ospf lsa generate +! debug ospf zebra +! +interface lo + ip ospf area 0.0.0.0 + ip ospf passive +! +interface eth-rt2-1 + ip ospf area 0.0.0.0 +! +interface eth-rt2-2 + ip ospf area 0.0.0.0 +! +interface eth-rt2-3 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 2.2.2.2 + capability opaque + router-info area 0.0.0.0 +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..de019ff80d9f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_route.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_route.ref new file mode 100644 index 000000000000..8ce3f507425b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_route.ref @@ -0,0 +1,168 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "ip":"10.0.1.10", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.30", + "afi":"ipv4", + "interfaceName":"eth-rt2-3", + "active":true + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.40", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceIndex":2, + "interfaceName":"eth-rt2-1", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "prefixLen":24, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.10", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.3.30", + "afi":"ipv4", + "interfaceName":"eth-rt2-3", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt2-3", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "prefixLen":24, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.30", + "afi":"ipv4", + "interfaceName":"eth-rt2-3", + "active":true + }, + { + "fib":true, + "ip":"10.0.4.40", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..4fb052ee7b55 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 40 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..dd3199e8e61e --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..e96e0039d255 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ 10, 40 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..c87bf9c800fa --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..0e5b7baa180c --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 8, + "flags": [ 10, 40 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step15/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step15/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..d57321c6d3bb --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step15/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step15/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step15/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step15/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step16/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step16/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..d19fbcb15563 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step16/show_ip_ospf_database_opaque.ref @@ -0,0 +1,227 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step16/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step16/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step16/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..ed77656f8dcf --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_database_opaque.ref @@ -0,0 +1,296 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 88, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 68, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 4, + "algorithmId": 129, + "priority": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_database_opaque_mismatch.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_database_opaque_mismatch.ref new file mode 100644 index 000000000000..9fc4833ec77b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_database_opaque_mismatch.ref @@ -0,0 +1,79 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 56, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 32, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + }, + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "algotithmId": 129 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 52, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 28, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + }, + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 129 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_route.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_route.ref new file mode 100644 index 000000000000..8ce3f507425b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_route.ref @@ -0,0 +1,168 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "ip":"10.0.1.10", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.30", + "afi":"ipv4", + "interfaceName":"eth-rt2-3", + "active":true + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.40", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceIndex":2, + "interfaceName":"eth-rt2-1", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "prefixLen":24, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.10", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.3.30", + "afi":"ipv4", + "interfaceName":"eth-rt2-3", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt2-3", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "prefixLen":24, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.30", + "afi":"ipv4", + "interfaceName":"eth-rt2-3", + "active":true + }, + { + "fib":true, + "ip":"10.0.4.40", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..846956d8a028 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..69d515d54781 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..e9818b6ab09c --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 8, + "adminGroups": [ 30, 40 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..f80e84d03e74 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..9850ce7715fc --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 60, 70, 40 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..2d5ab94098c1 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 68, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 48, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 36, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/zebra.conf b/tests/topotests/ospf_flexalgo_topo1/rt2/zebra.conf new file mode 100644 index 000000000000..b7da84ea7978 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/zebra.conf @@ -0,0 +1,24 @@ +log file zebra.log +! +hostname rt2 +! +! debug zebra kernel +! debug zebra packet +! debug zebra mpls +! +interface lo + ip address 2.2.2.2/32 +! +interface eth-rt2-1 + ip address 10.0.1.20/24 +! +interface eth-rt2-2 + ip address 10.0.4.20/24 +! +interface eth-rt2-3 + ip address 10.0.3.20/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd.conf b/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd.conf new file mode 100644 index 000000000000..a53f0217fbfa --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd.conf @@ -0,0 +1,30 @@ +password 1 +hostname rt3 +log file ospfd.log +log syslog debugging +! +debug ospf sr +! debug ospf te +! debug ospf event +! debug ospf lsa +debug ospf lsa generate +! debug ospf zebra +! +interface lo + ip ospf area 0.0.0.0 + ip ospf passive +! +interface eth-rt3-1 + ip ospf area 0.0.0.0 +! +interface eth-rt3-2 + ip ospf area 0.0.0.0 +! +interface eth-rt3-3 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 3.3.3.3 + capability opaque + router-info area 0.0.0.0 +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd_flxalg.conf b/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd_flxalg.conf new file mode 100644 index 000000000000..5f5dc0b5aec8 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd_flxalg.conf @@ -0,0 +1,30 @@ +password 1 +hostname rt3 +log file ospfd.log +log syslog debugging +! +debug ospf sr +! debug ospf te +! debug ospf event +debug ospf lsa +debug ospf lsa generate +! debug ospf zebra +! +interface lo + ip ospf area 0.0.0.0 + ip ospf passive +! +interface eth-rt3-1 + ip ospf area 0.0.0.0 +! +interface eth-rt3-2 + ip ospf area 0.0.0.0 +! +interface eth-rt3-3 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 3.3.3.3 + capability opaque + router-info area 0.0.0.0 +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..293c793afc7e --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_route.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_route.ref new file mode 100644 index 000000000000..b84ab3826f0f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_route.ref @@ -0,0 +1,166 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "ip":"10.0.2.10", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true + } + ] + } + ], + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.20", + "afi":"ipv4", + "interfaceName":"eth-rt3-3", + "active":true + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.5.40", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "prefixLen":24, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.10", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.3.20", + "afi":"ipv4", + "interfaceName":"eth-rt3-3", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt3-1", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt3-3", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "prefixLen":24, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.20", + "afi":"ipv4", + "interfaceName":"eth-rt3-3", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.40", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..21da7e09df00 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 40 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..932a34c6a325 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..1bcbf1c24952 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ 10, 40 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..3957765f98ff --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..6e0da96946f2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 8, + "flags": [ 10, 40 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step15/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step15/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..20d5ed29cefd --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step15/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step15/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step15/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step15/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step16/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step16/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..afc2efb1290c --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step16/show_ip_ospf_database_opaque.ref @@ -0,0 +1,227 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step16/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step16/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step16/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..28aeb2677aba --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_database_opaque.ref @@ -0,0 +1,296 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 88, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 68, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 4, + "algorithmId": 129, + "priority": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_database_opaque_mismatch.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_database_opaque_mismatch.ref new file mode 100644 index 000000000000..93125355c8a2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_database_opaque_mismatch.ref @@ -0,0 +1,79 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 56, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 32, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + }, + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "algotithmId": 129 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 52, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 28, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + }, + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 129 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_route.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_route.ref new file mode 100644 index 000000000000..b84ab3826f0f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_route.ref @@ -0,0 +1,166 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "ip":"10.0.2.10", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true + } + ] + } + ], + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.20", + "afi":"ipv4", + "interfaceName":"eth-rt3-3", + "active":true + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.5.40", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "prefixLen":24, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.10", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.3.20", + "afi":"ipv4", + "interfaceName":"eth-rt3-3", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt3-1", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt3-3", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "prefixLen":24, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.20", + "afi":"ipv4", + "interfaceName":"eth-rt3-3", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.40", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..a74d2c80a9ed --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..6aa764a07ad4 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..c7555d2432aa --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 8, + "adminGroups": [ 30, 40 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..14501c3aed8d --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..1f61dafc44aa --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 60, 70, 40 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..4ca5a6d63d59 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 68, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 48, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 36, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/zebra.conf b/tests/topotests/ospf_flexalgo_topo1/rt3/zebra.conf new file mode 100644 index 000000000000..8e8bf470c5f1 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/zebra.conf @@ -0,0 +1,24 @@ +log file zebra.log +! +hostname rt3 +! +! debug zebra kernel +! debug zebra packet +! debug zebra mpls +! +interface lo + ip address 3.3.3.3/32 +! +interface eth-rt3-1 + ip address 10.0.2.30/24 +! +interface eth-rt3-2 + ip address 10.0.5.30/24 +! +interface eth-rt3-3 + ip address 10.0.3.30/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/ospfd.conf b/tests/topotests/ospf_flexalgo_topo1/rt4/ospfd.conf new file mode 100644 index 000000000000..2f897a8d0c27 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/ospfd.conf @@ -0,0 +1,27 @@ +password 1 +hostname rt4 +log file ospfd.log +log syslog debugging +! +debug ospf sr +! debug ospf te +! debug ospf event +! debug ospf lsa +debug ospf lsa generate +! debug ospf zebra +! +interface lo + ip ospf area 0.0.0.0 + ip ospf passive +! +interface eth-rt4-1 + ip ospf area 0.0.0.0 +! +interface eth-rt4-2 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 4.4.4.4 + capability opaque + router-info area 0.0.0.0 +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/ospfd_flxalg.conf b/tests/topotests/ospf_flexalgo_topo1/rt4/ospfd_flxalg.conf new file mode 100644 index 000000000000..083e6e353940 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/ospfd_flxalg.conf @@ -0,0 +1,38 @@ +password 1 +hostname rt4 +log file ospfd.log +log syslog debugging +! +debug ospf sr +! debug ospf te +! debug ospf event +! debug ospf lsa +debug ospf lsa generate +! debug ospf zebra +! +interface lo + ip ospf area 0.0.0.0 + ip ospf passive +! +interface eth-rt4-1 + ip ospf area 0.0.0.0 +! +interface eth-rt4-2 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 4.4.4.4 + capability opaque + router-info area 0.0.0.0 + flexible-algorithm 128 metric-type igp + flexible-algorithm 128 calculation-type spf + flexible-algorithm 128 priority 10 + flexible-algorithm 128 exclude-admin-group 30 + flexible-algorithm 128 include-all-admin-group 20 + flexible-algorithm 128 include-all-admin-group 60 + flexible-algorithm 128 include-any-admin-group 70 + flexible-algorithm 128 exclude-srlg 10 + flexible-algorithm 128 flags 10 + flexible-algorithm 128 prefix-advertise-metric 10 + passive-interface lo +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..5fe41ad265d1 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_route.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_route.ref new file mode 100644 index 000000000000..fa213de304a5 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_route.ref @@ -0,0 +1,166 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.20", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.30", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.20", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.5.30", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.20", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.5.30", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.20", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.30", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt4-1", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..699660143c89 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 40 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..72e0c1de265b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..516bac73d034 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ 10, 40 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..be7bb70a25f0 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..7a3e2d919788 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 8, + "flags": [ 10, 40 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step15/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step15/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..f09504b05e14 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step15/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step15/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step15/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step15/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step16/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step16/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..b49dcecd9e7a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step16/show_ip_ospf_database_opaque.ref @@ -0,0 +1,227 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step16/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step16/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..222dd06c70ab --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step16/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..a647aab8858a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_database_opaque.ref @@ -0,0 +1,296 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 88, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 68, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 4, + "algorithmId": 129, + "priority": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_database_opaque_mismatch.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_database_opaque_mismatch.ref new file mode 100644 index 000000000000..23deb8971be5 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_database_opaque_mismatch.ref @@ -0,0 +1,79 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 56, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 32, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + }, + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "algotithmId": 129 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 52, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 28, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + }, + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 129 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..7cf18b54cbf4 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_flexalgo.ref @@ -0,0 +1,22 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 + Flexible-Algorithm: 129 + Metric-Type: igp + Calculation-Type: spf + Priority: 0 + \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_route.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_route.ref new file mode 100644 index 000000000000..fa213de304a5 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_route.ref @@ -0,0 +1,166 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.20", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.30", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.20", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.5.30", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.20", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.5.30", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.20", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.30", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt4-1", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..3de37111965a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..d140733800c0 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..30eab0b46394 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 8, + "adminGroups": [ 30, 40 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..0de87b9a2a17 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 72, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 52, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 40, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 8, + "adminGroups": [ 60, 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..f1dbbb3774b4 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_database_opaque.ref @@ -0,0 +1,286 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 84, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 64, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 52, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 60, 70, 40 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..84b4111d37a1 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_database_opaque.ref @@ -0,0 +1,280 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 68, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 48, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 36, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 20 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 30 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 4, + "adminGroups": [ 70 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 20, 60 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 10 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 10 ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9be881e927c2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flags: + - 10 diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/zebra.conf b/tests/topotests/ospf_flexalgo_topo1/rt4/zebra.conf new file mode 100644 index 000000000000..d2e36cf4df74 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/zebra.conf @@ -0,0 +1,21 @@ +log file zebra.log +! +hostname rt4 +! +! debug zebra kernel +! debug zebra packet +! debug zebra mpls +! +interface lo + ip address 4.4.4.4/32 +! +interface eth-rt4-1 + ip address 10.0.4.40/24 +! +interface eth-rt4-2 + ip address 10.0.5.40/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/ospf_flexalgo_topo1/test_ospf_flexalgo_topo1.py b/tests/topotests/ospf_flexalgo_topo1/test_ospf_flexalgo_topo1.py new file mode 100644 index 000000000000..cde891eb107f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/test_ospf_flexalgo_topo1.py @@ -0,0 +1,1963 @@ +#!/usr/bin/python + +# +# Copyright (c) 2021 by VMware, Inc. ("VMware") +# Used Copyright (c) 2018 by Network Device Education Foundation, +# Inc. ("NetDEF") in this file. +# +# 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 VMWARE DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE 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_ospf_sr_topo1.py: + + +---------+ + eth-rt1-1| |eth-rt1-2 + +----------+ 1.1.1.1 +-----------+ + | | RT1 | | + | | | | + | +---------+ | + 10.0.1.0/24| |10.0.2.0/24 + | | + eth-rt2-1| |eth-rt3-1 + +---------+ +---------+ + | | | | + | RT2 | 10.0.3.0/24 | RT5 | + | 2.2.2.2 +---------------------+ 3.3.3.3 | + | |eth-rt2-3 eth-rt3-3| | + +---------+ +---------+ + eth-rt2-2| |eth-rt3-2 + | | + 10.0.4.0/24| |10.0.5.0/24 + | +---------+ | + | | | | + | | RT6 | | + +----------+ 4.4.4.4 +-----------+ + eth-rt4-1| |eth-rt4-2 + +---------+ +""" + +import os +import sys +import pytest +import json +from functools import partial +from time import sleep + +# 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 ( + start_topology, + write_test_header, + write_test_footer, + reset_config_on_routers, + verify_rib, + create_static_routes, + check_address_types, + step, + shutdown_bringup_interface, + stop_router, + start_router, + apply_raw_config, + kill_router_daemons, + start_router_daemons, +) + +# Required to instantiate the topology builder class. + +pytestmark = [pytest.mark.ospfd] + + +def build_topo(tgen): + "Build function" + + # + # Define FRR Routers + # + for router in ["rt1", "rt2", "rt3", "rt4"]: + tgen.add_router(router) + + # + # Define connections + # + switch = tgen.add_switch("s1") + switch.add_link(tgen.gears["rt1"], nodeif="eth-rt1-1") + switch.add_link(tgen.gears["rt2"], nodeif="eth-rt2-1") + + switch = tgen.add_switch("s2") + switch.add_link(tgen.gears["rt1"], nodeif="eth-rt1-2") + switch.add_link(tgen.gears["rt3"], nodeif="eth-rt3-1") + + switch = tgen.add_switch("s3") + switch.add_link(tgen.gears["rt2"], nodeif="eth-rt2-2") + switch.add_link(tgen.gears["rt4"], nodeif="eth-rt4-1") + + switch = tgen.add_switch("s4") + switch.add_link(tgen.gears["rt3"], nodeif="eth-rt3-2") + switch.add_link(tgen.gears["rt4"], nodeif="eth-rt4-2") + + switch = tgen.add_switch("s5") + switch.add_link(tgen.gears["rt2"], nodeif="eth-rt2-3") + switch.add_link(tgen.gears["rt3"], nodeif="eth-rt3-3") + + +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_OSPF, os.path.join(CWD, "{}/ospfd.conf".format(rname)) + TopoRouter.RD_OSPF, os.path.join(CWD, "{}/ospfd_flxalg.conf".format(rname)) + ) + + tgen.start_router() + # topotest.sleep(10) + + +def teardown_module(mod): + "Teardown the pytest environment" + tgen = get_topogen() + + # This function tears down the whole topology. + tgen.stop_topology() + + +def print_cmd_result(rname, command): + print(get_topogen().gears[rname].vtysh_cmd(command, isjson=False)) + + +def router_compare_json_output(rname, command, reference, check_for_mismatch = False): + "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()) + + # 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) + if check_for_mismatch : + _, diff = topotest.run_and_expect(test_func, None, count=3, wait=3.5) + assertmsg = '"{}" JSON output does not mismatch the expected result'.format(rname) + assert diff is not None, assertmsg + else : + _, diff = topotest.run_and_expect(test_func, None, count=60, wait=1) + assertmsg = '"{}" JSON output mismatches the expected result'.format(rname) + assert diff is None, assertmsg + +def router_compare_text_output(rname, command, reference, check_for_mismatch = False): + "Compare router JSON output" + + logger.info('Comparing router "%s" "%s" output', rname, command) + + tgen = get_topogen() + filename = "{}/{}/{}".format(CWD, rname, reference) + expected = open(filename).read() + + # Run test function until we get an result. Wait at most 80 seconds. + test_func = partial( + topotest.router_output_cmp, tgen.gears[rname], command, expected + ) + if check_for_mismatch : + result, diff = topotest.run_and_expect(test_func, "", count=3, wait=0.5) + # logger.info('Expected result:\n========\n{}\n=========='.format(expected)) + # logger.info('Actual result:\n========\n{}\n========'.format(tgen.gears[rname].vtysh_cmd(command))) + assertmsg = '"{}" Text output does not mismatch the expected result. Diff:\n {}\n'.format(rname, diff) + assert result is not None, assertmsg + else : + result, diff = topotest.run_and_expect(test_func, "", count=3, wait=3.5) + # logger.info('Expected result:\n========\n{}\n=========='.format(expected)) + # logger.info('Actual result:\n========\n{}\n========'.format(tgen.gears[rname].vtysh_cmd(command))) + assertmsg = '"{}" Text output mismatches the expected result. Diff:\n {}\n'.format(rname, diff) + assert result, assertmsg + + +# +# Step 1 +# +# Test initial network convergence +# +def test_rib_step1(request): + tgen = get_topogen() + tc_name = request.node.name + + step("Verify initial RIB") + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_json_output( + rname, "show ip route ospf json", + "step1/show_ip_route.ref" + ) + + write_test_footer(tc_name) + + +def test_opaque_lsa_step1(request): + tgen = get_topogen() + + tc_name = request.node.name + step("Verify OSPF Opaque LSA advertisemenst for Flex-Algorithms") + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name) + + +# +# Step 2 +# +# Action(s): +# -Add another flexible-algo on rt4 with default configurations +# +# Expected changes: +# -rt4 should advertise an additional FAD TLV in the RI-LSA with +# following attributes and values +# -- metric-type: igp +# -- calculation-type: spf +# -- priority: 0 +# - rt4 should not advertise any additional FAPM or FAAM subTLVs +# for algorithm 129. +# +# Action(s): +# -Try deleting the flexible-algo on rt4 that was added in step 2 +# +# Expected changes: +# -rt4 should remove Flex-Algo with id 129. +# -rt2 MUST NOT advertise any FAD TLV in the RI-LSA or any +# FAPM or FAAM subTLVs for algo 129. +# +def test_flex_algo_default_add_step2(request): + tgen = get_topogen() + + tc_name = request.node.name + step("Add another flex-algo with defaults on rt4") + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + raw_config = { + "rt4": { + "raw_config": [ + "router ospf", + "flexible-algorithm 129" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) + + # Debug (to be used to debug testcase failure) + # print_cmd_result("rt4", "show ip ospf router-info flexible-algorithms") + # print_cmd_result("rt4", "show ip ospf router-info flexible-algorithm 128") + # print_cmd_result("rt4", "show ip ospf router-info flexible-algorithm 129") + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step2/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step2/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step2/show_ip_ospf_database_opaque_mismatch.ref", + check_for_mismatch=True + ) + + step("Try deleting flex-algo with algorithm Id 129 on rt4") + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + raw_config = { + "rt4": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 129" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete Flex-Algo 129!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name) + +# +# Step 3 +# +# Action(s): +# -Try adding flexible-algo on rt2 with algo-id outside permitted +# range +# +# Expected changes: +# -rt2 should not allow configuration. +# -rt2 MUST NOT advertise any FAD TLV in the RI-LSA or any +# FAPM or FAAM subTLVs. +# +def test_flex_algo_id_config_range_step3(request): + tgen = get_topogen() + + tc_name = request.node.name + step("Try adding flex-algo with invalid algorithm Id on rt2") + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + raw_config = { + "rt2": { + "raw_config": [ + "router ospf", + "flexible-algorithm 127" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is False, "Testcase {} : Invalid configuration applied successfully!".format(tc_name) + + raw_config = { + "rt2": { + "raw_config": [ + "router ospf", + "flexible-algorithm 256" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is False, "Testcase {} : Invalid configuration applied successfully!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name) + +# +# Step 4 +# +# Action(s): +# -Modify the priority of flexible-algo 128 on rt1 +# +# Expected changes: +# -rt1 should update the Flex-Algo with new priority. +# -rt1 MUST advertise the FAD TLV for 128 with new value of priority. +# +def test_flex_algo_modify_priority_step4(request): + tgen = get_topogen() + + tc_name = request.node.name + step("Try modifying priority of flex-algo with algorithm Id 128 on rt1 to 20") + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 priority 20" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to modify priority of Flex-Algo 128 on rt1!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step4/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step4/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name) + +# +# Step 5 +# +# Action(s): +# -Delete the priority of flexible-algo 128 on rt1 +# +# Expected changes: +# -rt1 should update the Flex-Algo with default priority of 0 +# -rt1 MUST advertise the FAD TLV for 128 with new value of priority. +# +# Action(s): +# -Restore the original priority of flexible-algo 128 on rt1 +# +# Expected changes: +# -rt1 should update the Flex-Algo with with priority 10. +# -rt1 MUST advertise the FAD TLV for 128 with new value of priority. +def test_flex_algo_default_priority_metrictype_calctype_step5(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + step("Try deleting priority of flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 priority" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete priority of Flex-Algo 128 on rt1!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step5/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step5/show_ip_ospf_database_opaque.ref" + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + step("Try deleting metric-type of flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 metric-type" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete metric-type of Flex-Algo 128 on rt1!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step5/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step5/show_ip_ospf_database_opaque.ref" + + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + step("Try deleting calcultation-type of flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 calculation-type" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete calculation-type of Flex-Algo 128 on rt1!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step5/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step5/show_ip_ospf_database_opaque.ref" + + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + step("Try restoring priority of flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 priority 10" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to set priority of Flex-Algo 128 on rt1!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name) + +# +# Step 6 +# +# Add and delete exclude-admin-group to flexible-algo 128 on rt1 +# +def test_flex_algo_add_delete_excadmingrp_step6(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add an existing exclude-admin-group to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should not update the Flex-Algo with any new exclude-admin-group. + # -rt1 MUST NOT advertise the FAD TLV for 128 with any new exclude-admin-group + # included in the Exclude-Admin-Groups SubTLV. + # + + step("Try adding same again exclude admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 exclude-admin-group 30" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add same exclude-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step6/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add a new exclude-admin-group to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should update the Flex-Algo with new exclude-admin-group. + # -rt1 MUST advertise the FAD TLV for 128 with new exclude-admin-group + # included in the Exclude-Admin-Groups SubTLV. + # + step("Try adding new exclude admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 exclude-admin-group 40" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add another exclude-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step6/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step6/show_ip_ospf_database_opaque.ref" + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Delete the newly added exclude-admin-group from flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should remove the new exclude-admin-group from the Flex-Algo. + # -rt1 MUST advertise the FAD TLV for 128 without the new exclude-admin-group + # included in the Exclude-Admin-Groups SubTLV. + # + step("Try deleting the new exclude admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 exclude-admin-group 40" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete exclude-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step6/show_ip_ospf_flexalgo.ref", check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step6/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + write_test_footer(tc_name) + +# +# Step 7 +# +# Add and delete exclude-admin-group to flexible-algo 128 on rt1 +# +def test_flex_algo_delete_all_excadmingrp_step7(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Delete all exclude-admin-group from flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should remove all exclude-admin-group from the Flex-Algo. + # -rt1 MUST advertise the FAD TLV for 128 without the Exclude-Admin-Groups SubTLV. + # + step("Try deleting all exclude admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 exclude-admin-group" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete all exclude-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step7/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref", check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step7/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add back the original exclude-admin-group to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should update the Flex-Algo with corresponding exclude-admin-group. + # -rt1 MUST advertise the FAD TLV for 128 with original exclude-admin-group + # included in the Exclude-Admin-Groups SubTLV. + # + step("Try adding original exclude admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 exclude-admin-group 30" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add exclude-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name) + +# +# Step 8 +# +# Add and delete include-any-admin-group to flexible-algo 128 on rt1 +# +def test_flex_algo_add_delete_incany_admingrp_step8(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add an existing include-any-admin-group to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should not update the Flex-Algo with any new include-any-admin-group. + # -rt1 MUST NOT advertise the FAD TLV for 128 with any new include-any-admin-group + # included in the include-any-Admin-Groups SubTLV. + # + + step("Try adding same again include-any admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 include-any-admin-group 60" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add same include-any-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step8/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add a new include-any-admin-group to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should update the Flex-Algo with new include-any-admin-group. + # -rt1 MUST advertise the FAD TLV for 128 with new include-any-admin-group + # included in the include-any-Admin-Groups SubTLV. + # + step("Try adding new include-any admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 include-any-admin-group 40" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add another include-any-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step8/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step8/show_ip_ospf_database_opaque.ref" + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Delete the newly added include-any-admin-group from flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should remove the new include-any-admin-group from the Flex-Algo. + # -rt1 MUST advertise the FAD TLV for 128 without the new include-any-admin-group + # included in the include-any-Admin-Groups SubTLV. + # + step("Try deleting the new include-any admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 include-any-admin-group 40" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete include-any-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step8/show_ip_ospf_flexalgo.ref", check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step8/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + write_test_footer(tc_name) + +# +# Step 9 +# +# Add and delete include-any-admin-group to flexible-algo 128 on rt1 +# +def test_flex_algo_delete_all_incany_admingrp_step9(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Delete all include-any-admin-group from flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should remove all include-any-admin-group from the Flex-Algo. + # -rt1 MUST advertise the FAD TLV for 128 without the include-any-Admin-Groups SubTLV. + # + step("Try deleting all include-any admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 include-any-admin-group" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete all include-any-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step9/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref", check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step9/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add back the original include-any-admin-group to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should update the Flex-Algo with corresponding include-any-admin-group. + # -rt1 MUST advertise the FAD TLV for 128 with original include-any-admin-group + # included in the include-any-Admin-Groups SubTLV. + # + step("Try adding original include-any admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 include-any-admin-group 60", + "flexible-algorithm 128 include-any-admin-group 70" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add include-any-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name) + +# +# Step 10 +# +# Add and delete include-all-admin-group to flexible-algo 128 on rt1 +# +def test_flex_algo_add_delete_incall_admingrp_step10(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add an existing include-all-admin-group to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should not update the Flex-Algo with any new include-all-admin-group. + # -rt1 MUST NOT advertise the FAD TLV for 128 with any new include-all-admin-group + # included in the include-all-Admin-Groups SubTLV. + # + + step("Try adding same again include-all admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 include-all-admin-group 20" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add same include-all-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step10/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add a new include-all-admin-group to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should update the Flex-Algo with new include-all-admin-group. + # -rt1 MUST advertise the FAD TLV for 128 with new include-all-admin-group + # included in the include-all-Admin-Groups SubTLV. + # + step("Try adding new include-all admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 include-all-admin-group 40" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add another include-all-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step10/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step10/show_ip_ospf_database_opaque.ref" + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Delete the newly added include-all-admin-group from flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should remove the new include-all-admin-group from the Flex-Algo. + # -rt1 MUST advertise the FAD TLV for 128 without the new include-all-admin-group + # included in the include-all-Admin-Groups SubTLV. + # + step("Try deleting the new include-all admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 include-all-admin-group 40" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete include-all-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step10/show_ip_ospf_flexalgo.ref", check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step10/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + write_test_footer(tc_name) + +# +# Step 11 +# +# Add and delete include-all-admin-group to flexible-algo 128 on rt1 +# +def test_flex_algo_delete_all_incall_admingrp_step11(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Delete all include-all-admin-group from flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should remove all include-all-admin-group from the Flex-Algo. + # -rt1 MUST advertise the FAD TLV for 128 without the include-all-Admin-Groups SubTLV. + # + step("Try deleting all include-all admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 include-all-admin-group" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete all include-all-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step11/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref", check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step11/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add back the original include-all-admin-group to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should update the Flex-Algo with corresponding include-all-admin-group. + # -rt1 MUST advertise the FAD TLV for 128 with original include-all-admin-group + # included in the include-all-Admin-Groups SubTLV. + # + step("Try adding original include-all admin-group for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 include-all-admin-group 20" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add include-all-admin-group of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name) + +# +# Step 12 +# +# Add and delete exclude-srlg to flexible-algo 128 on rt1 +# +def test_flex_algo_add_delete_exc_srlg_step12(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add an existing exclude-srlg to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should not update the Flex-Algo with any new exclude-srlg. + # -rt1 MUST NOT advertise the FAD TLV for 128 with any new exclude-srlg + # included in the Exclude-SRLGs SubTLV. + # + + step("Try adding same again exclude srlg for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 exclude-srlg 10" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add same exclude-srlg of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step12/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add a new exclude-srlg to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should update the Flex-Algo with new exclude-srlg. + # -rt1 MUST advertise the FAD TLV for 128 with new exclude-srlg + # included in the Exclude-SRLGs SubTLV. + # + step("Try adding new exclude srlg for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 exclude-srlg 40" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add another exclude-srlg of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step12/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step12/show_ip_ospf_database_opaque.ref" + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Delete the newly added exclude-srlg from flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should remove the new exclude-srlg from the Flex-Algo. + # -rt1 MUST advertise the FAD TLV for 128 without the new exclude-srlg + # included in the Exclude-SRLGs SubTLV. + # + step("Try deleting the new exclude srlg for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 exclude-srlg 40" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete exclude-srlg of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step12/show_ip_ospf_flexalgo.ref", check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step12/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + write_test_footer(tc_name) + +# +# Step 13 +# +# Add and delete exclude-srlg to flexible-algo 128 on rt1 +# +def test_flex_algo_delete_all_exc_srlg_step13(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Delete all exclude-srlg from flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should remove all exclude-srlg from the Flex-Algo. + # -rt1 MUST advertise the FAD TLV for 128 without the Exclude-SRLGs SubTLV. + # + step("Try deleting all exclude srlg for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 exclude-srlg" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete all exclude-srlg of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step13/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref", check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step13/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add back the original exclude-srlg to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should update the Flex-Algo with corresponding exclude-srlg. + # -rt1 MUST advertise the FAD TLV for 128 with original exclude-srlg + # included in the Exclude-SRLGs SubTLV. + # + step("Try adding original exclude srlg for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 exclude-srlg 10" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add exclude-srlg of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name) + +# +# Step 14 +# +# Add and delete flags to flexible-algo 128 on rt1 +# +def test_flex_algo_add_delete_flag_step14(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add an existing flags to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should not update the Flex-Algo with any new flags. + # -rt1 MUST NOT advertise the FAD TLV for 128 with any new flags + # included in the Flags SubTLV. + # + + step("Try adding same again exclude srlg for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 flags 10" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add same flags of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step14/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add a new flags to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should update the Flex-Algo with new flags. + # -rt1 MUST advertise the FAD TLV for 128 with new flags + # included in the Flags SubTLV. + # + step("Try adding new exclude srlg for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 flags 40" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add another flags of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step14/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step14/show_ip_ospf_database_opaque.ref" + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Delete the newly added flags from flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should remove the new flags from the Flex-Algo. + # -rt1 MUST advertise the FAD TLV for 128 without the new flags + # included in the Flags SubTLV. + # + step("Try deleting the new exclude srlg for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 flags 40" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete flags of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step14/show_ip_ospf_flexalgo.ref", check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step14/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + write_test_footer(tc_name) + +# +# Step 15 +# +# Add and delete flags to flexible-algo 128 on rt1 +# +def test_flex_algo_delete_all_flag_step15(request): + tgen = get_topogen() + + tc_name = request.node.name + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Delete all flags from flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should remove all flags from the Flex-Algo. + # -rt1 MUST advertise the FAD TLV for 128 without the Flags SubTLV. + # + step("Try deleting all exclude srlg for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 flags" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete all flags of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step15/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref", + check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step15/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + # + # Action(s): + # -Add back the original flags to flexible-algo 128 on rt1 + # + # Expected changes: + # -rt1 should update the Flex-Algo with corresponding flags. + # -rt1 MUST advertise the FAD TLV for 128 with original flags + # included in the Flags SubTLV. + # + step("Try adding original exclude srlg for flex-algo with algorithm Id 128 on rt1") + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 flags 10" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to add flags of Flex-Algo 128 on rt1 again!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name) + +# 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)) + +# +# Step 4 +# +def test_flex_algo_delete_prefix_advt_metric_step16(request): + tgen = get_topogen() + + tc_name = request.node.name + + # + # Action(s): + # -Delete the prefix-advertise-metric of flexible-algo 128 on rt4 + # + # Expected changes: + # -rt4 should remove Ext-Prefix LSA and Ext-IASBR LSA for the Flex Algo 128. + # + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + step("Try deleting prefix-advertise-metric of flex-algo with algorithm Id 128 on rt4") + raw_config = { + "rt4": { + "raw_config": [ + "router ospf", + "no flexible-algorithm 128 prefix-advertise-metric" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete prefix-advertise-metric of Flex-Algo 128 on rt4!".format(tc_name) + + # LSA deletion may take upto 360 seconds. + topotest.sleep(360) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step16/show_ip_ospf_flexalgo.ref" + ) + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref", + check_for_mismatch=True + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step16/show_ip_ospf_database_opaque.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref", + check_for_mismatch=True + ) + + # + # Action(s): + # -Modify the prefix-advertise-metric of flexible-algo 128 on rt4 + # + # Expected changes: + # -rt1 should update the Flex-Algo with new advertise-metric. + # -rt1 MUST advertise the FAPM and FAAM (in a new Ext-IASBR LSA) + # subTLVs for 128 with new value. + # + step("Try restoring prefix-advertise-metric of flex-algo with algorithm Id 128 on rt4") + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + raw_config = { + "rt4": { + "raw_config": [ + "router ospf", + "flexible-algorithm 128 prefix-advertise-metric 10" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to set prefix-advertise-metric of Flex-Algo 128 on rt4!".format(tc_name) + + # Debug (to be used to debug testcase failure) + # for rname in ["rt1", "rt2", "rt3", "rt4"]: + # print_cmd_result("rt4", "show ip ospf database opaque-area") + + for rname in ["rt1", "rt2", "rt3", "rt4"]: + router_compare_text_output( + rname, "show ip ospf router-info flexible-algorithms", + "step1/show_ip_ospf_flexalgo.ref" + ) + router_compare_json_output( + rname, "show ip ospf database opaque-area json", + "step1/show_ip_ospf_database_opaque.ref" + ) + + write_test_footer(tc_name)