Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use LastStateTransitionTime to populate last_flapped for get_interfaces() in IOS-XR #1966

Merged
merged 4 commits into from Mar 21, 2024

Conversation

jlixfeld
Copy link

@jlixfeld jlixfeld commented Jun 16, 2023

Currently, last_flapped for get_interfaces() is hard coded to -1.

In at least IOS-XR 7.1.2, Last link flapped from show interface is exposed by <Get><Operational><Interfaces></Interfaces></Operational></Get> as LastStateTransitionTime.

This can be used to populate last_flapped, with -1 being a default for backwards compatibility where LastStateTransitionTime is not exposed.

@jlixfeld jlixfeld marked this pull request as ready for review June 16, 2023 15:35
@jlixfeld
Copy link
Author

While trying to implement the required tests, I'm hung up here:

./test/iosxr/test_getters.py::TestGetter::test_get_interfaces[normal] Failed: [undefined]AssertionError
self = <test.iosxr.test_getters.TestGetter object at 0x7f4c738e6ce0>
test_case = 'normal'

    @wrap_test_cases
    def test_get_interfaces(self, test_case):
        """Test get_interfaces."""
        get_interfaces = self.device.get_interfaces()
        assert len(get_interfaces) > 0
    
        for interface, interface_data in get_interfaces.items():
>           assert helpers.test_model(models.InterfaceDict, interface_data)
E           AssertionError

napalm/base/test/getters.py:165: AssertionError

@mirceaulinic mirceaulinic added this to the 5.0.0 milestone Mar 21, 2024
@mirceaulinic mirceaulinic merged commit f432be6 into napalm-automation:develop Mar 21, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants