[multi-dut] add infrastructure to update dut port to ptf port index map#2460
Merged
yxieca merged 3 commits intosonic-net:masterfrom Nov 5, 2020
Merged
[multi-dut] add infrastructure to update dut port to ptf port index map#2460yxieca merged 3 commits intosonic-net:masterfrom
yxieca merged 3 commits intosonic-net:masterfrom
Conversation
In the single DUT scenario, the DUT interface indeces exactly match with the ptf port indeces. However, in multi-dut scneario, this is not always true. Multiple DUTs are sharing the same ptf host, therefore their interface indeces need to be translated to ptf port indeces according to the topology definition. In this change, a translate map is captured from topology definition. And member method get_minigraph_facts() is added to SonicHost to help getting the minigrap facts and then update ptf port indeces. Changed test_lag_2 to use the new method to map to the correct ptf port. Signed-off-by: Ying Xie <[email protected]>
lguohan
reviewed
Nov 4, 2020
Collaborator
Author
|
retest vsimage please |
lguohan
approved these changes
Nov 5, 2020
Blueve
approved these changes
Nov 5, 2020
kazinator-arista
pushed a commit
to kazinator-arista/sonic-mgmt
that referenced
this pull request
Mar 4, 2026
…e submodule head (sonic-net#12149) linkmgrd: * 05e5f4c 2022-09-20 | [Active-Active] flaky LinkmgrdBootupSequence unit tests (sonic-net#134) (HEAD -> 202205) [Jing Zhang] * 16fcadf 2022-09-13 | [active-standby] update warmboot reconciliation logic (sonic-net#129) [Jing Zhang] * e656a87 2022-09-09 | [active-active] shutdown link prober when starting as isolated (sonic-net#130) [Jing Zhang] uttilities: yinxi@ying-dev-vm-01:~/src/sonic-202205/src/sonic-utilities$ git hist github/202205..HEAD * 562188f 2022-09-14 | Use 'default' VRF when VRF name is not provided (sonic-net#2368) (HEAD -> 202205) [Sumukha Tumkur Vani] * c50ba4f 2022-09-20 | [minigraph] add option to specify golden path in load_minigraph (sonic-net#2350) [jingwenxie] * cec5ab2 2022-09-20 | [GCU]Remove GCU unique lane check for duplicate lanes platforms (sonic-net#2343) [jingwenxie] * 8d20771 2022-09-15 | Vnet_route_check Vxlan tunnel route update. (sonic-net#2281) [siqbal1986] swss: * 88371f7 2022-09-21 | [ci] Only when test stage succeeded or succeededwithissues, PR run Gcov (sonic-net#2460) (HEAD -> 202205) [Liu Shilong] * c11dbd7 2022-09-15 | [QoS] Enforce drop probability only for colors whose WRED are enabled (sonic-net#2422) [Stephen Sun] sairedis: * 80928dd 2022-09-06 | [lgtm] Add uuid library (sonic-net#1119) (HEAD -> 202205, github/202205) [Kamil Cudnik] * c147dd0 2022-09-16 | [202205][vslib]: Add SAI_PORT_ATTR_OPER_SPEED get sonic-net#1123 [Ze Gan] platform-daemon: * 9cf8adf 2022-09-21 | [ycabled] add notification for gRPC connection state transitions to IDLE/TRANSIENT_FAILURE (sonic-net#295) (HEAD -> 202205) [vdahiya12] * 1e07ae3 2022-09-20 | Use get() to fetch default value from dictionary for port admin_status sonic-net#286 [anamehra] * 157f483 2022-09-15 | [Xcvrd] Soak duplicate events and process only updated interested events (sonic-net#285) [Prince George] Signed-off-by: Ying Xie <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
In the single DUT scenario, the DUT interface indeces exactly match with the ptf port indeces. However, in multi-dut scneario, this is not always true. Multiple DUTs are sharing the same ptf host, therefore their interface indeces need to be translated to ptf port indeces according to the topology definition.
How did you do it?
In this change, a translate map is captured from topology definition. And member method get_extended_minigraph_facts() is added to SonicHost to help getting the minigrap facts and then extend it with ptf port indices with mg_facts['minigraph_ptf_indeces'].
Changed test_lag_2 to use the new method to map to the correct ptf port.
Signed-off-by: Ying Xie [email protected]
How did you verify/test it?
Tested the infrastructure with updated lag_2 test.
platform linux2 -- Python 2.7.12, pytest-4.6.5, py-1.9.0, pluggy-0.13.1
ansible: 2.8.12
rootdir: /var/src/sonic-mgmt/tests, inifile: pytest.ini
plugins: ansible-2.2.2, forked-1.3.0, xdist-1.28.0, html-1.22.1, repeat-0.8.0, metadata-1.10.0
collected 24 items
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0001-single_lag] PASSED [ 4%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0001-lacp_rate] PASSED [ 8%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0001-fallback] SKIPPED [ 12%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0003-single_lag] PASSED [ 16%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0003-lacp_rate] PASSED [ 20%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0003-fallback] SKIPPED [ 25%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0002-single_lag] PASSED [ 29%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0002-lacp_rate] PASSED [ 33%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0002-fallback] SKIPPED [ 37%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0004-single_lag] PASSED [ 41%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0004-lacp_rate] PASSED [ 45%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-06|PortChannel0004-fallback] SKIPPED [ 50%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0001-single_lag] PASSED [ 54%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0001-lacp_rate] PASSED [ 58%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0001-fallback] SKIPPED [ 62%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0003-single_lag] PASSED [ 66%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0003-lacp_rate] PASSED [ 70%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0003-fallback] SKIPPED [ 75%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0002-single_lag] PASSED [ 79%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0002-lacp_rate] PASSED [ 83%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0002-fallback] SKIPPED [ 87%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0004-single_lag] PASSED [ 91%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0004-lacp_rate] PASSED [ 95%]
pc/test_lag_2.py::test_lag[str2-7050cx3-acs-07|PortChannel0004-fallback] SKIPPED [100%]
------------------------------------------------------------------------ generated xml file: /tmp/logs-01/tr.xml -------------------------------------------------------------------------