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

[platform/test_sfp]Backport #1338 "Operate SFP only once for split ports when resetting or setting LPM" to 201811 #1378

Merged
merged 1 commit into from
Feb 11, 2020
Merged

Conversation

stephenxs
Copy link
Contributor

Description of PR

Summary:
Fixes # (issue)
For split ports, only operate them once when testing reset and low power mode.

Type of change

  • [] Bug fix
  • [] Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

How did you do it?

  1. introduce a snippet of script which retrieves port mapping from DUT
  2. get_port_map:
  • for the first time being called, it copies the script to the DUT, executes it on DUT and then parses the result to construct the port mapping. It also saves the map for future use
  • for the following time being called, it just returns the saved map.
  1. when reset/set LPM for SFP modules, it uses the following logic to avoid repeating operating the physical SFP modules offering split ports:
    operated_phy_set = {}
    for each logical port
        phyport = port_mapping[logical]
        if phyport in operated_phy_set,
            skip
        else
            operate the SFP
            add phyport to operated_phy_set

How did you verify/test it?

run test_sfp

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

…ng or setting LPM (#1338)

* [sfp]operating the logical interfaces sharing a physical interface only once

* [sfp]add teardown, beautify and optimize code

* [sfp]fix comments
@lguohan lguohan merged commit 414c95f into sonic-net:201811 Feb 11, 2020
@stephenxs stephenxs deleted the 201811-dont-repeat-operate-sfp branch February 14, 2020 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants