diff options
Diffstat (limited to 'tests/topotests/ospf_te_topo1')
17 files changed, 4077 insertions, 0 deletions
diff --git a/tests/topotests/ospf_te_topo1/__init__.py b/tests/topotests/ospf_te_topo1/__init__.py new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/tests/topotests/ospf_te_topo1/__init__.py diff --git a/tests/topotests/ospf_te_topo1/r1/ospfd.conf b/tests/topotests/ospf_te_topo1/r1/ospfd.conf new file mode 100644 index 0000000..312dd26 --- /dev/null +++ b/tests/topotests/ospf_te_topo1/r1/ospfd.conf @@ -0,0 +1,23 @@ +! +interface lo + ip ospf area 0.0.0.0 +! +interface r1-eth0 + ip ospf network point-to-point + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf area 0.0.0.0 +! +interface r1-eth1 + ip ospf network point-to-point + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 10.0.255.1 + capability opaque + mpls-te on + mpls-te router-address 10.0.255.1 +! + diff --git a/tests/topotests/ospf_te_topo1/r1/zebra.conf b/tests/topotests/ospf_te_topo1/r1/zebra.conf new file mode 100644 index 0000000..c47789a --- /dev/null +++ b/tests/topotests/ospf_te_topo1/r1/zebra.conf @@ -0,0 +1,22 @@ +! +interface lo + ip address 10.0.255.1/32 +! +interface r1-eth0 + ip address 10.0.0.1/24 + link-params + metric 20 + delay 10000 + max-bw 10e+10 + ava-bw 1.25e+08 + enable + exit-link-params +! +interface r1-eth1 + ip address 10.0.1.1/24 + link-params + enable + exit-link-params +! +ip forwarding +! diff --git a/tests/topotests/ospf_te_topo1/r2/ospfd.conf b/tests/topotests/ospf_te_topo1/r2/ospfd.conf new file mode 100644 index 0000000..e9c3f65 --- /dev/null +++ b/tests/topotests/ospf_te_topo1/r2/ospfd.conf @@ -0,0 +1,34 @@ +! +interface lo + ip ospf area 0.0.0.0 +! +interface r2-eth0 + ip ospf network point-to-point + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf area 0.0.0.0 +! +interface r2-eth1 + ip ospf network point-to-point + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf area 0.0.0.0 +! +interface r2-eth2 + ip ospf network point-to-point + ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 10 +! +interface r2-eth3 + ip ospf network point-to-point + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf area 0.0.0.0 +! +router ospf + ospf router-id 10.0.255.2 + capability opaque + mpls-te on + mpls-te router-address 10.0.255.2 +! diff --git a/tests/topotests/ospf_te_topo1/r2/zebra.conf b/tests/topotests/ospf_te_topo1/r2/zebra.conf new file mode 100644 index 0000000..a9771f7 --- /dev/null +++ b/tests/topotests/ospf_te_topo1/r2/zebra.conf @@ -0,0 +1,34 @@ +! +interface lo + ip address 10.0.255.2/32 +! +interface r2-eth0 + ip address 10.0.0.2/24 + link-params + enable + exit-link-params +! +interface r2-eth1 + ip address 10.0.1.2/24 + link-params + enable + exit-link-params +! +interface r2-eth2 + ip address 10.0.3.2/24 + link-params + enable + exit-link-params +! +interface r2-eth3 + ip address 10.0.4.2/24 + link-params + metric 30 + delay 25000 + max-bw 10e+10 + use-bw 1.25e+8 + enable + exit-link-params +! +ip forwarding +! diff --git a/tests/topotests/ospf_te_topo1/r3/ospfd.conf b/tests/topotests/ospf_te_topo1/r3/ospfd.conf new file mode 100644 index 0000000..caa5f1e --- /dev/null +++ b/tests/topotests/ospf_te_topo1/r3/ospfd.conf @@ -0,0 +1,24 @@ +! +interface lo + ip ospf area 0.0.0.0 +! +interface r3-eth0 + ip ospf network point-to-point + ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 10 +! +interface r3-eth1 + ip ospf network point-to-point + ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 10 +! +! +router ospf + ospf router-id 10.0.255.3 + capability opaque + mpls-te on + mpls-te router-address 10.0.255.3 + mpls-te inter-as as +! diff --git a/tests/topotests/ospf_te_topo1/r3/zebra.conf b/tests/topotests/ospf_te_topo1/r3/zebra.conf new file mode 100644 index 0000000..4cf9077 --- /dev/null +++ b/tests/topotests/ospf_te_topo1/r3/zebra.conf @@ -0,0 +1,22 @@ +! +interface lo + ip address 10.0.255.3/32 +! +interface r3-eth0 + ip address 10.0.3.1/24 + link-params + enable + admin-grp 0x20 + exit-link-params +! +interface r3-eth1 + ip address 10.0.5.1/24 + link-params + enable + metric 10 + delay 50000 + neighbor 10.0.255.5 as 65535 + exit-link-params +! +ip forwarding +! diff --git a/tests/topotests/ospf_te_topo1/r4/ospfd.conf b/tests/topotests/ospf_te_topo1/r4/ospfd.conf new file mode 100644 index 0000000..cd50801 --- /dev/null +++ b/tests/topotests/ospf_te_topo1/r4/ospfd.conf @@ -0,0 +1,21 @@ +! +interface lo + ip ospf area 0.0.0.0 +! +interface r4-eth0 + ip ospf network point-to-point + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf area 0.0.0.0 +! +! +router ospf + ospf router-id 10.0.255.4 + capability opaque + mpls-te on + mpls-te router-address 10.0.255.4 + segment-routing on + segment-routing global-block 10000 19999 local-block 5000 5999 + segment-routing node-msd 12 + segment-routing prefix 10.0.255.4/32 index 400 no-php-flag +! diff --git a/tests/topotests/ospf_te_topo1/r4/zebra.conf b/tests/topotests/ospf_te_topo1/r4/zebra.conf new file mode 100644 index 0000000..18c003b --- /dev/null +++ b/tests/topotests/ospf_te_topo1/r4/zebra.conf @@ -0,0 +1,12 @@ +! +interface lo + ip address 10.0.255.4/32 +! +interface r4-eth0 + ip address 10.0.4.1/24 + link-params + enable + exit-link-params +! +ip forwarding +! diff --git a/tests/topotests/ospf_te_topo1/reference/ted_step1.json b/tests/topotests/ospf_te_topo1/reference/ted_step1.json new file mode 100644 index 0000000..8b2413a --- /dev/null +++ b/tests/topotests/ospf_te_topo1/reference/ted_step1.json @@ -0,0 +1,571 @@ +{ + "ted":{ + "name":"OSPF", + "key":1, + "verticesCount":5, + "edgesCount":9, + "subnetsCount":14, + "vertices":[ + { + "vertex-id":167837441, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.1", + "vertex-type":"Standard" + }, + { + "vertex-id":167837442, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.2", + "vertex-type":"Standard" + }, + { + "vertex-id":167837443, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.3", + "vertex-type":"ASBR" + }, + { + "vertex-id":167837444, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.4", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":10000, + "srgb-lower":10000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":1000, + "srlb-lower":5000, + "msd":12 + } + }, + { + "vertex-id":167837445, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.5", + "vertex-type":"Remote ASBR", + "asn":65535 + } + ], + "edges":[ + { + "edge-id":"10.0.0.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "te-metric":20, + "local-address":"10.0.0.1", + "remote-address":"10.0.0.2", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":10000, + "available-bandwidth":125000000.0 + } + }, + { + "edge-id":"10.0.0.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.0.2", + "remote-address":"10.0.0.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.1.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.1.1", + "remote-address":"10.0.1.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.1.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.1.2", + "remote-address":"10.0.1.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.3.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "local-vertex-id":167837443, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "admin-group":32, + "local-address":"10.0.3.1", + "remote-address":"10.0.3.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.3.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837443, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.3.2", + "remote-address":"10.0.3.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.4.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "local-vertex-id":167837444, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.4.1", + "remote-address":"10.0.4.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.4.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837444, + "metric":10, + "edge-attributes":{ + "te-metric":30, + "local-address":"10.0.4.2", + "remote-address":"10.0.4.1", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":25000, + "utilized-bandwidth":125000000.0 + } + }, + { + "edge-id":"10.0.5.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "local-vertex-id":167837443, + "remote-vertex-id":167837445, + "metric":0, + "edge-attributes":{ + "te-metric":10, + "local-address":"10.0.5.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "remote-asn":65535, + "remote-as-address":"10.0.255.5", + "delay":50000 + } + } + ], + "subnets":[ + { + "subnet-id":"10.0.0.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.0.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.1.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.1.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.3.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":10 + }, + { + "subnet-id":"10.0.3.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.4.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":10 + }, + { + "subnet-id":"10.0.4.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.5.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":10 + }, + { + "subnet-id":"10.0.255.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":0 + }, + { + "subnet-id":"10.0.255.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":0 + }, + { + "subnet-id":"10.0.255.3\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":0 + }, + { + "subnet-id":"10.0.255.4\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":0, + "segment-routing":{ + "pref-sid":400, + "algo":0, + "flags":"0x40" + } + }, + { + "subnet-id":"10.0.255.5\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.5", + "vertex-id":167837445, + "metric":10 + } + ] + } +} diff --git a/tests/topotests/ospf_te_topo1/reference/ted_step2.json b/tests/topotests/ospf_te_topo1/reference/ted_step2.json new file mode 100644 index 0000000..625b57d --- /dev/null +++ b/tests/topotests/ospf_te_topo1/reference/ted_step2.json @@ -0,0 +1,473 @@ +{ + "ted":{ + "name":"OSPF", + "key":1, + "verticesCount":5, + "edgesCount":7, + "subnetsCount":12, + "vertices":[ + { + "vertex-id":167837441, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.1", + "vertex-type":"Standard" + }, + { + "vertex-id":167837442, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.2", + "vertex-type":"Standard" + }, + { + "vertex-id":167837443, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.3", + "vertex-type":"ASBR" + }, + { + "vertex-id":167837444, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.4", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":10000, + "srgb-lower":10000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":1000, + "srlb-lower":5000, + "msd":12 + } + }, + { + "vertex-id":167837445, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.5", + "vertex-type":"Remote ASBR", + "asn":65535 + } + ], + "edges":[ + { + "edge-id":"10.0.0.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "te-metric":20, + "local-address":"10.0.0.1", + "remote-address":"10.0.0.2", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":10000, + "available-bandwidth":125000000.0 + } + }, + { + "edge-id":"10.0.0.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.0.2", + "remote-address":"10.0.0.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.3.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "local-vertex-id":167837443, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "admin-group":32, + "local-address":"10.0.3.1", + "remote-address":"10.0.3.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.3.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837443, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.3.2", + "remote-address":"10.0.3.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.4.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "local-vertex-id":167837444, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.4.1", + "remote-address":"10.0.4.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.4.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837444, + "metric":10, + "edge-attributes":{ + "te-metric":30, + "local-address":"10.0.4.2", + "remote-address":"10.0.4.1", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":25000, + "utilized-bandwidth":125000000.0 + } + }, + { + "edge-id":"10.0.5.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "local-vertex-id":167837443, + "remote-vertex-id":167837445, + "metric":0, + "edge-attributes":{ + "te-metric":10, + "local-address":"10.0.5.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "remote-asn":65535, + "remote-as-address":"10.0.255.5", + "delay":50000 + } + } + ], + "subnets":[ + { + "subnet-id":"10.0.0.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.0.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.3.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":10 + }, + { + "subnet-id":"10.0.3.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.4.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":10 + }, + { + "subnet-id":"10.0.4.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.5.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":10 + }, + { + "subnet-id":"10.0.255.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":0 + }, + { + "subnet-id":"10.0.255.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":0 + }, + { + "subnet-id":"10.0.255.3\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":0 + }, + { + "subnet-id":"10.0.255.4\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":0, + "segment-routing":{ + "pref-sid":400, + "algo":0, + "flags":"0x40" + } + }, + { + "subnet-id":"10.0.255.5\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.5", + "vertex-id":167837445, + "metric":10 + } + ] + } +} diff --git a/tests/topotests/ospf_te_topo1/reference/ted_step3.json b/tests/topotests/ospf_te_topo1/reference/ted_step3.json new file mode 100644 index 0000000..4cfec0f --- /dev/null +++ b/tests/topotests/ospf_te_topo1/reference/ted_step3.json @@ -0,0 +1,405 @@ +{ + "ted":{ + "name":"OSPF", + "key":1, + "verticesCount":4, + "edgesCount":6, + "subnetsCount":10, + "vertices":[ + { + "vertex-id":167837441, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.1", + "vertex-type":"Standard" + }, + { + "vertex-id":167837442, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.2", + "vertex-type":"Standard" + }, + { + "vertex-id":167837443, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.3", + "vertex-type":"ASBR" + }, + { + "vertex-id":167837444, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.4", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":10000, + "srgb-lower":10000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":1000, + "srlb-lower":5000, + "msd":12 + } + } + ], + "edges":[ + { + "edge-id":"10.0.0.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "te-metric":20, + "local-address":"10.0.0.1", + "remote-address":"10.0.0.2", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":10000, + "available-bandwidth":125000000.0 + } + }, + { + "edge-id":"10.0.0.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.0.2", + "remote-address":"10.0.0.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.3.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "local-vertex-id":167837443, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "admin-group":32, + "local-address":"10.0.3.1", + "remote-address":"10.0.3.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.3.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837443, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.3.2", + "remote-address":"10.0.3.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.4.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "local-vertex-id":167837444, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.4.1", + "remote-address":"10.0.4.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.4.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837444, + "metric":10, + "edge-attributes":{ + "te-metric":30, + "local-address":"10.0.4.2", + "remote-address":"10.0.4.1", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":25000, + "utilized-bandwidth":125000000.0 + } + } + ], + "subnets":[ + { + "subnet-id":"10.0.0.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.0.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.3.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":10 + }, + { + "subnet-id":"10.0.3.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.4.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":10 + }, + { + "subnet-id":"10.0.4.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.255.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":0 + }, + { + "subnet-id":"10.0.255.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":0 + }, + { + "subnet-id":"10.0.255.3\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":0 + }, + { + "subnet-id":"10.0.255.4\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":0, + "segment-routing":{ + "pref-sid":400, + "algo":0, + "flags":"0x40" + } + } + ] + } +} diff --git a/tests/topotests/ospf_te_topo1/reference/ted_step4.json b/tests/topotests/ospf_te_topo1/reference/ted_step4.json new file mode 100644 index 0000000..e8e24d9 --- /dev/null +++ b/tests/topotests/ospf_te_topo1/reference/ted_step4.json @@ -0,0 +1,486 @@ +{ + "ted":{ + "name":"OSPF", + "key":1, + "verticesCount":4, + "edgesCount":6, + "subnetsCount":10, + "vertices":[ + { + "vertex-id":167837441, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.1", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":4000, + "srgb-lower":20000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":1000, + "srlb-lower":15000 + } + }, + { + "vertex-id":167837442, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.2", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":8000, + "srgb-lower":16000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":2000, + "srlb-lower":5000, + "msd":16 + } + }, + { + "vertex-id":167837443, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.3", + "vertex-type":"ASBR" + }, + { + "vertex-id":167837444, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.4", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":10000, + "srgb-lower":10000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":1000, + "srlb-lower":5000, + "msd":12 + } + } + ], + "edges":[ + { + "edge-id":"10.0.0.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "te-metric":20, + "local-address":"10.0.0.1", + "remote-address":"10.0.0.2", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":10000, + "available-bandwidth":125000000.0 + }, + "segment-routing":[ + { + "adj-sid":15001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":15000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.0.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.0.2", + "remote-address":"10.0.0.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.3.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "local-vertex-id":167837443, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "admin-group":32, + "local-address":"10.0.3.1", + "remote-address":"10.0.3.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.3.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837443, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.3.2", + "remote-address":"10.0.3.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5003, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5002, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.4.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "local-vertex-id":167837444, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.4.1", + "remote-address":"10.0.4.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.4.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837444, + "metric":10, + "edge-attributes":{ + "te-metric":30, + "local-address":"10.0.4.2", + "remote-address":"10.0.4.1", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":25000, + "utilized-bandwidth":125000000.0 + }, + "segment-routing":[ + { + "adj-sid":5005, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5004, + "flags":"0xe0", + "weight":0 + } + ] + } + ], + "subnets":[ + { + "subnet-id":"10.0.0.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.0.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.3.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":10 + }, + { + "subnet-id":"10.0.3.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.4.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":10 + }, + { + "subnet-id":"10.0.4.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.255.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":0, + "segment-routing":{ + "pref-sid":10, + "algo":0, + "flags":"0x0" + } + }, + { + "subnet-id":"10.0.255.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":0, + "segment-routing":{ + "pref-sid":20, + "algo":0, + "flags":"0x50" + } + }, + { + "subnet-id":"10.0.255.3\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":0 + }, + { + "subnet-id":"10.0.255.4\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":0, + "segment-routing":{ + "pref-sid":400, + "algo":0, + "flags":"0x40" + } + } + ] + } +} diff --git a/tests/topotests/ospf_te_topo1/reference/ted_step5.json b/tests/topotests/ospf_te_topo1/reference/ted_step5.json new file mode 100644 index 0000000..4713cc0 --- /dev/null +++ b/tests/topotests/ospf_te_topo1/reference/ted_step5.json @@ -0,0 +1,608 @@ +{ + "ted":{ + "name":"OSPF", + "key":1, + "verticesCount":4, + "edgesCount":8, + "subnetsCount":12, + "vertices":[ + { + "vertex-id":167837441, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.1", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":4000, + "srgb-lower":20000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":1000, + "srlb-lower":15000 + } + }, + { + "vertex-id":167837442, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.2", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":8000, + "srgb-lower":16000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":2000, + "srlb-lower":5000, + "msd":16 + } + }, + { + "vertex-id":167837443, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.3", + "vertex-type":"ASBR" + }, + { + "vertex-id":167837444, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.4", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":10000, + "srgb-lower":10000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":1000, + "srlb-lower":5000, + "msd":12 + } + } + ], + "edges":[ + { + "edge-id":"10.0.0.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "te-metric":20, + "local-address":"10.0.0.1", + "remote-address":"10.0.0.2", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":10000, + "available-bandwidth":125000000.0 + }, + "segment-routing":[ + { + "adj-sid":15001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":15000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.0.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.0.2", + "remote-address":"10.0.0.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.1.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.1.1", + "remote-address":"10.0.1.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":15003, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":15002, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.1.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.1.2", + "remote-address":"10.0.1.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5007, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5006, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.3.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "local-vertex-id":167837443, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "admin-group":32, + "local-address":"10.0.3.1", + "remote-address":"10.0.3.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.3.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837443, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.3.2", + "remote-address":"10.0.3.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5003, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5002, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.4.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "local-vertex-id":167837444, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.4.1", + "remote-address":"10.0.4.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.4.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837444, + "metric":10, + "edge-attributes":{ + "te-metric":30, + "local-address":"10.0.4.2", + "remote-address":"10.0.4.1", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":25000, + "utilized-bandwidth":125000000.0 + }, + "segment-routing":[ + { + "adj-sid":5005, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5004, + "flags":"0xe0", + "weight":0 + } + ] + } + ], + "subnets":[ + { + "subnet-id":"10.0.0.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.0.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.1.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.1.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.3.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":10 + }, + { + "subnet-id":"10.0.3.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.4.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":10 + }, + { + "subnet-id":"10.0.4.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.255.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":0, + "segment-routing":{ + "pref-sid":10, + "algo":0, + "flags":"0x0" + } + }, + { + "subnet-id":"10.0.255.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":0, + "segment-routing":{ + "pref-sid":20, + "algo":0, + "flags":"0x50" + } + }, + { + "subnet-id":"10.0.255.3\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":0 + }, + { + "subnet-id":"10.0.255.4\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":0, + "segment-routing":{ + "pref-sid":400, + "algo":0, + "flags":"0x40" + } + } + ] + } +} diff --git a/tests/topotests/ospf_te_topo1/reference/ted_step6.json b/tests/topotests/ospf_te_topo1/reference/ted_step6.json new file mode 100644 index 0000000..aaac07b --- /dev/null +++ b/tests/topotests/ospf_te_topo1/reference/ted_step6.json @@ -0,0 +1,609 @@ +{ + "ted":{ + "name":"OSPF", + "key":1, + "verticesCount":4, + "edgesCount":8, + "subnetsCount":12, + "vertices":[ + { + "vertex-id":167837441, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.1", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":4000, + "srgb-lower":20000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":1000, + "srlb-lower":15000 + } + }, + { + "vertex-id":167837442, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.2", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":8000, + "srgb-lower":16000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":2000, + "srlb-lower":5000, + "msd":16 + } + }, + { + "vertex-id":167837443, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.3", + "vertex-type":"ASBR" + }, + { + "vertex-id":167837444, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.4", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":10000, + "srgb-lower":10000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":1000, + "srlb-lower":5000, + "msd":12 + } + } + ], + "edges":[ + { + "edge-id":"10.0.0.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "te-metric":20, + "local-address":"10.0.0.1", + "remote-address":"10.0.0.2", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":10000, + "available-bandwidth":125000000.0 + }, + "segment-routing":[ + { + "adj-sid":15001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":15000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.0.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.0.2", + "remote-address":"10.0.0.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.1.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.1.1", + "remote-address":"10.0.1.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":15003, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":15002, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.1.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.1.2", + "remote-address":"10.0.1.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5007, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5006, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.3.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "local-vertex-id":167837443, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "admin-group":32, + "local-address":"10.0.3.1", + "remote-address":"10.0.3.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.3.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837443, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.3.2", + "remote-address":"10.0.3.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5003, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5002, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.4.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "local-vertex-id":167837444, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.4.1", + "remote-address":"10.0.4.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":20000, + "jitter":10000 + }, + "segment-routing":[ + { + "adj-sid":5001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.4.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837444, + "metric":10, + "edge-attributes":{ + "te-metric":30, + "local-address":"10.0.4.2", + "remote-address":"10.0.4.1", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":25000 + }, + "segment-routing":[ + { + "adj-sid":5005, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5004, + "flags":"0xe0", + "weight":0 + } + ] + } + ], + "subnets":[ + { + "subnet-id":"10.0.0.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.0.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.1.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.1.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.3.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":10 + }, + { + "subnet-id":"10.0.3.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.4.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":10 + }, + { + "subnet-id":"10.0.4.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.255.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":0, + "segment-routing":{ + "pref-sid":10, + "algo":0, + "flags":"0x0" + } + }, + { + "subnet-id":"10.0.255.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":0, + "segment-routing":{ + "pref-sid":20, + "algo":0, + "flags":"0x50" + } + }, + { + "subnet-id":"10.0.255.3\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":0 + }, + { + "subnet-id":"10.0.255.4\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.4", + "vertex-id":167837444, + "metric":0, + "segment-routing":{ + "pref-sid":400, + "algo":0, + "flags":"0x40" + } + } + ] + } +} diff --git a/tests/topotests/ospf_te_topo1/reference/ted_step7.json b/tests/topotests/ospf_te_topo1/reference/ted_step7.json new file mode 100644 index 0000000..56ed1f1 --- /dev/null +++ b/tests/topotests/ospf_te_topo1/reference/ted_step7.json @@ -0,0 +1,451 @@ +{ + "ted":{ + "name":"OSPF", + "key":1, + "verticesCount":3, + "edgesCount":6, + "subnetsCount":9, + "vertices":[ + { + "vertex-id":167837441, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.1", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":4000, + "srgb-lower":20000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":1000, + "srlb-lower":15000 + } + }, + { + "vertex-id":167837442, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.2", + "vertex-type":"Standard", + "segment-routing":{ + "srgb-size":8000, + "srgb-lower":16000, + "algorithms":[ + { + "0":"SPF" + } + ], + "srlb-size":2000, + "srlb-lower":5000, + "msd":16 + } + }, + { + "vertex-id":167837443, + "status":"Sync", + "origin":"OSPFv2", + "router-id":"10.0.255.3", + "vertex-type":"ASBR" + } + ], + "edges":[ + { + "edge-id":"10.0.0.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "te-metric":20, + "local-address":"10.0.0.1", + "remote-address":"10.0.0.2", + "max-link-bandwidth":99999997952, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ], + "delay":10000, + "available-bandwidth":125000000.0 + }, + "segment-routing":[ + { + "adj-sid":15001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":15000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.0.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.0.2", + "remote-address":"10.0.0.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5001, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5000, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.1.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "local-vertex-id":167837441, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.1.1", + "remote-address":"10.0.1.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":15003, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":15002, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.1.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837441, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.1.2", + "remote-address":"10.0.1.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5007, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5006, + "flags":"0xe0", + "weight":0 + } + ] + }, + { + "edge-id":"10.0.3.1", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "local-vertex-id":167837443, + "remote-vertex-id":167837442, + "metric":10, + "edge-attributes":{ + "admin-group":32, + "local-address":"10.0.3.1", + "remote-address":"10.0.3.2", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + } + }, + { + "edge-id":"10.0.3.2", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "local-vertex-id":167837442, + "remote-vertex-id":167837443, + "metric":10, + "edge-attributes":{ + "local-address":"10.0.3.2", + "remote-address":"10.0.3.1", + "max-link-bandwidth":1250000, + "max-resv-link-bandwidth":1250000, + "unreserved-bandwidth":[ + { + "class-type-0":1250000 + }, + { + "class-type-1":1250000 + }, + { + "class-type-2":1250000 + }, + { + "class-type-3":1250000 + }, + { + "class-type-4":1250000 + }, + { + "class-type-5":1250000 + }, + { + "class-type-6":1250000 + }, + { + "class-type-7":1250000 + } + ] + }, + "segment-routing":[ + { + "adj-sid":5003, + "flags":"0x60", + "weight":0 + }, + { + "adj-sid":5002, + "flags":"0xe0", + "weight":0 + } + ] + } + ], + "subnets":[ + { + "subnet-id":"10.0.0.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.0.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.1.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":10 + }, + { + "subnet-id":"10.0.1.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.3.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":10 + }, + { + "subnet-id":"10.0.3.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":10 + }, + { + "subnet-id":"10.0.255.1\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.1", + "vertex-id":167837441, + "metric":0, + "segment-routing":{ + "pref-sid":10, + "algo":0, + "flags":"0x0" + } + }, + { + "subnet-id":"10.0.255.2\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.2", + "vertex-id":167837442, + "metric":0, + "segment-routing":{ + "pref-sid":20, + "algo":0, + "flags":"0x50" + } + }, + { + "subnet-id":"10.0.255.3\/32", + "status":"Sync", + "origin":"OSPFv2", + "advertised-router":"10.0.255.3", + "vertex-id":167837443, + "metric":0 + } + ] + } +} diff --git a/tests/topotests/ospf_te_topo1/test_ospf_te_topo1.py b/tests/topotests/ospf_te_topo1/test_ospf_te_topo1.py new file mode 100644 index 0000000..c8533cf --- /dev/null +++ b/tests/topotests/ospf_te_topo1/test_ospf_te_topo1.py @@ -0,0 +1,282 @@ +#!/usr/bin/env python +# SPDX-License-Identifier: ISC + +# +# test_ospf_te_topo1.py +# Part of NetDEF Topology Tests +# +# Copyright (c) 2021 by Orange +# Author: Olivier Dugeon <olivier.dugeon@orange.com> +# + +""" +test_ospf_te_topo1.py: Test the FRR OSPF with Traffic Engineering. + + +------------+ + | | + | R1 | + | 10.0.225.1 | + | | + +------------+ + r1-eth0| |r1-eth1 + | | + 10.0.0.0/24| |10.0.1.0/24 + | | + r2-eth0| |r2-eth1 + +------------+ +------------+ + | | | | + | R2 |r2-eth2 r3-eth0| R3 | + | 10.0.255.2 +------------------+ 10.0.255.3 | + | | 10.0.3.0/24 | | + +------------+ +------+-----+ + r2-eth3| r3-eth1| + | | + 10.0.4.0/24| 10.0.5.0/24| + | | + r4-eth0| V + +------------+ ASBR 10.0.255.5 + | | + | R4 | + | 10.0.255.4 | + | | + +------------+ + +""" + +import os +import sys +import json +from functools import partial + +# Save the Current Working Directory to find configuration files. +CWD = os.path.dirname(os.path.realpath(__file__)) +sys.path.append(os.path.join(CWD, "../")) + +# pylint: disable=C0413 +# Required to instantiate the topology builder class. + +# Import topogen and topotest helpers +from lib import topotest +from lib.topogen import Topogen, TopoRouter, get_topogen +from lib.topolog import logger + +# and Finally pytest +import pytest + +pytestmark = [pytest.mark.ospfd] + + +def build_topo(tgen): + "Build function" + + # Create 4 routers + for routern in range(1, 5): + tgen.add_router("r{}".format(routern)) + + # Interconect router 1 and 2 with 2 links + switch = tgen.add_switch("s1") + switch.add_link(tgen.gears["r1"]) + switch.add_link(tgen.gears["r2"]) + switch = tgen.add_switch("s2") + switch.add_link(tgen.gears["r1"]) + switch.add_link(tgen.gears["r2"]) + + # Interconect router 3 and 2 + switch = tgen.add_switch("s3") + switch.add_link(tgen.gears["r3"]) + switch.add_link(tgen.gears["r2"]) + + # Interconect router 4 and 2 + switch = tgen.add_switch("s4") + switch.add_link(tgen.gears["r4"]) + switch.add_link(tgen.gears["r2"]) + + # Interconnect router 3 with next AS + switch = tgen.add_switch("s5") + switch.add_link(tgen.gears["r3"]) + + +def setup_module(mod): + "Sets up the pytest environment" + + logger.info("\n\n---- Starting OSPF TE tests ----\n") + + tgen = Topogen(build_topo, mod.__name__) + tgen.start_topology() + + router_list = tgen.routers() + + 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)) + ) + + # Initialize all routers. + tgen.start_router() + + +def teardown_module(): + "Teardown the pytest environment" + + tgen = get_topogen() + tgen.stop_topology() + + logger.info("\n\n---- OSPF TE tests End ----\n") + + +def compare_ted_json_output(tgen, rname, fileref): + "Compare TED JSON output" + + logger.info('Comparing router "%s" TED output', rname) + + filename = "{}/reference/{}".format(CWD, fileref) + expected = json.loads(open(filename).read()) + command = "show ip ospf mpls-te database json" + + # Run test function until we get an result. Wait at most 60 seconds. + test_func = partial(topotest.router_json_cmp, tgen.gears[rname], command, expected) + _, diff = topotest.run_and_expect(test_func, None, count=60, wait=2) + assertmsg = '"{}" TED JSON output mismatches the expected result'.format(rname) + assert diff is None, assertmsg + + +def setup_testcase(msg): + "Setup test case" + + logger.info(msg) + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + return tgen + + +# Note that all routers must discover the same Network Topology, so the same TED. + + +def test_step1(): + "Step1: Check initial topology" + + tgen = setup_testcase("Step1: test initial OSPF TE Data Base") + + for rname in ["r1", "r2", "r3", "r4"]: + compare_ted_json_output(tgen, rname, "ted_step1.json") + + +def test_step2(): + "Step2: Shutdown interface between r1 and r2 and verify that \ + corresponding Edges are removed from the TED on all routers " + + tgen = setup_testcase("Step2: Shutdown interface between r1 & r2") + + tgen.net["r1"].cmd('vtysh -c "conf t" -c "interface r1-eth1" -c "shutdown"') + tgen.net["r2"].cmd('vtysh -c "conf t" -c "interface r2-eth1" -c "shutdown"') + + for rname in ["r1", "r2", "r3", "r4"]: + compare_ted_json_output(tgen, rname, "ted_step2.json") + + +def test_step3(): + "Step3: Disable Inter-AS on r3 and verify that corresponding Edge and \ + remote ASBR are removed from the TED on all routers" + + tgen = setup_testcase("Step3: Disable Inter-AS on r3") + + tgen.net["r3"].cmd('vtysh -c "conf t" -c "router ospf" -c "no mpls-te inter-as"') + for rname in ["r1", "r2", "r3", "r4"]: + compare_ted_json_output(tgen, rname, "ted_step3.json") + + +def test_step4(): + "Step4: Enable Segment Routing on r1 and r2 and verify that corresponding \ + Edges are updated with Adjacency SID and Subnets with Prefix SID in the \ + TED on all routers" + + tgen = setup_testcase("Step4: Enable Segment Routing on r1 & r2") + + tgen.net["r1"].cmd('vtysh -c "conf t" -c "router ospf" -c "segment-routing on"') + tgen.net["r1"].cmd( + 'vtysh -c "conf t" -c "router ospf" -c "segment-routing global-block 20000 23999"' + ) + tgen.net["r1"].cmd( + 'vtysh -c "conf t" -c "router ospf" -c "segment-routing prefix 10.0.255.1/32 index 10"' + ) + tgen.net["r2"].cmd('vtysh -c "conf t" -c "router ospf" -c "segment-routing on"') + tgen.net["r2"].cmd( + 'vtysh -c "conf t" -c "router ospf" -c "segment-routing node-msd 16"' + ) + tgen.net["r2"].cmd( + 'vtysh -c "conf t" -c "router ospf" -c "segment-routing global-block 16000 23999 local-block 5000 6999"' + ) + tgen.net["r2"].cmd( + 'vtysh -c "conf t" -c "router ospf" -c "segment-routing prefix 10.0.255.2/32 index 20 explicit-null"' + ) + + for rname in ["r1", "r2", "r3", "r4"]: + compare_ted_json_output(tgen, rname, "ted_step4.json") + + +def test_step5(): + "Step5: Re-enable interface between r1 & r2 and verify that corresponding \ + Edges are added in the TED on all routers" + + tgen = setup_testcase("Step5: Re-enable interface between r1 & r2") + + tgen.net["r1"].cmd('vtysh -c "conf t" -c "interface r1-eth1" -c "no shutdown"') + tgen.net["r2"].cmd('vtysh -c "conf t" -c "interface r2-eth1" -c "no shutdown"') + + for rname in ["r1", "r2", "r3", "r4"]: + compare_ted_json_output(tgen, rname, "ted_step5.json") + + +def test_step6(): + "Step6: Set delay and jitter for interface r4-eth0 on r4, remove use-bw \ + for interface r2-eth3 on r2 and verify that corresponding Edges are \ + updated in the TED on all routers" + + tgen = setup_testcase("Step6: Modify link parameters on r2 & r4") + + tgen.net["r2"].cmd( + 'vtysh -c "conf t" -c "interface r2-eth3" -c "link-params" -c "no use-bw"' + ) + tgen.net["r4"].cmd( + 'vtysh -c "conf t" -c "interface r4-eth0" -c "link-params" -c "delay 20000"' + ) + tgen.net["r4"].cmd( + 'vtysh -c "conf t" -c "interface r4-eth0" -c "link-params" -c "delay-variation 10000"' + ) + + for rname in ["r1", "r2", "r3", "r4"]: + compare_ted_json_output(tgen, rname, "ted_step6.json") + + +def test_step7(): + "Step7: Disable OSPF on r4 and verify that corresponding Vertex, Edges and \ + Subnets are removed from the TED on all remaining routers" + + tgen = setup_testcase("Step7: Disable OSPF on r4") + + tgen.net["r4"].cmd('vtysh -c "conf t" -c "no router ospf"') + + for rname in ["r1", "r2", "r3"]: + compare_ted_json_output(tgen, rname, "ted_step7.json") + + +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)) |