napalm-automation / napalm-ios

Apache License 2.0
31 stars 40 forks source link

Update lldp detail regex #97

Closed itdependsnetworks closed 7 years ago

itdependsnetworks commented 7 years ago

Port description can have ' -' as delimiter instead of ':' The findall between IP and other should happen in one check, otherwise it doesn't return both at the same time, when you have a mix.

Test Data

csr1#show lldp neighbors GigabitEthernet 1 detail
------------------------------------------------
Local Intf: Gi1
Chassis id: 2cc2.603e.363b
Port id: Management1
Port Description - not advertised
System Name: eos-spine1.ntc.com

System Description:
Arista Networks EOS version 4.15.2F running on an Arista Networks vEOS

Time remaining: 95 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
    Other: 2C FF 60 3E 36 3B 00
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised

------------------------------------------------
Local Intf: Gi1
Chassis id: 0005.8671.58c0
Port id: fxp0
Port Description: fxp0
System Name: vmx1

System Description:
Juniper Networks, Inc. vmx internet router, kernel JUNOS 15.1F4.15, Build date: 2015-12-23 19:22:55 UTC Copyright (c) 1996-2015 Juniper Networks, Inc.

Time remaining: 116 seconds
System Capabilities: B,R
Enabled Capabilities: B,R
Management Addresses:
    IP: 10.0.0.31
    OID:
        0.1.3.6.1.2.1.31.1.1.1.1.1.
Auto Negotiation - supported, disabled
Physical media capabilities:
    1000baseT(FD)
    1000baseX(FD)
    1000baseX(HD)
    Symm, Asym Pause(FD)
    100base-TX(FD)
    100base-TX(HD)
    10base-T(FD)
    10base-T(HD)
Media Attachment Unit type - not advertised
Vlan ID: - not advertised

Total entries displayed: 2

csr1#
coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.04%) to 69.357% when pulling 1c0d8baa5078c90647faf827d9f45dce7113bc15 on itdependsnetworks:patch-1 into 527b8d48ce03c78764a6fae2a0fc0d788e17bf37 on napalm-automation:develop.

ktbyers commented 7 years ago

@itdependsnetworks We also should add to our unit tests here to make sure this is properly flagged by the unit tests (i.e. they fail if we don't handle it properly):

napalm-ios/test/unit/mocked_data/test_get_lldp_neighbors_detail

You can see what I did in the napalm-ios/test/unit/mocked_data/test_get_mac_address_table to handle a bunch of different output formats.

If you have questions on this, just let me know.

itdependsnetworks commented 7 years ago

@ktbyers You caught me :)

I will add the tests, but will take me a bit.

On a side note, we have similar issues for ntc-templates. Was thinking that perhaps we should come up with list of commands and a mechanism (pb/script) and ask the slack community to contribute test data.

ktbyers commented 7 years ago

@itdependsnetworks Yes, I agree the gathering of test data is the big problem (i.e. having too narrow a view on the possible outputs).

It would be good to have a way to share this and have people contribute to it (if we could do it in an effective way).

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.04%) to 69.357% when pulling 4dfefec0d5a7da796eaab9f1d096eb1637270f53 on itdependsnetworks:patch-1 into 527b8d48ce03c78764a6fae2a0fc0d788e17bf37 on napalm-automation:develop.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.04%) to 69.357% when pulling 4dfefec0d5a7da796eaab9f1d096eb1637270f53 on itdependsnetworks:patch-1 into 527b8d48ce03c78764a6fae2a0fc0d788e17bf37 on napalm-automation:develop.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.04%) to 69.357% when pulling 4dfefec0d5a7da796eaab9f1d096eb1637270f53 on itdependsnetworks:patch-1 into 527b8d48ce03c78764a6fae2a0fc0d788e17bf37 on napalm-automation:develop.