[bgpmon]Add new test case test_bgpmon#2521
Conversation
Signed-off-by: bingwang <[email protected]>
|
can you add this to kvmtest.sh, let's try it on kvm switch as well. |
Signed-off-by: bingwang <[email protected]>
Sure. Updated. |
| @@ -0,0 +1,15 @@ | |||
| { | |||
There was a problem hiding this comment.
better to name bgpmon.json.j2 and save it under tests/bgp/templates/
| 'local_addr': local_addr, | ||
| 'peer_name': 'bgp_monitor' | ||
| } | ||
| bgpmon_template = Template(open(BGPMON_TEMPLATE_FILE).read()) |
There was a problem hiding this comment.
better to use Ansible module template to do this.
There was a problem hiding this comment.
We need to add those extra vars to a AnsibleHost such as ptfhost or duthost if we want to use template in Ansible module, right?
tests/bgp/test_bgpmon.py
Outdated
| @pytest.fixture | ||
| def common_setup_teardown(duthost, ptfhost): | ||
| mg_facts = duthost.minigraph_facts(host=duthost.hostname)['ansible_facts'] | ||
| peer_addr = generate_ips(1, "%s/%s" % (mg_facts['minigraph_vlan_interfaces'][0]['addr'], |
There was a problem hiding this comment.
What if the testbed is a t1?
pavel-shirshov
left a comment
There was a problem hiding this comment.
Thank you for the test case
I think the logic should be following:
- Generate random ip address
- Check that the ip address is routed through default routes, if not - go to item 1
- Extract physical interfaces which are used as interfaces in default routes
- Start capturing on the interfaces.
tests/bgp/test_bgpmon.py
Outdated
| BGPMON_TEMPLATE_FILE = 'bgp/bgpmon.j2' | ||
| BGPMON_CONFIG_FILE = '/tmp/bgpmon.json' | ||
| BGP_PORT = 179 | ||
| BGP_CONNECT_TIMEOUT = 120 |
There was a problem hiding this comment.
I'd suggest to make the timeout to 121. Just to be double sure
tests/bgp/test_bgpmon.py
Outdated
| @pytest.fixture | ||
| def common_setup_teardown(duthost, ptfhost): | ||
| mg_facts = duthost.minigraph_facts(host=duthost.hostname)['ansible_facts'] | ||
| peer_addr = generate_ips(1, "%s/%s" % (mg_facts['minigraph_vlan_interfaces'][0]['addr'], |
There was a problem hiding this comment.
As I remember we need to generate a random ip address and check that 'ip route get ' will return default route
1.Move bgpmon.j2 to templates 2.Generate random IP address for test 3.Capture on all interfaces in default routes Signed-off-by: bingwang <[email protected]>
|
Updated. Please help to review @pavel-shirshov @lolyu |
|
@pavel-shirshov , can you put the test cases under doc directory so that we can have a reference there? |
tests/bgp/test_bgpmon.py
Outdated
|
|
||
| def generate_ip_through_default_route(host): | ||
| # Generate an IP address routed through default routes | ||
| ip_addrs = generate_ips(200, "200.0.0.1/24", []) |
There was a problem hiding this comment.
This code will iterate through the same 200.0.0.0/24 subnet.
So if the first prefix fail, other prefixes would fail too.
There was a problem hiding this comment.
Updated. Thanks!
|
@pavel-shirshov , can you provide the bgp commands to disable the nexthop tracking so that they can test it and make sure the test does not pass for negative case? i'd like to make sure the case does catch issue. |
The ptf hosts are placed under sonic group, and the ansible_user will be overwriten by that in ansible/group_vars/sonic/variables, which is ```admin``` in default. As a result, the login to ptf container will failed on vtestbed because of incorrect user. This commit address this issue. Signed-off-by: bingwang <[email protected]>
Sure. Added a new test case for verifying this. Please help to review. Thanks |
3329dea to
2f3e74a
Compare
Signed-off-by: bingwang <[email protected]>
2f3e74a to
0454bdd
Compare
|
retest vsimage please |
1 similar comment
|
retest vsimage please |
swss: * 7e274a4 2022-11-18 | [Fdbsyncd] Bug Fix for remote MAC move to local MAC and Fix for Static MAC advertisement in EVPN. (sonic-net#2521) (HEAD -> 202205, github/202205) [KISHORE KUNAL] * 434e80c 2022-11-02 | Fix vs test issue: failed to remove vlan due to referenced by vlan interface (sonic-net#2504) [Stephen Sun] * 11bef87 2022-11-27 | [dual-tor] add missing SAI attribte in order to create IPNIP tunnel (sonic-net#2503) [Andriy Yurkiv] * 11aba29 2022-11-09 | [SWSS] Innovium platform specific changes in PFC Detect lua script (sonic-net#2493) [maulik_patel_marvell] * 4a165ee 2022-11-14 | Revert "[vlanmgr] Disable `arp_evict_nocarrier` for vlan host intf (sonic-net#2469)" (sonic-net#2518) [Longxiang Lyu] Signed-off-by: Ying Xie <[email protected]> Signed-off-by: Ying Xie <[email protected]>
Update sonic-swss submodule pointer to include the following: * 782a2ef Align watermark flow with port configuration ([sonic-net#2525](sonic-net/sonic-swss#2525)) * dca78d8 [Fdbsyncd] Bug Fix for remote MAC move to local MAC and Fix for Static MAC advertisement in EVPN. ([sonic-net#2521](sonic-net/sonic-swss#2521)) * 28aa309 [fpm] Fix FpmLink to read all netlink messages from FPM message ([sonic-net#2492](sonic-net/sonic-swss#2492)) Signed-off-by: dprital <[email protected]>
Signed-off-by: bingwang [email protected]
Description of PR
Summary:
Fixes # (issue)
This PR implements a new test case
test_bgpmonaccording following test plan.Testplan:
By default bgp connection timer is 120 seconds
Type of change
Approach
What is the motivation for this PR?
This PR is to add a new test case for bgp monitor.
How did you do it?
How did you verify/test it?
Verified on Arista-7260cx3 (t0) and vtestbed (t1)
Any platform specific information?
No.
Supported testbed topology if it's a new test case?
Support any topo.
Documentation