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..f774888786d0 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/ospfd_flxalg.conf @@ -0,0 +1,40 @@ +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 +! +affinity-map red bit-position 0 +affinity-map green bit-position 100 +affinity-map blue bit-position 1000 +affinity-map yellow bit-position 200 +! +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 + flexible-algorithm 128 priority 10 + flexible-algorithm 128 exclude-admin-group red + flexible-algorithm 128 include-all-admin-group green + flexible-algorithm 128 include-any-admin-group green + flexible-algorithm 128 include-any-admin-group blue + flexible-algorithm 128 exclude-srlg 10 + flexible-algorithm 128 advertise-prefix-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..94cb641a705c --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..9930d482a630 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step1/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..965d3093aa15 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 324, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 304, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 292, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..f37784b18a5a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step10/show_ip_ospf_flexalgo.ref @@ -0,0 +1,18 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + - blue(1000) + 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..935749aea7b4 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step11/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": 192, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 172, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 160, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..99e97797d0c7 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step11/show_ip_ospf_flexalgo.ref @@ -0,0 +1,15 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + 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..934d807009d7 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 216, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 196, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 184, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ + 10, + 40 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..1b95eea85c0d --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step12/show_ip_ospf_flexalgo.ref @@ -0,0 +1,18 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..ba6483641806 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step13/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": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..6c9dc56c27c7 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step13/show_ip_ospf_flexalgo.ref @@ -0,0 +1,15 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) 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..83d5bde03ede --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,239 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/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..1419dd13ab36 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step14/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 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..2bca6f1ba7bf --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_database_opaque.ref @@ -0,0 +1,314 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 220, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 200, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 4, + "algorithmId": 129, + "priority": 128, + "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..e841b1afa23c --- /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..9930d482a630 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step2/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..f7e7c3e45bca --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..275f285ffbcb --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step4/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 20 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..9f40e5d71b48 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 128, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..40d8b458e893 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step5/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 128 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..0cc897057a59 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 236, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 216, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 204, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":28, + "adminGroups":[ + "red", + "yellow" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..261210469a15 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step6/show_ip_ospf_flexalgo.ref @@ -0,0 +1,18 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + - yellow(200) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..f5271d9af419 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step7/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": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..b7d8817e9398 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step7/show_ip_ospf_flexalgo.ref @@ -0,0 +1,15 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..febdbd59ec6a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 128, + "adminGroups": [ + "green", + "yellow", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..c2031ec7c22b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step8/show_ip_ospf_flexalgo.ref @@ -0,0 +1,18 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - yellow(200) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..3fce8c6c92a5 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_database_opaque.ref @@ -0,0 +1,295 @@ +{ + "routerId": "1.1.1.1", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..09083785eec8 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt1/step9/show_ip_ospf_flexalgo.ref @@ -0,0 +1,14 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 100 + Exclude-Admin-Groups: + - red(0) + Include-All-Admin-Groups: + - green(100) + 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..ccb800581ba1 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/ospfd_flxalg.conf @@ -0,0 +1,35 @@ +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 +! +affinity-map red bit-position 0 +affinity-map green bit-position 100 +affinity-map blue bit-position 1000 +affinity-map yellow bit-position 200 +! +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..64a90b636b1e --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_route.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step1/show_ip_route.ref new file mode 100644 index 000000000000..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..4e7c6893fc2e --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 324, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 304, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 292, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step10/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..eb5bf14ffa16 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step11/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": 192, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 172, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 160, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step11/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..faef93aaa73a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 216, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 196, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 184, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ + 10, + 40 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step12/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..36987476d779 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step13/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": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step13/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..bb070bcb7533 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,239 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/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..3a6ce2033fc6 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step2/show_ip_ospf_database_opaque.ref @@ -0,0 +1,314 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 220, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 200, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 4, + "algorithmId": 129, + "priority": 128, + "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..d0b54440b833 --- /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..882ae46bf167 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step4/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..4b2e36d8968b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 128, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step5/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..4a789a6d4d11 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 236, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 216, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 204, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":28, + "adminGroups":[ + "red", + "yellow" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step6/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..64e0d5010dd2 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step7/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": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step7/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..a0c8c0a6f2bd --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 128, + "adminGroups": [ + "green", + "yellow", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step8/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..4ec46e26a427 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_database_opaque.ref @@ -0,0 +1,295 @@ +{ + "routerId": "2.2.2.2", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/step9/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt2/zebra.conf b/tests/topotests/ospf_flexalgo_topo1/rt2/zebra.conf new file mode 100644 index 000000000000..b7da84ea7978 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt2/zebra.conf @@ -0,0 +1,24 @@ +log file zebra.log +! +hostname rt2 +! +! debug zebra kernel +! debug zebra packet +! debug zebra mpls +! +interface lo + ip address 2.2.2.2/32 +! +interface eth-rt2-1 + ip address 10.0.1.20/24 +! +interface eth-rt2-2 + ip address 10.0.4.20/24 +! +interface eth-rt2-3 + ip address 10.0.3.20/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd.conf b/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd.conf new file mode 100644 index 000000000000..a53f0217fbfa --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd.conf @@ -0,0 +1,30 @@ +password 1 +hostname rt3 +log file ospfd.log +log syslog debugging +! +debug ospf sr +! debug ospf te +! debug ospf event +! debug ospf lsa +debug ospf lsa generate +! debug ospf zebra +! +interface lo + ip ospf area 0.0.0.0 + ip ospf passive +! +interface eth-rt3-1 + ip ospf area 0.0.0.0 +! +interface eth-rt3-2 + ip ospf area 0.0.0.0 +! +interface eth-rt3-3 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 3.3.3.3 + capability opaque + router-info area 0.0.0.0 +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd_flxalg.conf b/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd_flxalg.conf new file mode 100644 index 000000000000..53619943bc8f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/ospfd_flxalg.conf @@ -0,0 +1,35 @@ +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 +! +affinity-map red bit-position 0 +affinity-map green bit-position 100 +affinity-map blue bit-position 1000 +affinity-map yellow bit-position 200 +! +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..9eac622c837e --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_route.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_route.ref new file mode 100644 index 000000000000..b84ab3826f0f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step1/show_ip_route.ref @@ -0,0 +1,166 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "ip":"10.0.2.10", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true + } + ] + } + ], + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.20", + "afi":"ipv4", + "interfaceName":"eth-rt3-3", + "active":true + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "prefixLen":32, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":10, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.5.40", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "prefixLen":24, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.10", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.3.20", + "afi":"ipv4", + "interfaceName":"eth-rt3-3", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt3-1", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt3-3", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "prefixLen":24, + "protocol":"ospf", + "selected":true, + "destSelected":true, + "distance":110, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.20", + "afi":"ipv4", + "interfaceName":"eth-rt3-3", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.40", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "prefixLen":24, + "protocol":"ospf", + "distance":110, + "metric":10, + "nexthops":[ + { + "directlyConnected":true, + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..bf206a77e47c --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 324, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 304, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 292, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step10/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..3a36343764ea --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step11/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": 192, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 172, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 160, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step11/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..911e658c1b6c --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 216, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 196, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 184, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ + 10, + 40 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step12/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..e393e4db35ca --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step13/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": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step13/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..92ba0c4a5e99 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,239 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/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..f95f4fbf3fd9 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step2/show_ip_ospf_database_opaque.ref @@ -0,0 +1,314 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 220, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 200, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 4, + "algorithmId": 129, + "priority": 128, + "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..114cde4f5ad6 --- /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..a3031a65bc76 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step4/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..5b22dd8bc166 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 128, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step5/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..d82ad938336f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 236, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 216, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 204, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":28, + "adminGroups":[ + "red", + "yellow" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step6/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..fa8135824e2f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step7/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": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step7/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..d8596cff0d89 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 128, + "adminGroups": [ + "green", + "yellow", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step8/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_database_opaque.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_database_opaque.ref new file mode 100644 index 000000000000..fe280b38f67a --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_database_opaque.ref @@ -0,0 +1,295 @@ +{ + "routerId": "3.3.3.3", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..204ef22e1611 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/step9/show_ip_ospf_flexalgo.ref @@ -0,0 +1 @@ + No Flexible-Algoritthms on this router diff --git a/tests/topotests/ospf_flexalgo_topo1/rt3/zebra.conf b/tests/topotests/ospf_flexalgo_topo1/rt3/zebra.conf new file mode 100644 index 000000000000..8e8bf470c5f1 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt3/zebra.conf @@ -0,0 +1,24 @@ +log file zebra.log +! +hostname rt3 +! +! debug zebra kernel +! debug zebra packet +! debug zebra mpls +! +interface lo + ip address 3.3.3.3/32 +! +interface eth-rt3-1 + ip address 10.0.2.30/24 +! +interface eth-rt3-2 + ip address 10.0.5.30/24 +! +interface eth-rt3-3 + ip address 10.0.3.30/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/ospfd.conf b/tests/topotests/ospf_flexalgo_topo1/rt4/ospfd.conf new file mode 100644 index 000000000000..ae9455887477 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/ospfd.conf @@ -0,0 +1,31 @@ +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 +! +affinity-map red bit-position 0 +affinity-map green bit-position 100 +affinity-map blue bit-position 1000 +affinity-map yellow bit-position 200 +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..2e74766caf50 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/ospfd_flxalg.conf @@ -0,0 +1,41 @@ +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 +! +affinity-map red bit-position 0 +affinity-map green bit-position 100 +affinity-map blue bit-position 1000 +affinity-map yellow bit-position 200 +! +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 + flexible-algorithm 128 priority 10 + flexible-algorithm 128 exclude-admin-group red + flexible-algorithm 128 include-all-admin-group green + flexible-algorithm 128 include-any-admin-group green + flexible-algorithm 128 include-any-admin-group blue + flexible-algorithm 128 exclude-srlg 10 + flexible-algorithm 128 advertise-prefix-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..554483b8f758 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..c34331e05b62 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step1/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..394f070a7237 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 324, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 304, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 292, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Include-All Admin Groups SubTLV", + "type": 3, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..2f1f20ed909b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step10/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..a0f8a42c6998 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step11/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": 192, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 172, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 160, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..2f1f20ed909b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step11/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..4a70b5a9ec38 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 216, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 196, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 184, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name": "Exclude SRLGs SubTLV", + "type": 5, + "length": 8, + "srlgs": [ + 10, + 40 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..2f1f20ed909b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step12/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..204990ab755b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step13/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": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..2f1f20ed909b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step13/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..365552abd8ca --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step14/show_ip_ospf_database_opaque.ref @@ -0,0 +1,239 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/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..7952c8bb7730 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/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: 0x00 + Advt-Prefix-Metric: N + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..3c77a8c93690 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_database_opaque.ref @@ -0,0 +1,314 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 220, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 200, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 4, + "algorithmId": 129, + "priority": 128, + "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..6904e63cc55b --- /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..d253f6e3ec5f --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step2/show_ip_ospf_flexalgo.ref @@ -0,0 +1,24 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + Exclude-SRLGs: + - 10 + Flexible-Algorithm: 129 + Metric-Type: igp + Calculation-Type: spf + Priority: 128 + Flags: 0x00 + Advt-Prefix-Metric: N + \ 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..ab3034fdc19c --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 20, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..2f1f20ed909b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step4/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..acba90ed80d7 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_database_opaque.ref @@ -0,0 +1,304 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 128, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..2ae54ea1078e --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step5/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..3282d6e32e6e --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 236, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 216, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 204, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":28, + "adminGroups":[ + "red", + "yellow" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..2f1f20ed909b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step6/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..2f7259bbf3a8 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step7/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": 204, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 184, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 172, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..2f1f20ed909b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step7/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..2a3bcbd6d767 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_database_opaque.ref @@ -0,0 +1,305 @@ +{ + "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": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name": "Include-Any Admin Groups SubTLV", + "type": 2, + "length": 128, + "adminGroups": [ + "green", + "yellow", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..2f1f20ed909b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step8/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..9e9b565913a9 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_database_opaque.ref @@ -0,0 +1,295 @@ +{ + "routerId": "4.4.4.4", + "areaLocalOpaqueLsa": { + "areas": { + "0.0.0.0": [ + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 80, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 60, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 48, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "2.2.2.2", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "3.3.3.3", + "length": 28, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 8, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "4.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 212, + "opaqueType": "Router Information LSA", + "opaqueId": 0, + "opaqueDataLength": 192, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Router Capabilities TLV", + "type": 1, + "length": 4, + "capabilities": "0x10000000" + }, + { + "name": "Flexible Algorithm Defintion TLV", + "type": 16, + "length": 180, + "algorithmId": 128, + "priority": 10, + "metricType": "igp", + "caculationType": "spf", + "subTLVs": [ + { + "name":"Exclude Admin Groups SubTLV", + "type":1, + "length":4, + "adminGroups":[ + "red" + ] + }, + { + "name":"Include-Any Admin Groups SubTLV", + "type":2, + "length":128, + "adminGroups":[ + "green", + "blue" + ] + }, + { + "name":"Include-All Admin Groups SubTLV", + "type":3, + "length":16, + "adminGroups":[ + "green" + ] + }, + { + "name": "Flexible-Algo Flags SubTLV", + "type": 4, + "length": 4, + "flags": [ 2147483648 ] + }, + { + "name":"Exclude SRLGs SubTLV", + "type":5, + "length":4, + "srlgs":[ + 10 + ] + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "1.1.1.1", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "1.1.1.1", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "7.0.0.1", + "advertisingRouter": "4.4.4.4", + "length": 44, + "opaqueType": "Extended Prefix Opaque LSA", + "opaqueId": 1, + "opaqueDataLength": 24, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Prefix TLV", + "type": 1, + "length": 20, + "prefixAddress": "4.4.4.4", + "prefixLength": 32, + "routeType": 1, + "addressFamily": 0, + "subTLVs": [ + { + "name": "Flex-Algo Prefix Metric (FAPM) SubTLV", + "type": 3, + "length": 8, + "algotithmId": 128, + "flags": 0, + "metric": 10 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "1.1.1.1", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [ + { + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "1.1.1.1", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 100 + } + ] + } + ] + }, + { + "options": "*|O|-|-|-|-|E|-", + "lsaType": "Area-Local Opaque-LSA", + "linkStateId": "11.0.0.0", + "advertisingRouter": "4.4.4.4", + "length": 40, + "opaqueType": "Extended Inter-Area ASBR Opaque LSA", + "opaqueId": 0, + "opaqueDataLength": 20, + "opaqueDataLengthValid": true, + "tlvs": [{ + "name": "Extended Inter-Area ASBR TLV", + "type": 1, + "length": 16, + "asbrRouterId": "4.4.4.4", + "subTLVs": [ + { + "name": "Flex-Algo ASBR Metric (FAAM) SubTLV", + "type": 1, + "length": 8, + "algorithmId": 128, + "metric": 10 + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_flexalgo.ref b/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_flexalgo.ref new file mode 100644 index 000000000000..2f1f20ed909b --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/rt4/step9/show_ip_ospf_flexalgo.ref @@ -0,0 +1,17 @@ +--- Flexible-Algorithm parameters --- + Flexible-Algorithm: 128 + Metric-Type: igp + Calculation-Type: spf + Priority: 10 + Flags: 0x80 + Advt-Prefix-Metric: Y + Prefix-Metric: 10 + Exclude-Admin-Groups: + - red(0) + Include-Any-Admin-Groups: + - green(100) + - blue(1000) + Include-All-Admin-Groups: + - green(100) + 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..472b89df7998 --- /dev/null +++ b/tests/topotests/ospf_flexalgo_topo1/test_ospf_flexalgo_topo1.py @@ -0,0 +1,1663 @@ +#!/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 | RT3 | + | 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 + | +---------+ | + | | | | + | | RT4 | | + +----------+ 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 : + diff = None + for count in range(1,10): + _, diff = topotest.run_and_expect(test_func, None, count=5, wait=1) + if diff is not None: + # if there's some diff we have achieved the desired condition + break + # Else retry few more times + #if still there's no diff, then the desired condition failed + if diff is None: + assertmsg = '"{}" JSON output matches the not-to-be expected result'.format(rname) + logger.info('Not-to-be-Expected result:\n========\n{}\n=========='.format(expected)) + logger.info('Actual result:\n========\n{}\n========'.format(tgen.gears[rname].vtysh_cmd(command))) + assert False, assertmsg + else : + _, diff = topotest.run_and_expect(test_func, None, count=60, wait=1) + if diff is not None: + assertmsg = '"{}" JSON output mismatches the expected result, Diff:\n{}\n'.format(rname, diff) + logger.info('Expected result:\n========\n{}\n=========='.format(expected)) + logger.info('Actual result:\n========\n{}\n========'.format(tgen.gears[rname].vtysh_cmd(command))) + assert False, 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 = None + for count in range(1,10): + result, diff = topotest.run_and_expect(test_func, None, count=5, wait=1) + if result is not None: + # if there's some diff we have achieved the desired condition + break + # Else retry few more times + #if still there's no diff, then the desired condition failed + if result is None: + assertmsg = '"{}" Text output matches the not-to-be expected result:\n'.format(rname) + logger.info('Not-to-be-Expected result:\n========\n{}\n=========='.format(expected)) + logger.info('Actual result:\n========\n{}\n========'.format(tgen.gears[rname].vtysh_cmd(command))) + assert False, assertmsg + else : + result, diff = topotest.run_and_expect(test_func, "", count=3, wait=3.5) + if not result: + assertmsg = '"{}" Text output mismatches the expected result. Diff:\n {}\n'.format(rname, diff) + logger.info('Expected result:\n========\n{}\n=========='.format(expected)) + logger.info('Actual result:\n========\n{}\n========'.format(tgen.gears[rname].vtysh_cmd(command))) + assert False, 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 red" + ] + } + } + + 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 yellow" + ] + } + } + + 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 yellow" + ] + } + } + + 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 red" + ] + } + } + + 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 green" + ] + } + } + + 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 yellow" + ] + } + } + + 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 yellow" + ] + } + } + + 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-all-admin-group to flexible-algo 128 on rt1 +""" +def test_flex_algo_delete_any_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 green", + "flexible-algorithm 128 include-any-admin-group blue", + ] + } + } + + 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 green" + ] + } + } + + 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 blue" + ] + } + } + + 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 blue" + ] + } + } + + 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 green" + ] + } + } + + 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 advertise-prefix-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 advertise-prefix-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 advertise-prefix-metric" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to delete advertise-prefix-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 advertise-prefix-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 advertise-prefix-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 advertise-prefix-metric 10" + ] + } + } + + result = apply_raw_config(tgen, raw_config) + assert result is True, "Testcase {} : Failed to set advertise-prefix-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))