diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt0/isisd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt0/isisd.conf index 1b2c38f72a54..2c8bae7472bc 100644 --- a/tests/topotests/isis_sr_flex_algo_metrics/rt0/isisd.conf +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt0/isisd.conf @@ -33,6 +33,7 @@ router isis 1 net 49.0000.0000.0000.1000.00 is-type level-1 topology ipv6-unicast + redistribute ipv4 static level-1 metric 25 mpls-te on ! flex-algo 128 @@ -58,6 +59,12 @@ router isis 1 dataplane sr-mpls metric-type delay ! + flex-algo 142 + dataplane sr-mpls + advertise-definition + metric-type te + prefix-metric + ! segment-routing on segment-routing global-block 20000 23999 segment-routing node-msd 8 @@ -67,4 +74,5 @@ router isis 1 segment-routing prefix 10.10.10.10/32 algorithm 130 index 300 segment-routing prefix 10.10.10.10/32 algorithm 140 index 1400 segment-routing prefix 10.10.10.10/32 algorithm 141 index 1410 + segment-routing prefix 10.10.10.10/32 algorithm 142 index 1420 ! diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt0/staticd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt0/staticd.conf new file mode 100644 index 000000000000..ed7741ce03f3 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt0/staticd.conf @@ -0,0 +1 @@ +ip route 10.44.0.0/24 10.1.0.254 diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt0/step1/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt0/step1/route-142.json new file mode 100644 index 000000000000..199421efda42 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt0/step1/route-142.json @@ -0,0 +1,84 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 110, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "implicit-null" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5210, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 210, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5010, + "Interface": "eth-rt5", + "Nexthop": "10.5.0.5", + "Label(s)": "implicit-null" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5410, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 410, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21427" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 310, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 510, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt0/step2/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt0/step2/route-142.json new file mode 100644 index 000000000000..976baff9d972 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt0/step2/route-142.json @@ -0,0 +1,84 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 110, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "implicit-null" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5410, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 210, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5010, + "Interface": "eth-rt5", + "Nexthop": "10.5.0.5", + "Label(s)": "implicit-null" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5410, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 410, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21427" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 310, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 510, + "Interface": "eth-rt1", + "Nexthop": "10.1.0.1", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt1/isisd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt1/isisd.conf index 0003b51c2c73..b42dd47b9a77 100644 --- a/tests/topotests/isis_sr_flex_algo_metrics/rt1/isisd.conf +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt1/isisd.conf @@ -55,6 +55,8 @@ router isis 1 dataplane sr-mpls flex-algo 141 dataplane sr-mpls + flex-algo 142 + dataplane sr-mpls ! segment-routing on segment-routing global-block 20000 23999 @@ -65,4 +67,5 @@ router isis 1 segment-routing prefix 1.1.1.1/32 algorithm 130 index 301 segment-routing prefix 1.1.1.1/32 algorithm 140 index 1401 segment-routing prefix 1.1.1.1/32 algorithm 141 index 1411 + segment-routing prefix 1.1.1.1/32 algorithm 142 index 1421 ! diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt1/step1/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt1/step1/route-142.json new file mode 100644 index 000000000000..37363730acde --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt1/step1/route-142.json @@ -0,0 +1,91 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5010, + "Interface": "eth-rt2", + "Nexthop": "10.12.0.2", + "Label(s)": "implicit-null" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5110, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 110, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "implicit-null" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5010, + "Interface": "eth-rt5", + "Nexthop": "10.15.0.5", + "Label(s)": "implicit-null" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5310, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 310, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "21427" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 210, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 410, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 110, + "Interface": "eth-rt0", + "Nexthop": "10.1.0.10", + "Label(s)": "implicit-null" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 125, + "Interface": "eth-rt0", + "Nexthop": "10.1.0.10", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt1/step2/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt1/step2/route-142.json new file mode 100644 index 000000000000..5f15b60f446f --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt1/step2/route-142.json @@ -0,0 +1,84 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5010, + "Interface": "eth-rt2", + "Nexthop": "10.12.0.2", + "Label(s)": "implicit-null" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5310, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 110, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "implicit-null" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5010, + "Interface": "eth-rt5", + "Nexthop": "10.15.0.5", + "Label(s)": "implicit-null" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5310, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 310, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "21427" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 210, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 410, + "Interface": "eth-rt4", + "Nexthop": "10.14.0.4", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 110, + "Interface": "eth-rt0", + "Nexthop": "10.1.0.10", + "Label(s)": "implicit-null" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt2/isisd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt2/isisd.conf index 168619f35b10..2a08b2016859 100644 --- a/tests/topotests/isis_sr_flex_algo_metrics/rt2/isisd.conf +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt2/isisd.conf @@ -47,6 +47,8 @@ router isis 1 dataplane sr-mpls flex-algo 141 dataplane sr-mpls + flex-algo 142 + dataplane sr-mpls ! segment-routing on segment-routing global-block 20000 23999 @@ -57,4 +59,5 @@ router isis 1 segment-routing prefix 2.2.2.2/32 algorithm 130 index 302 segment-routing prefix 2.2.2.2/32 algorithm 140 index 1402 segment-routing prefix 2.2.2.2/32 algorithm 141 index 1412 + segment-routing prefix 2.2.2.2/32 algorithm 142 index 1422 ! diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt2/step1/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt2/step1/route-142.json new file mode 100644 index 000000000000..830a54bf90f7 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt2/step1/route-142.json @@ -0,0 +1,98 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 5010, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "implicit-null" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5010, + "Interface": "eth-rt3", + "Nexthop": "10.23.0.3", + "Label(s)": "implicit-null" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 10010, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21425" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 10010, + "Interface": "eth-rt6", + "Nexthop": "10.26.0.6", + "Label(s)": "21425" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5010, + "Interface": "eth-rt6", + "Nexthop": "10.26.0.6", + "Label(s)": "implicit-null" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 5310, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21427" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 5210, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 5410, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 5125, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt2/step2/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt2/step2/route-142.json new file mode 100644 index 000000000000..bacb62c95ec4 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt2/step2/route-142.json @@ -0,0 +1,91 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 5010, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "implicit-null" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5010, + "Interface": "eth-rt3", + "Nexthop": "10.23.0.3", + "Label(s)": "implicit-null" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 10010, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21425" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 10010, + "Interface": "eth-rt6", + "Nexthop": "10.26.0.6", + "Label(s)": "21425" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5010, + "Interface": "eth-rt6", + "Nexthop": "10.26.0.6", + "Label(s)": "implicit-null" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 5310, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21427" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 5210, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 5410, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.12.0.1", + "Label(s)": "21420" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt3/isisd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt3/isisd.conf index a0d5ad924e99..acbb374ed9f6 100644 --- a/tests/topotests/isis_sr_flex_algo_metrics/rt3/isisd.conf +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt3/isisd.conf @@ -55,6 +55,8 @@ router isis 1 dataplane sr-mpls flex-algo 141 dataplane sr-mpls + flex-algo 142 + dataplane sr-mpls ! segment-routing on segment-routing global-block 20000 23999 @@ -65,4 +67,5 @@ router isis 1 segment-routing prefix 3.3.3.3/32 algorithm 130 index 303 segment-routing prefix 3.3.3.3/32 algorithm 140 index 1403 segment-routing prefix 3.3.3.3/32 algorithm 141 index 1413 + segment-routing prefix 3.3.3.3/32 algorithm 142 index 1423 ! diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt3/step1/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt3/step1/route-142.json new file mode 100644 index 000000000000..644695b17fa6 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt3/step1/route-142.json @@ -0,0 +1,112 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 5110, + "Interface": "eth-rt4", + "Nexthop": "10.34.0.4", + "Label(s)": "21421" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5010, + "Interface": "eth-rt2", + "Nexthop": "10.23.0.2", + "Label(s)": "implicit-null" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 5010, + "Interface": "eth-rt4", + "Nexthop": "10.34.0.4", + "Label(s)": "implicit-null" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 10110, + "Interface": "eth-rt4", + "Nexthop": "10.34.0.4", + "Label(s)": "21425" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 10110, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "21425" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 10010, + "Interface": "eth-rt2", + "Nexthop": "10.23.0.2", + "Label(s)": "21426" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 10010, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 5010, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "implicit-null" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 5110, + "Interface": "eth-rt4", + "Nexthop": "10.34.0.4", + "Label(s)": "21428" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 5010, + "Interface": "eth-rt9", + "Nexthop": "10.39.0.9", + "Label(s)": "implicit-null" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 5210, + "Interface": "eth-rt4", + "Nexthop": "10.34.0.4", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 5225, + "Interface": "eth-rt4", + "Nexthop": "10.34.0.4", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt3/step2/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt3/step2/route-142.json new file mode 100644 index 000000000000..8f333ee91f78 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt3/step2/route-142.json @@ -0,0 +1,91 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 5310, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "21421" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5010, + "Interface": "eth-rt2", + "Nexthop": "10.23.0.2", + "Label(s)": "implicit-null" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 5210, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 10110, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "21425" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 10010, + "Interface": "eth-rt2", + "Nexthop": "10.23.0.2", + "Label(s)": "21426" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 10010, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 5010, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "implicit-null" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 5010, + "Interface": "eth-rt9", + "Nexthop": "10.39.0.9", + "Label(s)": "implicit-null" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 5410, + "Interface": "eth-rt7", + "Nexthop": "10.37.0.7", + "Label(s)": "21420" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt4/isisd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt4/isisd.conf index 04cf86e4332c..9a51a94c96d1 100644 --- a/tests/topotests/isis_sr_flex_algo_metrics/rt4/isisd.conf +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt4/isisd.conf @@ -45,6 +45,8 @@ router isis 1 dataplane sr-mpls flex-algo 141 dataplane sr-mpls + flex-algo 142 + dataplane sr-mpls ! segment-routing on segment-routing global-block 20000 23999 @@ -55,4 +57,5 @@ router isis 1 segment-routing prefix 4.4.4.4/32 algorithm 130 index 304 segment-routing prefix 4.4.4.4/32 algorithm 140 index 1404 segment-routing prefix 4.4.4.4/32 algorithm 141 index 1414 + segment-routing prefix 4.4.4.4/32 algorithm 142 index 1424 ! diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt4/step1/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt4/step1/route-142.json new file mode 100644 index 000000000000..cce5ddd0d7a2 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt4/step1/route-142.json @@ -0,0 +1,98 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 110, + "Interface": "eth-rt1", + "Nexthop": "10.14.0.1", + "Label(s)": "implicit-null" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.14.0.1", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5010, + "Interface": "eth-rt3", + "Nexthop": "10.34.0.3", + "Label(s)": "implicit-null" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.14.0.1", + "Label(s)": "21425" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5110, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "21425" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5210, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 210, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "21427" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 110, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "implicit-null" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 310, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 210, + "Interface": "eth-rt1", + "Nexthop": "10.14.0.1", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 225, + "Interface": "eth-rt1", + "Nexthop": "10.14.0.1", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt4/step2/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt4/step2/route-142.json new file mode 100644 index 000000000000..950ae9d0c78f --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt4/step2/route-142.json @@ -0,0 +1,98 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 110, + "Interface": "eth-rt1", + "Nexthop": "10.14.0.1", + "Label(s)": "implicit-null" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.14.0.1", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5210, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.14.0.1", + "Label(s)": "21425" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5110, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "21425" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5210, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 210, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "21427" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 110, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "implicit-null" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 310, + "Interface": "eth-rt8", + "Nexthop": "10.48.0.8", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 210, + "Interface": "eth-rt1", + "Nexthop": "10.14.0.1", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 225, + "Interface": "eth-rt1", + "Nexthop": "10.14.0.1", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt5/isisd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt5/isisd.conf index 44c2b47397f9..b9f7c595d3e0 100644 --- a/tests/topotests/isis_sr_flex_algo_metrics/rt5/isisd.conf +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt5/isisd.conf @@ -49,6 +49,8 @@ router isis 1 dataplane sr-mpls flex-algo 141 dataplane sr-mpls + flex-algo 142 + dataplane sr-mpls ! segment-routing on segment-routing global-block 20000 23999 @@ -59,4 +61,5 @@ router isis 1 segment-routing prefix 5.5.5.5/32 algorithm 130 index 305 segment-routing prefix 5.5.5.5/32 algorithm 140 index 1405 segment-routing prefix 5.5.5.5/32 algorithm 141 index 1415 + segment-routing prefix 5.5.5.5/32 algorithm 142 index 1425 ! diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt5/step1/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt5/step1/route-142.json new file mode 100644 index 000000000000..0b3abcf31c8f --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt5/step1/route-142.json @@ -0,0 +1,112 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 5010, + "Interface": "eth-rt1", + "Nexthop": "10.15.0.1", + "Label(s)": "implicit-null" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 10010, + "Interface": "eth-rt1", + "Nexthop": "10.15.0.1", + "Label(s)": "21422" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 10010, + "Interface": "eth-rt6", + "Nexthop": "10.56.0.6", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 10110, + "Interface": "eth-rt1", + "Nexthop": "10.15.0.1", + "Label(s)": "21423" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 10110, + "Interface": "eth-rt8", + "Nexthop": "10.58.0.8", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.15.0.1", + "Label(s)": "21424" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 5110, + "Interface": "eth-rt8", + "Nexthop": "10.58.0.8", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5010, + "Interface": "eth-rt6", + "Nexthop": "10.56.0.6", + "Label(s)": "implicit-null" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 5110, + "Interface": "eth-rt8", + "Nexthop": "10.58.0.8", + "Label(s)": "21427" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 5010, + "Interface": "eth-rt8", + "Nexthop": "10.58.0.8", + "Label(s)": "implicit-null" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 5210, + "Interface": "eth-rt8", + "Nexthop": "10.58.0.8", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 5010, + "Interface": "eth-rt0", + "Nexthop": "10.5.0.10", + "Label(s)": "implicit-null" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 5025, + "Interface": "eth-rt0", + "Nexthop": "10.5.0.10", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt5/step2/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt5/step2/route-142.json new file mode 100644 index 000000000000..205d39d00b01 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt5/step2/route-142.json @@ -0,0 +1,112 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 5010, + "Interface": "eth-rt1", + "Nexthop": "10.15.0.1", + "Label(s)": "implicit-null" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 10010, + "Interface": "eth-rt1", + "Nexthop": "10.15.0.1", + "Label(s)": "21422" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 10010, + "Interface": "eth-rt6", + "Nexthop": "10.56.0.6", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 10110, + "Interface": "eth-rt8", + "Nexthop": "10.58.0.8", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 5110, + "Interface": "eth-rt1", + "Nexthop": "10.15.0.1", + "Label(s)": "21424" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 5110, + "Interface": "eth-rt8", + "Nexthop": "10.58.0.8", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5010, + "Interface": "eth-rt6", + "Nexthop": "10.56.0.6", + "Label(s)": "implicit-null" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 5110, + "Interface": "eth-rt8", + "Nexthop": "10.58.0.8", + "Label(s)": "21427" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 5010, + "Interface": "eth-rt8", + "Nexthop": "10.58.0.8", + "Label(s)": "implicit-null" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 5210, + "Interface": "eth-rt8", + "Nexthop": "10.58.0.8", + "Label(s)": "21429" + }, + { + "Prefix": "10.1.0.0/24", + "Metric": 5010, + "Interface": "eth-rt0", + "Nexthop": "10.5.0.10", + "Label(s)": "-" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 5010, + "Interface": "eth-rt0", + "Nexthop": "10.5.0.10", + "Label(s)": "implicit-null" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 5025, + "Interface": "eth-rt0", + "Nexthop": "10.5.0.10", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt6/isisd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt6/isisd.conf index 1570e828a91b..be94be7628c0 100644 --- a/tests/topotests/isis_sr_flex_algo_metrics/rt6/isisd.conf +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt6/isisd.conf @@ -49,6 +49,8 @@ router isis 1 dataplane sr-mpls flex-algo 141 dataplane sr-mpls + flex-algo 142 + dataplane sr-mpls ! segment-routing on segment-routing global-block 20000 23999 @@ -59,4 +61,5 @@ router isis 1 segment-routing prefix 6.6.6.6/32 algorithm 130 index 306 segment-routing prefix 6.6.6.6/32 algorithm 140 index 1406 segment-routing prefix 6.6.6.6/32 algorithm 141 index 1416 + segment-routing prefix 6.6.6.6/32 algorithm 142 index 1426 ! diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt6/step1/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt6/step1/route-142.json new file mode 100644 index 000000000000..d78ce3bc9e23 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt6/step1/route-142.json @@ -0,0 +1,98 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 5310, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21421" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5010, + "Interface": "eth-rt2", + "Nexthop": "10.26.0.2", + "Label(s)": "implicit-null" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 10010, + "Interface": "eth-rt2", + "Nexthop": "10.26.0.2", + "Label(s)": "21423" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 10010, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 5210, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5010, + "Interface": "eth-rt5", + "Nexthop": "10.56.0.5", + "Label(s)": "implicit-null" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 5010, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "implicit-null" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 5410, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 5425, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt6/step2/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt6/step2/route-142.json new file mode 100644 index 000000000000..d78ce3bc9e23 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt6/step2/route-142.json @@ -0,0 +1,98 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 5310, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21421" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5010, + "Interface": "eth-rt2", + "Nexthop": "10.26.0.2", + "Label(s)": "implicit-null" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 10010, + "Interface": "eth-rt2", + "Nexthop": "10.26.0.2", + "Label(s)": "21423" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 10010, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 5210, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5010, + "Interface": "eth-rt5", + "Nexthop": "10.56.0.5", + "Label(s)": "implicit-null" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 5010, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "implicit-null" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 5410, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 5425, + "Interface": "eth-rt7", + "Nexthop": "10.67.0.7", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt7/isisd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt7/isisd.conf index 9c6eb1138bcc..1325e99ef7bb 100644 --- a/tests/topotests/isis_sr_flex_algo_metrics/rt7/isisd.conf +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt7/isisd.conf @@ -55,6 +55,8 @@ router isis 1 dataplane sr-mpls flex-algo 141 dataplane sr-mpls + flex-algo 142 + dataplane sr-mpls ! segment-routing on segment-routing global-block 20000 23999 @@ -65,4 +67,5 @@ router isis 1 segment-routing prefix 7.7.7.7/32 algorithm 130 index 307 segment-routing prefix 7.7.7.7/32 algorithm 140 index 1407 segment-routing prefix 7.7.7.7/32 algorithm 141 index 1417 + segment-routing prefix 7.7.7.7/32 algorithm 142 index 1427 ! diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt7/step1/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt7/step1/route-142.json new file mode 100644 index 000000000000..75f9adf2d4eb --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt7/step1/route-142.json @@ -0,0 +1,91 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 310, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "21421" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5310, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5010, + "Interface": "eth-rt3", + "Nexthop": "10.37.0.3", + "Label(s)": "implicit-null" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 210, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5110, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "21425" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5010, + "Interface": "eth-rt6", + "Nexthop": "10.67.0.6", + "Label(s)": "implicit-null" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 110, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "implicit-null" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 110, + "Interface": "eth-rt9", + "Nexthop": "10.79.0.9", + "Label(s)": "implicit-null" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 410, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 425, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt7/step2/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt7/step2/route-142.json new file mode 100644 index 000000000000..75f9adf2d4eb --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt7/step2/route-142.json @@ -0,0 +1,91 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 310, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "21421" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5310, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5010, + "Interface": "eth-rt3", + "Nexthop": "10.37.0.3", + "Label(s)": "implicit-null" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 210, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5110, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "21425" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5010, + "Interface": "eth-rt6", + "Nexthop": "10.67.0.6", + "Label(s)": "implicit-null" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 110, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "implicit-null" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 110, + "Interface": "eth-rt9", + "Nexthop": "10.79.0.9", + "Label(s)": "implicit-null" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 410, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 425, + "Interface": "eth-rt8", + "Nexthop": "10.78.0.8", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt8/isisd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt8/isisd.conf index 4546f56e43f1..98518856c1c8 100644 --- a/tests/topotests/isis_sr_flex_algo_metrics/rt8/isisd.conf +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt8/isisd.conf @@ -43,6 +43,8 @@ router isis 1 dataplane sr-mpls flex-algo 141 dataplane sr-mpls + flex-algo 142 + dataplane sr-mpls ! segment-routing on segment-routing global-block 20000 23999 @@ -53,4 +55,5 @@ router isis 1 segment-routing prefix 8.8.8.8/32 algorithm 130 index 308 segment-routing prefix 8.8.8.8/32 algorithm 140 index 1408 segment-routing prefix 8.8.8.8/32 algorithm 141 index 1418 + segment-routing prefix 8.8.8.8/32 algorithm 142 index 1428 ! diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt8/step1/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt8/step1/route-142.json new file mode 100644 index 000000000000..5b89e8ed8a0e --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt8/step1/route-142.json @@ -0,0 +1,98 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 210, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "21421" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5210, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5110, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "21423" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.78.0.7", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 110, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "implicit-null" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5010, + "Interface": "eth-rt5", + "Nexthop": "10.58.0.5", + "Label(s)": "implicit-null" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.78.0.7", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 110, + "Interface": "eth-rt7", + "Nexthop": "10.78.0.7", + "Label(s)": "implicit-null" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 210, + "Interface": "eth-rt7", + "Nexthop": "10.78.0.7", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 310, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 325, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt8/step2/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt8/step2/route-142.json new file mode 100644 index 000000000000..c0b36362ab60 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt8/step2/route-142.json @@ -0,0 +1,91 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 210, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "21421" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5210, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.78.0.7", + "Label(s)": "21423" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 110, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "implicit-null" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5010, + "Interface": "eth-rt5", + "Nexthop": "10.58.0.5", + "Label(s)": "implicit-null" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.78.0.7", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 110, + "Interface": "eth-rt7", + "Nexthop": "10.78.0.7", + "Label(s)": "implicit-null" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 210, + "Interface": "eth-rt7", + "Nexthop": "10.78.0.7", + "Label(s)": "21429" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 310, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 325, + "Interface": "eth-rt4", + "Nexthop": "10.48.0.4", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt9/isisd.conf b/tests/topotests/isis_sr_flex_algo_metrics/rt9/isisd.conf index 2daf50847831..5a087248f824 100644 --- a/tests/topotests/isis_sr_flex_algo_metrics/rt9/isisd.conf +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt9/isisd.conf @@ -56,6 +56,12 @@ router isis 1 advertise-definition metric-type delay ! + flex-algo 142 + dataplane sr-mpls + advertise-definition + metric-type te + prefix-metric + ! segment-routing on segment-routing global-block 20000 23999 segment-routing node-msd 8 @@ -65,4 +71,5 @@ router isis 1 segment-routing prefix 9.9.9.9/32 algorithm 130 index 309 segment-routing prefix 9.9.9.9/32 algorithm 140 index 1409 segment-routing prefix 9.9.9.9/32 algorithm 141 index 1419 + segment-routing prefix 9.9.9.9/32 algorithm 142 index 1429 ! diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt9/step1/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt9/step1/route-142.json new file mode 100644 index 000000000000..31bbd50f6ed3 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt9/step1/route-142.json @@ -0,0 +1,91 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 410, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21421" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5410, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5010, + "Interface": "eth-rt3", + "Nexthop": "10.39.0.3", + "Label(s)": "implicit-null" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 310, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5210, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21425" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 110, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "implicit-null" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 210, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 510, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 525, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/rt9/step2/route-142.json b/tests/topotests/isis_sr_flex_algo_metrics/rt9/step2/route-142.json new file mode 100644 index 000000000000..31bbd50f6ed3 --- /dev/null +++ b/tests/topotests/isis_sr_flex_algo_metrics/rt9/step2/route-142.json @@ -0,0 +1,91 @@ +[ + { + "area": "1", + "level-1": { + "area": "1", + "ipv4": [ + { + "Prefix": "1.1.1.1/32", + "Metric": 410, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21421" + }, + { + "Prefix": "2.2.2.2/32", + "Metric": 5410, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21422" + }, + { + "Prefix": "3.3.3.3/32", + "Metric": 5010, + "Interface": "eth-rt3", + "Nexthop": "10.39.0.3", + "Label(s)": "implicit-null" + }, + { + "Prefix": "4.4.4.4/32", + "Metric": 310, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21424" + }, + { + "Prefix": "5.5.5.5/32", + "Metric": 5210, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21425" + }, + { + "Prefix": "6.6.6.6/32", + "Metric": 5110, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21426" + }, + { + "Prefix": "7.7.7.7/32", + "Metric": 110, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "implicit-null" + }, + { + "Prefix": "8.8.8.8/32", + "Metric": 210, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21428" + }, + { + "Prefix": "9.9.9.9/32", + "Metric": 0, + "Interface": "-", + "Nexthop": "-", + "Label(s)": "-" + }, + { + "Prefix": "10.10.10.10/32", + "Metric": 510, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "21420" + }, + { + "Prefix": "10.44.0.0/24", + "Metric": 525, + "Interface": "eth-rt7", + "Nexthop": "10.79.0.7", + "Label(s)": "-" + } + ] + }, + "level-2": { + "area": "1" + }, + "vrf_id": 0 + } +] diff --git a/tests/topotests/isis_sr_flex_algo_metrics/test_isis_sr_flex_algo_metrics.py b/tests/topotests/isis_sr_flex_algo_metrics/test_isis_sr_flex_algo_metrics.py index 96fe606b22bb..995f29f85d50 100755 --- a/tests/topotests/isis_sr_flex_algo_metrics/test_isis_sr_flex_algo_metrics.py +++ b/tests/topotests/isis_sr_flex_algo_metrics/test_isis_sr_flex_algo_metrics.py @@ -16,6 +16,7 @@ [+] Flex-Algos 140 metric-type te [+] Flex-Algos 141 metric-type delay +[+] Flex-Algos 141 metric-type te - prefix-metric flags enabled The purpose of this test is to verify that the alternate metrics (te metric and delay == min delay) are used when calculating an @@ -136,6 +137,10 @@ def setup_module(mod): router.load_config( TopoRouter.RD_ISIS, os.path.join(CWD, "{}/isisd.conf".format(rname)) ) + if rname == "rt0": + router.load_config( + TopoRouter.RD_STATIC, os.path.join(CWD, "{}/staticd.conf".format(rname)) + ) if rname in ["rt0", "rt9"]: router.load_config( TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname)) @@ -224,21 +229,39 @@ def generate_route_tables(): def test_route_tables_step1(): - logger.info("Test (step 1)") + logger.info("Test route tables (step 1)") tgen = get_topogen() if tgen.routers_have_failure(): pytest.skip(tgen.errors) for r in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]: rt = "rt" + r - for algo in ["140", "141"]: + for algo in ["140", "141", "142"]: cmd = "show isis route algo " + algo + " json" fn = rt + "/step1/route-" + algo + ".json" check_rib(rt, cmd, fn) +def test_external_prefix_step1(): + logger.info("Test external prefix (step 1)") + tgen = get_topogen() + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + expected = """ + Extended IP Reachability: 10.44.0.0/24 (Metric: 25) + Subtlvs: + Prefix attribute flags: 0x80 External (X): 1 + Flex Algo Prefix-Metric Algorithm: 142, Metric: 25 +""" + + output = tgen.gears["rt9"].vtysh_cmd("show isis database detail rt0") + + assert expected in output, "External Prefix 10.44.0.0/24 TLV is incorrect" + + def test_route_tables_prune_link_step2(): - logger.info("Test (step 2)") + logger.info("Test route table after a link shutdown (step 2)") tgen = get_topogen() if tgen.routers_have_failure(): pytest.skip(tgen.errors) @@ -264,7 +287,7 @@ def test_route_tables_prune_link_step2(): time.sleep(5) for r in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]: rt = "rt" + r - for algo in ["140", "141"]: + for algo in ["140", "141", "142"]: cmd = "show isis route algo " + algo + " json" fn = rt + "/step2/route-" + algo + ".json" check_rib(rt, cmd, fn)