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
Added route-advertise to bgp_af module #63
Added route-advertise to bgp_af module #63
Conversation
Corresponding to the addition of the "route_advertise_list" list to the argspec, the following line needs to be added to the "TEST_KEYS" list in the "plugins/module_utils/network/sonic/config/bgp_af/bgp_af.py" file:
The TEST_KEYS list is needed for diff generation by the "get_diff" utility function. For each "list" in the configuration portion of the argspec, an entry is needed in the TEST_KEYS list to specify the key or keys that uniquely identify a given element of the list. In this case, the "advertise_afi_safi" key (ipv4 or ipv6) identifies the two possible elements in the "route_advertise_list' list. A reqression test case to verify this functionality should also be provided: To do this, add configuration (with or without a route map) for both address families to confirm that this works correctly. Please also add a test case to delete the route_advertise configuration for one of the two configured AFs. |
Test comments: In the "tests/regression/roles/sonic_bgp_af/defaults/main.yml" file, please add the following case:
|
All of the changes applied by the most recent commit look good to me, but I see a problem in the log output. Is the currently posted test log "with" or "without" the added TEST_KEY entry? If it's "with", I must be missing something in my analysis of the diffs: I see a problem happening in test_case_03 that needs to be investigated. It looks like, for the route_advertise testing, test case 03 is intended to add IPv6 route advertisements for IPv6 to both AS configurations. But, instead, it looks like it is replacing the already present IPv4 advertisement with the new IPv6 advertisement and also adding the new one a second time. From the "before" and "after" sections of the log for that test case: Here's an example from bgp_as 52: Before:
After
|
It looks like an additional code block is needed in the "get_modify_requests" function in the "plugins/module_utils/network/sonic/config/bgp_af/bgp_af.py" function to handle the case of adding or modifying an entry in the "route advertise" list. |
The new commit to provide the revised "modify" handling for the route advertise list looks fine to me except for a minor change for which I am posting a comment (to get rid of an unnecessary additional input parameter). The test log, though, doesn't look right. Every "gathered" instance show a value of "null" for 'route_advertise_list'. The log seems to show the correct commands in the "invocation" section, but they must not be getting converted to correct curl commands. I'm still analyzing the code to see if I can figure out what's wrong, but wanted to go ahead and post this observation now so you can also take a look at the code to figure out the cause of the problem. |
There is also a failing sanity test. Please fix this or respond to this comment with an explanation of why it can't be fixed. |
I see two remaining problems that need to be fixed before merging this PR:
|
The change set looks good with the most recent changes. Approved. |
SUMMARY
I updated the sonic_bgp_af module to include route-advertise.
ISSUE TYPE
COMPONENT NAME
sonic_bgp_af
ADDITIONAL INFORMATION
bgp_af_regression_report.pdf
show_running_configuration_bgp_output.txt
bgp_af_log_output (6).txt