Skip to content

Commit

Permalink
tests: Add Topotests for Flexible-Algorithm implementation in OSPFv2
Browse files Browse the repository at this point in the history
This commit adds topotests for Flexible-Algorithm implementation in OSPFv2.

Signed-off-by: Pushpasis Sarkar <[email protected]>
  • Loading branch information
pushpasis committed Nov 10, 2023
1 parent 8b88cb4 commit 5c00a63
Show file tree
Hide file tree
Showing 130 changed files with 18,628 additions and 0 deletions.
Empty file.
27 changes: 27 additions & 0 deletions tests/topotests/ospf_flexalgo_topo1/rt1/ospfd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
password 1
hostname rt1
log file ospfd.log
log syslog debugging
!
debug ospf sr
! debug ospf te
! debug ospf event
! debug ospf lsa
debug ospf lsa generate
! debug ospf zebra
!
interface lo
ip ospf area 0.0.0.0
ip ospf passive
!
interface eth-rt1-1
ip ospf area 0.0.0.0
!
interface eth-rt1-2
ip ospf area 0.0.0.0
!
router ospf
ospf router-id 1.1.1.1
capability opaque
router-info area 0.0.0.0
!
37 changes: 37 additions & 0 deletions tests/topotests/ospf_flexalgo_topo1/rt1/ospfd_flxalg.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
password 1
hostname rt1
log file ospfd.log
log syslog debugging
!
debug ospf sr
! debug ospf te
! debug ospf event
! debug ospf lsa
debug ospf lsa generate
! debug ospf zebra
!
interface lo
ip ospf area 0.0.0.0
!
interface eth-rt1-1
ip ospf area 0.0.0.0
!
interface eth-rt1-2
ip ospf area 0.0.0.0
!
router ospf
ospf router-id 1.1.1.1
capability opaque
router-info area 0.0.0.0
flexible-algorithm 128 metric-type igp
flexible-algorithm 128 calculation-type spf
flexible-algorithm 128 priority 10
flexible-algorithm 128 exclude-admin-group 30
flexible-algorithm 128 include-all-admin-group 20
flexible-algorithm 128 include-any-admin-group 60
flexible-algorithm 128 include-any-admin-group 70
flexible-algorithm 128 exclude-srlg 10
flexible-algorithm 128 flags 10
flexible-algorithm 128 prefix-advertise-metric 100
passive-interface lo
!
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
{
"routerId": "1.1.1.1",
"areaLocalOpaqueLsa": {
"areas": {
"0.0.0.0": [
{
"options": "*|O|-|-|-|-|E|-",
"lsaType": "Area-Local Opaque-LSA",
"linkStateId": "4.0.0.0",
"advertisingRouter": "1.1.1.1",
"length": 84,
"opaqueType": "Router Information LSA",
"opaqueId": 0,
"opaqueDataLength": 64,
"opaqueDataLengthValid": true,
"tlvs": [
{
"name": "Router Capabilities TLV",
"type": 1,
"length": 4,
"capabilities": "0x10000000"
},
{
"name": "Flexible Algorithm Defintion TLV",
"type": 16,
"length": 52,
"algorithmId": 128,
"priority": 10,
"metricType": "igp",
"caculationType": "spf",
"subTLVs": [
{
"name": "Exclude Admin Groups SubTLV",
"type": 1,
"length": 4,
"adminGroups": [ 1073741824 ]
},
{
"name": "Include-Any Admin Groups SubTLV",
"type": 2,
"length": 12,
"adminGroups": [ 0, 268435456, 64 ]
},
{
"name": "Include-All Admin Groups SubTLV",
"type": 3,
"length": 4,
"adminGroups": [ 1048576 ]
},
{
"name": "Flexible-Algo Flags SubTLV",
"type": 4,
"length": 4,
"flags": [ 2147483648 ]
},
{
"name": "Exclude SRLGs SubTLV",
"type": 5,
"length": 4,
"srlgs": [ 1024 ]
}
]
}
]
},
{
"options": "*|O|-|-|-|-|E|-",
"lsaType": "Area-Local Opaque-LSA",
"linkStateId": "4.0.0.0",
"advertisingRouter": "2.2.2.2",
"length": 28,
"opaqueType": "Router Information LSA",
"opaqueId": 0,
"opaqueDataLength": 8,
"opaqueDataLengthValid": true,
"tlvs": [
{
"name": "Router Capabilities TLV",
"type": 1,
"length": 4,
"capabilities": "0x10000000"
}
]
},
{
"options": "*|O|-|-|-|-|E|-",
"lsaType": "Area-Local Opaque-LSA",
"linkStateId": "4.0.0.0",
"advertisingRouter": "3.3.3.3",
"length": 28,
"opaqueType": "Router Information LSA",
"opaqueId": 0,
"opaqueDataLength": 8,
"opaqueDataLengthValid": true,
"tlvs": [
{
"name": "Router Capabilities TLV",
"type": 1,
"length": 4,
"capabilities": "0x10000000"
}
]
},
{
"options": "*|O|-|-|-|-|E|-",
"lsaType": "Area-Local Opaque-LSA",
"linkStateId": "4.0.0.0",
"advertisingRouter": "4.4.4.4",
"length": 88,
"opaqueType": "Router Information LSA",
"opaqueId": 0,
"opaqueDataLength": 68,
"opaqueDataLengthValid": true,
"tlvs": [
{
"name": "Router Capabilities TLV",
"type": 1,
"length": 4,
"capabilities": "0x10000000"
},
{
"name": "Flexible Algorithm Defintion TLV",
"type": 16,
"length": 56,
"algorithmId": 128,
"priority": 10,
"metricType": "igp",
"caculationType": "spf",
"subTLVs": [
{
"name": "Exclude Admin Groups SubTLV",
"type": 1,
"length": 4,
"adminGroups": [ 1073741824 ]
},
{
"name": "Include-Any Admin Groups SubTLV",
"type": 2,
"length": 12,
"adminGroups": [ 0, 0, 64 ]
},
{
"name": "Include-All Admin Groups SubTLV",
"type": 3,
"length": 8,
"adminGroups": [ 1048576, 268435456 ]
},
{
"name": "Flexible-Algo Flags SubTLV",
"type": 4,
"length": 4,
"flags": [ 2147483648 ]
},
{
"name": "Exclude SRLGs SubTLV",
"type": 5,
"length": 4,
"srlgs": [ 1024 ]
}
]
}
]
},
{
"options": "*|O|-|-|-|-|E|-",
"lsaType": "Area-Local Opaque-LSA",
"linkStateId": "7.0.0.1",
"advertisingRouter": "1.1.1.1",
"length": 44,
"opaqueType": "Extended Prefix Opaque LSA",
"opaqueId": 1,
"opaqueDataLength": 24,
"opaqueDataLengthValid": true,
"tlvs": [
{
"name": "Extended Prefix TLV",
"type": 1,
"length": 20,
"prefixAddress": "1.1.1.1",
"prefixLength": 32,
"routeType": 1,
"addressFamily": 0,
"subTLVs": [
{
"name": "Flex-Algo Prefix Metric (FAPM) SubTLV",
"type": 3,
"length": 8,
"algotithmId": 128,
"flags": 0,
"metric": 100
}
]
}
]
},
{
"options": "*|O|-|-|-|-|E|-",
"lsaType": "Area-Local Opaque-LSA",
"linkStateId": "7.0.0.1",
"advertisingRouter": "4.4.4.4",
"length": 44,
"opaqueType": "Extended Prefix Opaque LSA",
"opaqueId": 1,
"opaqueDataLength": 24,
"opaqueDataLengthValid": true,
"tlvs": [
{
"name": "Extended Prefix TLV",
"type": 1,
"length": 20,
"prefixAddress": "4.4.4.4",
"prefixLength": 32,
"routeType": 1,
"addressFamily": 0,
"subTLVs": [
{
"name": "Flex-Algo Prefix Metric (FAPM) SubTLV",
"type": 3,
"length": 8,
"algotithmId": 128,
"flags": 0,
"metric": 10
}
]
}
]
},
{
"options": "*|O|-|-|-|-|E|-",
"lsaType": "Area-Local Opaque-LSA",
"linkStateId": "11.0.0.0",
"advertisingRouter": "1.1.1.1",
"length": 40,
"opaqueType": "Extended Inter-Area ASBR Opaque LSA",
"opaqueId": 0,
"opaqueDataLength": 20,
"opaqueDataLengthValid": true,
"tlvs": [
{
"name": "Extended Inter-Area ASBR TLV",
"type": 1,
"length": 16,
"asbrRouterId": "1.1.1.1",
"subTLVs": [
{
"name": "Flex-Algo ASBR Metric (FAAM) SubTLV",
"type": 1,
"length": 8,
"algorithmId": 128,
"metric": 100
}
]
}
]
},
{
"options": "*|O|-|-|-|-|E|-",
"lsaType": "Area-Local Opaque-LSA",
"linkStateId": "11.0.0.0",
"advertisingRouter": "4.4.4.4",
"length": 40,
"opaqueType": "Extended Inter-Area ASBR Opaque LSA",
"opaqueId": 0,
"opaqueDataLength": 20,
"opaqueDataLengthValid": true,
"tlvs": [ {
"name": "Extended Inter-Area ASBR TLV",
"type": 1,
"length": 16,
"asbrRouterId": "4.4.4.4",
"subTLVs": [
{
"name": "Flex-Algo ASBR Metric (FAAM) SubTLV",
"type": 1,
"length": 8,
"algorithmId": 128,
"metric": 10
}
]
}
]
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- Flexible-Algorithm parameters ---
Flexible-Algorithm: 128
Metric-Type: igp
Calculation-Type: spf
Priority: 10
Flags: 0x80
Prefix-Advt-Metric: 100
Exclude-Admin-Groups:
- 30
Include-Any-Admin-Groups:
- 60
- 70
Include-All-Admin-Groups:
- 20
Exclude-SRLGs:
- 10
Loading

0 comments on commit 5c00a63

Please sign in to comment.