-
Notifications
You must be signed in to change notification settings - Fork 708
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
Conversation
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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Hi @wangxin, cloud you help merge this PR? thanks in advance. |
Hi @yxieca and @bingwang-ms , cloud you help approve backporting to 202311 and 202405? thanks in advance. |
…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.
…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.
Cherry-pick PR to 202405: #14455 |
Cherry-pick PR to 202311: #14456 |
…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.
…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.
…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.
Description of PR
Summary:
Fixes # (issue)
Test expected failure like invalid parameters, down interface etc.
Type of change
Back port request
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