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

[wol_test] Test expected failure like invalid parameters, down interface etc. #14387

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

w1nda
Copy link
Member

@w1nda w1nda commented Sep 3, 2024

Description of PR

Summary:
Fixes # (issue)
Test expected failure like invalid parameters, down interface etc.

Type of change

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

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

Wol has the ability to filter invalid parameters, we need to test this ability.

How did you do it?

Run wol with invalid parameters and check the output and return code of command.

How did you verify/test it?

Run on testbed

Any platform specific information?

Mx topo only.

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

Documentation

logging.info("Test with random dut port %s and ptf port index %s" % (random_dut_port, random_ptf_port))
exception_catched = False
try:
duthost.shell("wol %s %s -b -p %s" % (random_dut_port, target_mac, password))
Copy link
Contributor

Choose a reason for hiding this comment

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

duthost.shell() should be able to return a dict which contains rc and stderr. Why the testcase expect Exception?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will raise exception before return dict, so we need to catch the exception.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see.

):
target_mac = "1a:2b:3c:d1:e2:f7"
connected_dut_intf_to_ptf_index = get_connected_dut_intf_to_ptf_index
random_dut_port, random_ptf_port = random.choice(connected_dut_intf_to_ptf_index)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since these testcases only check invalid param. I suggest to remove these random variables. Use fixed param to simplify the testcases.

Copy link
Member Author

Choose a reason for hiding this comment

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

No problem, but this code can read port info from device and topo file, it's better than fixed port.

@w1nda
Copy link
Member Author

w1nda commented Sep 4, 2024

Hi @wangxin, cloud you help merge this PR? thanks in advance.

@wangxin wangxin merged commit 861fa5f into sonic-net:master Sep 5, 2024
16 checks passed
@w1nda
Copy link
Member Author

w1nda commented Sep 6, 2024

Hi @yxieca and @bingwang-ms , cloud you help approve backporting to 202311 and 202405? thanks in advance.

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Sep 6, 2024
…ace etc. (sonic-net#14387)

What is the motivation for this PR?
Wol has the ability to filter invalid parameters, we need to test this ability.

How did you do it?
Run wol with invalid parameters and check the output and return code of command.

How did you verify/test it?
Run on testbed

Any platform specific information?
Mx topo only.
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Sep 6, 2024
…ace etc. (sonic-net#14387)

What is the motivation for this PR?
Wol has the ability to filter invalid parameters, we need to test this ability.

How did you do it?
Run wol with invalid parameters and check the output and return code of command.

How did you verify/test it?
Run on testbed

Any platform specific information?
Mx topo only.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #14455

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #14456

mssonicbld pushed a commit that referenced this pull request Sep 6, 2024
…ace etc. (#14387)

What is the motivation for this PR?
Wol has the ability to filter invalid parameters, we need to test this ability.

How did you do it?
Run wol with invalid parameters and check the output and return code of command.

How did you verify/test it?
Run on testbed

Any platform specific information?
Mx topo only.
mssonicbld pushed a commit that referenced this pull request Sep 7, 2024
…ace etc. (#14387)

What is the motivation for this PR?
Wol has the ability to filter invalid parameters, we need to test this ability.

How did you do it?
Run wol with invalid parameters and check the output and return code of command.

How did you verify/test it?
Run on testbed

Any platform specific information?
Mx topo only.
hdwhdw pushed a commit to hdwhdw/sonic-mgmt that referenced this pull request Sep 20, 2024
…ace etc. (sonic-net#14387)

What is the motivation for this PR?
Wol has the ability to filter invalid parameters, we need to test this ability.

How did you do it?
Run wol with invalid parameters and check the output and return code of command.

How did you verify/test it?
Run on testbed

Any platform specific information?
Mx topo only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants