CiscoTestAutomation / genielibs

genie.libs contains libraries for configuring, retrieving and testing topologies
Apache License 2.0
107 stars 53 forks source link

'get_ospf_sr_adj_sid_and_neighbor_address' gives only one sid ( the protected sid) #78

Open phongere opened 2 years ago

phongere commented 2 years ago

There are 2 sids per link in Segment routing. 'get_ospf_sr_adj_sid_and_neighbor_address' is giving only the protected sid. We need the api to get both sids with keys something like 'protect' and 'unprotect'

You can see in the below log for both neighbor addresses there is only one sid returned and it does not indicate whether its protected or unprotected. If the flags is 'DU' its unprotected sid and flags 'DP' is protected sid

get_ospf_sr_adj_sid_and_neighbor_address(rtr1,'100')

2021-09-28 11:15:35,514: %UNICON-INFO: +++ R1 with alias 'a': executing command 'show ip ospf segment-routing adjacency-sid' +++ show ip ospf segment-routing adjacency-sid

        OSPF Router with ID (1.1.1.1) (Process ID 100)
Flags: S - Static, D - Dynamic,  P - Protected, U - Unprotected, G - Group, L - Adjacency Lost

Adj-Sid Neighbor ID Interface Neighbor Addr Flags Backup Nexthop Backup Interface


17 1.1.1.6 BD161 1.1.1.6 D U
19 1.1.1.6 BD161 1.1.1.6 D P 1.6.1.6 BD162
24 1.1.1.6 BD162 1.6.1.6 D U
26 1.1.1.6 BD162 1.6.1.6 D P 1.1.1.6 BD161
R1# {'1.1.1.6': '19', '1.6.1.6': '26'}

phongere commented 2 years ago

I have made changes. https://wwwin-github.cisco.com/pyATS/genielibs/pull/825

omehrabi commented 2 years ago

thank you for your contribution. We will review your changes now