Conversation
|
@sihuihan88, |
pavel-shirshov
left a comment
There was a problem hiding this comment.
Some minor issues
ansible/library/get_ip_in_range.py
Outdated
| m_args = self.module.params | ||
| exclude_ips = [] | ||
| if m_args['exclude_ips'] is not None: | ||
| ip_list = m_args['exclude_ips'].split() |
There was a problem hiding this comment.
You can define this parameter as a list. Something like this:
exclude_ips=dict(required=False, default=[], type='list'),
| # Run BGP Speaker test | ||
| #======================================== | ||
|
|
||
| - fail: msg="Information about tested missing" |
There was a problem hiding this comment.
check you have ptf host defined
| import os | ||
| import time | ||
| import sys | ||
| from sets import Set |
There was a problem hiding this comment.
Just curious. Why? ;)
s = set() working without importing anything
ansible/library/minigraph_facts.py
Outdated
| bgp_peers_with_range.append({ | ||
| 'name': name, | ||
| 'ip_range': ip_range | ||
| }) |
There was a problem hiding this comment.
convert tab into whitespaces
|
|
||
| - name: set bgp speaker asn number | ||
| set_fact: | ||
| bgp_speaker_asn={{deployment_id_asn_map[deployment_id]}} |
There was a problem hiding this comment.
be consistent on the space, in line 19, you have space between braces and word. here you do not.
|
|
||
| - name: Generate configuration for the first exabgp instance | ||
| template: src=roles/test/templates/exabgp/config.j2 dest=/tmp/exabgp/{{item.file_name}} | ||
| with_items: |
There was a problem hiding this comment.
why not combine them using
with_items:
- item1
- item2
- item3?
?
| connection: local | ||
|
|
||
| - name: Generate start file for exabgp instances | ||
| template: src=roles/test/templates/exabgp/start.j2 dest=/tmp/exabgp/{{item.file_name}} |
There was a problem hiding this comment.
template allows you to deploy the file to remove host, wonder why you choose not? it can also set the mode.
| delegate_to: "{{ptf_host}}" | ||
|
|
||
| - name: Start exabgp instances | ||
| shell: chmod +x /root/exabgp/start.sh && sh /root/exabgp/start.sh |
There was a problem hiding this comment.
you can do the chmod in the template module.
| with_items: "['{{slb_ips[0].split('/')[0]}}', '{{slb_ips[1].split('/')[0]}}', '{{vlan_ips[0].split('/')[0]}}'] " | ||
|
|
||
|
|
||
| - name: Kill exabgp instances |
There was a problem hiding this comment.
you can use killall to kill the process by name, you do not really need the get the pid first.
|
|
||
| - name: Copy helper files to ptf container | ||
| copy: src=roles/test/files/helpers/announce_routes.py dest={{exabgp_dir}} | ||
| delegate_to: "{{ptf_host}}" |
There was a problem hiding this comment.
you can copy the the whole directory to the dest using copy module. do not need to specify file one-by-one.
|
👍 |
|
@pavel-shirshov , can you check if there is anything need to change or approve? |
* Add BGP speaker test * support the case when multiple peer range in single group
<!-- Please make sure you've read and understood our contributing guidelines; https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md Please provide following information to help code review process a bit easier: --> ### Description of PR <!-- - Please include a summary of the change and which issue is fixed. - Please also include relevant motivation and context. Where should reviewer start? background context? - List any dependencies that are required for this change. --> Summary: Fixes # (issue) ### Type of change <!-- - Fill x for your type of change. - e.g. - [x] Bug fix --> - [ ] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [ ] Test case improvement ### Back port request - [ ] 202012 - [ ] 202205 - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 ### Approach #### What is the motivation for this PR? The eos default cred is all digits. It may be interpreted as an integer and raise below error during tests: ``` File "/var/src/sonic-mgmt/tests/common/devices/eos.py", line 85, in shutdown out = self.eos_config( File "/var/src/sonic-mgmt/tests/common/devices/base.py", line 131, in _run raise RunAnsibleModuleFail("run module {} failed".format(self.module_name), res) tests.common.errors.RunAnsibleModuleFail: run module eos_config failed, Ansible Results => failed = True module_stdout = module_stderr = Expected unicode or bytes, got 123456 msg = MODULE FAILURE See stdout/stderr for the exact error _ansible_no_log = None changed = False stdout = stderr = ``` #### How did you do it? Add quote to the all digits default cred to force string type. #### How did you verify/test it? #### Any platform specific information? #### Supported testbed topology if it's a new test case? ### Documentation <!-- (If it's a new feature, new test case) Did you update documentation/Wiki relevant to your implementation? Link to the wiki page? -->
sonic-net#15654) #### Why I did it src/linkmgrd ``` * 3f89fce - (HEAD -> 202012, origin/202012) [202012] Use Vlan MAC as src MAC for link prober by default sonic-net#93 (sonic-net#209) (6 weeks ago) [Jing Zhang] ```
…lly (sonic-net#18574) #### Why I did it src/sonic-gnmi ``` * 4b12af9 - (HEAD -> 202305, origin/202305) Merge pull request sonic-net#209 from zbud-msft/revert_pfcwd_202305 (2 minutes ago) [StormLiangMS] * 802dbb7 - Revert "Replace PFC_WD_TABLE with PFC_WD (sonic-net#173)" (28 hours ago) [Zain Budhwani] * e1397c4 - Revert "Account for GLOBAL key in PFC_WD (sonic-net#178)" (28 hours ago) [Zain Budhwani] ``` #### How I did it #### How to verify it #### Description for the changelog
This is to test support for BGP speaker which requires bgp dynamic neighbor configuration in quagga.
We use three exabgp instances to simulate three BGP speakers in ptf, which will create bgp sessions and
announce routes to DUT. DUT has dynamic neighbor bgp configuration for bgp speakers, and should
have bgp speakers shown as dynamic neighbors after exbagp instances announce routes.
We use bgp facts to valid the behavior.