Make test_fdb dualtor ready#2705
Conversation
Signed-off-by: bingwang <bingwang@microsoft.com>
Signed-off-by: bingwang <bingwang@microsoft.com>
wangxin
left a comment
There was a problem hiding this comment.
For dualtor setup, I think we need to set active side of all mux cables to the currently selected DUT before testing. For the ports that mux cable's active side is the other ToR, packets injected to these ports will go to the other ToR. The current ToR would not be able to receive them. Checking FDB will fail.
tests/fdb/test_fdb.py
Outdated
| ptf_ports_available_in_topo = ptfhost.host.options['variable_manager'].extra_vars.get("ifaces_map") | ||
| available_ports_idx = [ idx for idx, name in ptf_ports_available_in_topo.items() | ||
| if conf_facts['PORT'][port_index_to_name[idx]].get('admin_status', 'down') == 'up' ] | ||
| if idx in port_index_to_name and conf_facts['PORT'][port_index_to_name[idx]].get('admin_status', 'down') == 'up' ] |
There was a problem hiding this comment.
Could you adjust the indention? Indeed, I have been wondering why there is no syntax error here.
There was a problem hiding this comment.
Thanks. Updated.
Signed-off-by: bingwang <bingwang@microsoft.com>
Thanks. I raised another PR to do this #2850 |
…net#14309) Why I did it src/sonic-dbsyncd * 4dcfb61 - (HEAD -> 202205, origin/202205) Handled the error case of negative age (sonic-net#57) (2 days ago) [Vivek] src/sonic-swss * 142abdf - (HEAD -> 202205, origin/202205) swss: Fix egress queue counters in voq systems. (sonic-net#2705) (2 days ago) [Sambath Kumar Balasubramanian] src/sonic-utilities * 42a57f4c - (HEAD -> 202205, origin/202205) [202205] Update the ref guide to reflect the vlan brief output (sonic-net#2741) (2 days ago) [Vivek]
Signed-off-by: bingwang bingwang@microsoft.com
Description of PR
Summary:
Fixes # (issue)
This PR is to fix
test_fdbexception on dualtor testbed.An exception will be thrown when
test_fdbis running on dualtor testbed.It's because the number of ports on ptf containes is larger than that on DUT, since there will be an injected interface for each DUT's interface connected to VM.
For example, there are 32 ports on a dualtor DUT, but there are 36 ports on ptf. So an exception will be thrown when attempting to map ptf port indices to DUT port indices.
This PR addressed the issue by adding a check for existence of idx in port_index_to_name.
Type of change
Approach
What is the motivation for this PR?
This PR is to fix
test_fdbon dualtor testbed.How did you do it?
Adding a check for existence of idx in
port_index_to_name.How did you verify/test it?
Verified on both dualtor and single tor testbed.
Any platform specific information?
No.
Supported testbed topology if it's a new test case?
No.
Documentation