napalm-automation / napalm-junos

Apache License 2.0
22 stars 42 forks source link

Support get_mac_address_table() on L2NG switches #199

Closed bkeifer closed 7 years ago

bkeifer commented 7 years ago

Newer Juniper switches (Including EX2300, EX4300, EX4600, EX9200 and QFX series) use the L2NG configuration syntax. As a result, their XML output for get-ethernet-switching-table-information is also slightly different. This was causing get_mac_address_table() to return an empty set on our EX2300 and EX4300 switches.

This PR adds another table structure and view for these switches and updates the logic in get_mac_address_table() to identify these new switches using the switch_style fact.

bkeifer commented 7 years ago

So, Travis wants the XML test file to be named get-bridge-mac-table.xml, but the RPC command isn't get-bridge-mac-table, it's get-ethernet-switching-table.

Maintainers, what's your preferred way to proceed (assuming this is a PR you're interested in)?

bkeifer commented 7 years ago

It looks like the only error we're getting now is that Travis wants me to rename the .xml test file:

> raise IOError("Couldn't find file with mocked data: {}".format(full_path)) E IOError: Couldn't find file with mocked data: /home/travis/build/napalm-automation/napalm-junos/test/unit/mocked_data/test_get_mac_address_table/l2ng/get-bridge-mac-table.xml

Unless I'm reading things incorrectly, and I might be since I don't have access to much of the other Juniper gear that these tests are geared towards, it looks like these files in the other directories are named after the rpc command that produces the output.

So I'm back to my original question. Should I rename my get-ethernet-switching-table.xml file to get-bridge-mac-table.xml or is there a way to tell Travis to look for a different file name in the test_get_mac_address_table/l2ng directory?

(This is the first project on which I'm really working with test cases, so I wholeheartedly thank you for your patience!)

mirceaulinic commented 7 years ago

@bkeifer FYI I closed this PR and included your commits into https://github.com/napalm-automation/napalm-junos/pull/203