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..5c092e8f4174 --- /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": 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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..52f9bbabc9a0 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + 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/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..b0073dd76b8e --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 256 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..eed29072bdbf --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + - 40 + Exclude-SRLGs: + - 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..4238222cba6e --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..e9016743183d --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_flexalgo.ref @@ -0,0 +1,14 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Exclude-SRLGs: + - 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..ca326c6948b7 --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ 1024, 256 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..5f4a0945810d --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 10 + - 40 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..9ac2e6a29fdd --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..0c92a15c3604 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_flexalgo.ref @@ -0,0 +1,14 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 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..ef9c4ac6139a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,221 @@ +{ + "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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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/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..1ea370f466df --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + 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/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..6fa442b9dc31 --- /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": 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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 96, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 76, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + }, + { + "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..52f9bbabc9a0 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + 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/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..b17d872de2b2 --- /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": 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": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..736652f90abd --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 20 + Flags: 0x80 + 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/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..35898dd5026e --- /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": 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": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..1b41ddc62363 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 0 + Flags: 0x80 + 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/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..8bbfa139a7a3 --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 8, + "adminGroups": [ 1073741824, 256 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..e58db3819a43 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + - 40 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 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..267422d65055 --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..df895d8d4c69 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_flexalgo.ref @@ -0,0 +1,14 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 100 + Include-Any-Admin-Groups: + - 60 + - 70 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 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..324e6e1f823d --- /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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435712, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..153eef486995 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 60 + - 70 + - 40 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 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..dda80784b758 --- /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": [ 1073741824 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..2669af1616bf --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_flexalgo.ref @@ -0,0 +1,13 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 100 + Exclude-Admin-Groups: + - 30 + Include-All-Admin-Groups: + - 20 + Exclude-SRLGs: + - 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..a220d47d33dc --- /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": 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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..956cde86b9d6 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_route.ref @@ -0,0 +1,167 @@ +{ + "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, + "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..258a2bbf6240 --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 256 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..9592adb54d44 --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..0fd472e4ff93 --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ 1024, 256 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..ea8fc7545674 --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..a2a05c292336 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,221 @@ +{ + "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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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/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/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..d3cc6717a2d5 --- /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": 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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 96, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 76, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + }, + { + "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..eb8d0559e7c4 --- /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": 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": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..aa54fe29643e --- /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": 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": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..b3c33876d28b --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 8, + "adminGroups": [ 1073741824, 256 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..d21dc675e114 --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..2d9a203ae055 --- /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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435712, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..14eb9ca816a8 --- /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": [ 1073741824 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..13faabf3b148 --- /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": 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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..f42ceccd6c55 --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 256 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..874b75651056 --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..77a3e0dec36f --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ 1024, 256 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..a39c235a0804 --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..cc6761e2ba6c --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,221 @@ +{ + "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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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/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/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..ff6081fa74e7 --- /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": 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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 96, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 76, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + }, + { + "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..58cc95a2e51b --- /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": 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": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..2faa1d4a05b1 --- /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": 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": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..b2e9a1eae5be --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 8, + "adminGroups": [ 1073741824, 256 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..e41afcf8fd0e --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..60e5a0b6710e --- /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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435712, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..2d34c4638858 --- /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": [ 1073741824 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..9b52be22ad96 --- /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": 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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..05f9b7371dd2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..f1dda654d2bb --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 256 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..4e8df50118d3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..7b6ab1fbbbf6 --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..4e8df50118d3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..1c0d6716d614 --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ 1024, 256 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..4e8df50118d3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..53ffff11af02 --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..4e8df50118d3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..0c00b65624ff --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,221 @@ +{ + "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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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/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..aa813caf09bd --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_flexalgo.ref @@ -0,0 +1,15 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x00 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..3dfb96b10efb --- /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": 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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 96, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 76, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + }, + { + "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..72c490ddd552 --- /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 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 10 + Flexible-Algorithm: 129 + Metric-Type: igp + Calculation-Type: spf + Priority: 0 + Flags: 0x00 + \ 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..e53877604fe7 --- /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": 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": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..4e8df50118d3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..67878a24c6b0 --- /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": 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": 0, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..c30c6085fa11 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..d94a34922956 --- /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": 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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 8, + "adminGroups": [ 1073741824, 256 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..4e8df50118d3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..23fe01586189 --- /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": 76, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 56, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 44, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435456, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..4e8df50118d3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..06e8c4476a37 --- /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": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 268435712, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..4e8df50118d3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..394224f70665 --- /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": [ 1073741824 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 4, + "adminGroups": [ 1048576 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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": 56, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name": "Exclude Admin Groups SubTLV", + "type": 1, + "length": 4, + "adminGroups": [ 1073741824 ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 12, + "adminGroups": [ 0, 0, 64 ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length": 8, + "adminGroups": [ 1048576, 268435456 ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 4, + "srlgs": [ 1024 ] + } + ] + } + ] + }, + { + "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..4e8df50118d3 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_flexalgo.ref @@ -0,0 +1,16 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Prefix-Advt-Metric: 10 + Exclude-Admin-Groups: + - 30 + Include-Any-Admin-Groups: + - 70 + Include-All-Admin-Groups: + - 20 + - 60 + Exclude-SRLGs: + - 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..d67f0a3ced12 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/test_ospf_flexalgo_topo1.py @@ -0,0 +1,1644 @@ +#!/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_flexalgo_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_footer, + step, + start_router, + apply_raw_config, +) + +# 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() + + +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 : + for attempt in range(0,3) : + _, diff = topotest.run_and_expect(test_func, None, count=2, wait=1) + if diff is not None : + break + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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) + + 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 +""" +def test_flex_algo_delete_prefix_advt_metric_step14(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") + # But set the LSA Maxage timer to a much shorter interval for verification + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "ospf maxage-delay 1", + ] + }, + "rt2": { + "raw_config": [ + "router ospf", + "ospf maxage-delay 1", + ] + }, + "rt3": { + "raw_config": [ + "router ospf", + "ospf maxage-delay 1", + ] + }, + "rt4": { + "raw_config": [ + "router ospf", + "ospf maxage-delay 1", + ] + } + } + result = apply_raw_config(tgen, raw_config) + + raw_config = { + "rt4": { + "raw_config": [ + "router ospf", + "ospf maxage-delay 1", + "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 will take upto few seconds. So let's wait for it. + topotest.sleep(2) + + 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_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", + "step14/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 + ) + + # Revert back the LSA Maxage timer to default + raw_config = { + "rt1": { + "raw_config": [ + "router ospf", + "no ospf maxage-delay", + ] + }, + "rt2": { + "raw_config": [ + "router ospf", + "no ospf maxage-delay", + ] + }, + "rt3": { + "raw_config": [ + "router ospf", + "no ospf maxage-delay", + ] + }, + "rt4": { + "raw_config": [ + "router ospf", + "no ospf maxage-delay", + ] + } + } + result = apply_raw_config(tgen, raw_config) + + """ + 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) + + 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))