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

Updated BBR to use peer group name as prefix. #6515

Merged
merged 2 commits into from
Jan 22, 2021

Conversation

abdosi
Copy link
Contributor

@abdosi abdosi commented Jan 21, 2021

Why/What I did:

Currently BBR Manager looks for peer-group name to start with value define in constants.yml (https://github.com/Azure/sonic-buildimage/blob/master/files/image_config/constants/constants.yml#L40). Peer-name need to be exact string match.

The change in this PR is to make BBR configured for peer-group if it's name starts with (prefixed) with the string define in constants.yml.

This is needed because Peer name can have deployment id at the end with the string "DEPLOYMENT_ID_NUM".
Eg: TIER0_V4_DEPLOYMENT_ID_0

How I verify:

  • Added Unit test cases (test___set_prepare_config_enabled_multiple_peers and test___set_prepare_config_disabled_multiple_peers)
adosi@68cd7f721b7f:/sonic/src/sonic-bgpcfgd$ pytest tests/test_bbr.py::test___set_prepare_config_enabled_multiple_peers
============================================================================================== test session starts ==============================================================================================
platform linux2 -- Python 2.7.13, pytest-3.0.6, py-1.4.32, pluggy-0.4.0
rootdir: /sonic/src/sonic-bgpcfgd, inifile: pytest.ini
plugins: cov-2.4.0
collected 29 items

tests/test_bbr.py .

---------- coverage: platform linux2, python 2.7.13-final-0 ----------
Name                             Stmts   Miss  Cover
----------------------------------------------------
bgpcfgd/__init__.py                  0      0   100%
bgpcfgd/__main__.py                  3      3     0%
bgpcfgd/config.py                   69     69     0%
bgpcfgd/directory.py                63     36    43%
bgpcfgd/frr.py                      49     49     0%
bgpcfgd/log.py                      15      6    60%
bgpcfgd/main.py                     53     53     0%
bgpcfgd/manager.py                  41     23    44%
bgpcfgd/managers_allow_list.py     425    425     0%
bgpcfgd/managers_bbr.py             95     59    38%
bgpcfgd/managers_bgp.py            192    192     0%
bgpcfgd/managers_db.py               9      9     0%
bgpcfgd/managers_intf.py            33     33     0%
bgpcfgd/managers_setsrc.py          44     44     0%
bgpcfgd/runner.py                   44     44     0%
bgpcfgd/template.py                 64     42    34%
bgpcfgd/utils.py                    19     19     0%
bgpcfgd/vars.py                      1      0   100%
----------------------------------------------------
TOTAL                             1219   1106     9%


=========================================================================================== 1 passed in 0.15 seconds ======================================================================================

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
lguohan
lguohan previously approved these changes Jan 21, 2021
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@abdosi abdosi merged commit 5f39926 into sonic-net:master Jan 22, 2021
@abdosi abdosi deleted the master_bbr branch January 22, 2021 16:29
daall pushed a commit that referenced this pull request Jan 22, 2021
To make BBR configured for peer-group if it's name starts with (prefixed) with the string define in constants.yml instead of exact string match.
abdosi added a commit that referenced this pull request Jan 22, 2021
To make BBR configured for peer-group if it's name starts with (prefixed) with the string define in constants.yml instead of exact string match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants