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 <pushpasis.frr@gmail.com>
  • Loading branch information
pushpasis committed Dec 13, 2023
1 parent ddcfd36 commit 725caf5
Show file tree
Hide file tree
Showing 130 changed files with 18,671 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
!
41 changes: 41 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,41 @@
password 1
hostname rt1
log file ospfd.log
log syslog debugging
!
debug ospf sr
! debug ospf te
! debug ospf event
! debug ospf lsa
debug ospf lsa generate
! debug ospf zebra
!
affinity-map red bit-position 0
affinity-map green bit-position 100
affinity-map blue bit-position 200
affinity-map yellow bit-position 1000
!
interface lo
ip ospf area 0.0.0.0
!
interface eth-rt1-1
ip ospf area 0.0.0.0
!
interface eth-rt1-2
ip ospf area 0.0.0.0
!
router ospf
ospf router-id 1.1.1.1
capability opaque
router-info area 0.0.0.0
flexible-algorithm 128
flexible-algorithm 128 priority 10
flexible-algorithm 128 exclude-admin-group red
flexible-algorithm 128 include-all-admin-group green
flexible-algorithm 128 include-any-admin-group green
flexible-algorithm 128 include-any-admin-group blue
flexible-algorithm 128 exclude-srlg 10
flexible-algorithm 128 flags 10
flexible-algorithm 128 advertise-prefix-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": [ red ]
},
{
"name": "Include-Any Admin Groups SubTLV",
"type": 2,
"length": 12,
"adminGroups": [ green, blue ]
},
{
"name": "Include-All Admin Groups SubTLV",
"type": 3,
"length": 4,
"adminGroups": [ green ]
},
{
"name": "Flexible-Algo Flags SubTLV",
"type": 4,
"length": 4,
"flags": [ 0x80000000 ]
},
{
"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": [ red ]
},
{
"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": [ 0x80000000 ]
},
{
"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,17 @@
--- Flexible-Algorithm parameters ---
Flexible-Algorithm: 128
Metric-Type: igp
Calculation-Type: spf
Priority: 10
Flags: 0x80
Advt-Prefix-Metric: Y
Prefix-Metric: 100
Exclude-Admin-Groups:
- red(0)
Include-Any-Admin-Groups:
- green(100)
- blue(200)
Include-All-Admin-Groups:
- green(100)
Exclude-SRLGs:
- 10
Loading

0 comments on commit 725caf5

Please sign in to comment.