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

[dualtor]: Mock all y_cable methods for mux sim #3242

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

theasianpianist
Copy link
Contributor

Signed-off-by: Lawrence Lee [email protected]

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Approach

What is the motivation for this PR?

XCVRD runs some methods which attempt to read from cable hardware. This hardware doesn't exist for mux simulator, so XCVRD writes many errors to the syslog.

How did you do it?

Implement mocks for all methods in sonic_y_cable to prevent errors from being generated.

How did you verify/test it?

Inject new mux_simulator_client to dual ToR device with changes from sonic-net/sonic-platform-common#181. Verify PMON and mux containers stay up, and show mux status output looks normal. Initiate CLI switchover and confirm show mux status output reflects switchover.

Any platform specific information?

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

Documentation

@theasianpianist theasianpianist requested review from bingwang-ms, vdahiya12 and a team March 31, 2021 00:53
@theasianpianist
Copy link
Contributor Author

Do not merge until #3198 is merged

@@ -269,3 +277,125 @@ def check_if_link_is_active_for_torB(physical_port):
"""
return True

def enable_prbs_mode(physical_port, target, mode_value, lane_map):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would suggest putting a generic note for all these dummy values, so as to ensure that this needs to be corrected in future. suggest putting a TODO as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What needs to be done in the future? Since these hardware constructs don't exist for the simulator shouldn't we always use these dummy values?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we enable /disable loopback or prbs then normal traffic cannot run. I dont know how exactly you can accomplish this with simulator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something that would be used during normal operation?

@vdahiya12 vdahiya12 requested a review from jleveque March 31, 2021 00:57
@@ -172,7 +180,7 @@ def _post(physical_port, data):
return False
return True

def _get(physical_port):
def _get(physical_port, action=None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add this action argument? I don't see that it is used.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's used for flap counter in line 335

@bingwang-ms
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@theasianpianist
Copy link
Contributor Author

/Azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@wangxin wangxin merged commit 6de3cad into sonic-net:master Apr 1, 2021
nirmalya-keysight pushed a commit to nirmalya-keysight/sonic-mgmt that referenced this pull request Apr 5, 2021
What is the motivation for this PR?
XCVRD runs some methods which attempt to read from cable hardware. This hardware doesn't exist for mux simulator, so XCVRD writes many errors to the syslog.

How did you do it?
Implement mocks for all methods in sonic_y_cable to prevent errors from being generated.

How did you verify/test it?
Inject new mux_simulator_client to dual ToR device with changes from sonic-net/sonic-platform-common#181. Verify PMON and mux containers stay up, and show mux status output looks normal. Initiate CLI switchover and confirm show mux status output reflects switchover.

Signed-off-by: Lawrence Lee <[email protected]>
saravanansv pushed a commit to saravanansv/sonic-mgmt that referenced this pull request May 6, 2021
What is the motivation for this PR?
XCVRD runs some methods which attempt to read from cable hardware. This hardware doesn't exist for mux simulator, so XCVRD writes many errors to the syslog.

How did you do it?
Implement mocks for all methods in sonic_y_cable to prevent errors from being generated.

How did you verify/test it?
Inject new mux_simulator_client to dual ToR device with changes from sonic-net/sonic-platform-common#181. Verify PMON and mux containers stay up, and show mux status output looks normal. Initiate CLI switchover and confirm show mux status output reflects switchover.

Signed-off-by: Lawrence Lee <[email protected]>
@theasianpianist theasianpianist deleted the y_cable_sim_mock branch May 13, 2021 22:51
vmittal-msft pushed a commit to vmittal-msft/sonic-mgmt that referenced this pull request Sep 28, 2021
What is the motivation for this PR?
XCVRD runs some methods which attempt to read from cable hardware. This hardware doesn't exist for mux simulator, so XCVRD writes many errors to the syslog.

How did you do it?
Implement mocks for all methods in sonic_y_cable to prevent errors from being generated.

How did you verify/test it?
Inject new mux_simulator_client to dual ToR device with changes from sonic-net/sonic-platform-common#181. Verify PMON and mux containers stay up, and show mux status output looks normal. Initiate CLI switchover and confirm show mux status output reflects switchover.

Signed-off-by: Lawrence Lee <[email protected]>
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.

4 participants