Implement more interfaces in dualtor_utils#2721
Implement more interfaces in dualtor_utils#2721bingwang-ms merged 3 commits intosonic-net:masterfrom
Conversation
This PR add several new interfaces and fixtures in dualtor_utils. Signed-off-by: bingwang <[email protected]>
| If physical_port is none, the returned url contains no '/port/action' (For polling/toggling all ports) | ||
| action: a str, output/drop or None. If action is None, the returned url contains no '/action' | ||
| Returns: | ||
| The url for posting flow update request, like http://10.0.0.64:8080/mux/vms17-8/1/drop(output) |
There was a problem hiding this comment.
I think the convention is to use "|" , for example "this|that", to indicate either "this" or "that". The example would be better like this:
http://10.0.0.64:8080/mux/vms17-8/1/drop|output
|
|
||
| Args: | ||
| server_url: a str, the full address of mux server, like http://10.0.0.64:8080/mux/vms17-8/1/drop(output) | ||
| server_url: a str, the full address of mux server, like http://10.0.0.64:8080/mux/vms17-8/[1/drop(output)] |
There was a problem hiding this comment.
I think the convention is to use "|" , for example "this|that", to indicate either "this" or "that".
| """ | ||
| server_url = _url(mux_server_url) | ||
| data = {"active_side": TOR_B} | ||
| pytest_assert(_post(server_url, data), "Failed to toggle all ports to TOR A") |
There was a problem hiding this comment.
I think this function is dependent on PR #2703.
The simulator server also supports two other options:
- "toggle": Just toggle the active side for all ports
- "random": Randomly set active side for each of the port.
Can you consider adding fixtures for these two options as well?
1. Add two new fixtures. 2. Update some comments. Signed-off-by: bingwang <[email protected]>
|
All updated. Thanks for your great suggestions! @wangxin |
| @pytest.fixture(scope='module') | ||
| def toggle_all_simulator_ports_to_random_side(mux_server_url): | ||
| """ | ||
| A module level fixture to toggle all ports to an random side. |
There was a problem hiding this comment.
Thanks. Updated.
wangxin
left a comment
There was a problem hiding this comment.
LGTM except a typo in docstring.
Signed-off-by: bingwang <[email protected]>
…net#14540) Why I did it src/linkmgrd * 2b81c83 - (HEAD -> 202205, origin/202205) [active-standby] Enforce switchover based on heartbeats when mux probe keeps failing (sonic-net#184) (5 hours ago) [Jing Zhang] src/sonic-platform-common * c401866 - (HEAD -> 202205, origin/202205) Add set/get_lpmode APIs for sff8436 and sff8636 optics (sonic-net#353) (4 hours ago) [longhuan-cisco] * ea8331e - implement CMIS set_laser_freq to support 100GHz grid space (sonic-net#294) (4 hours ago) [ChiouRung Haung] src/sonic-platform-daemons * cc32493 - (HEAD -> 202205, origin/202205) Retrieve subport from CONFIG_DB to enable breakout support (sonic-net#342) (4 hours ago) [mihirpat1] * 864e589 - Pass grid parameter while calling set_laser_freq (sonic-net#317) (4 hours ago) [mihirpat1] src/sonic-swss * 699477d - (HEAD -> 202205, origin/202205) overlay_dmac change in Vnet configuration. (sonic-net#2721) (4 hours ago) [siqbal1986] src/sonic-utilities * f9f3e7e4 - (HEAD -> 202205, origin/202205) [voq] Add fabric_ns to the ns_list when display_option is DISPLAY_ALL. (sonic-net#2717) (4 hours ago) [jfeng-arista] * eb2d9167 - [GCU] Prohibit removal of PFC_WD POLL_INTERVAL field (sonic-net#2777) (4 hours ago) [isabelmsft]
Signed-off-by: bingwang [email protected]
Description of PR
Summary:
Fixes # (issue)
This PR add several new interfaces and fixtures in dualtor_utils.
Functions:
Fixtures:
The next plan is to toggle y_cable simulator ports with these newly implemented functions and fixtures.
Type of change
Approach
What is the motivation for this PR?
This PR is to add several new interfaces and fixtures in dualtor_utils.
How did you do it?
How did you verify/test it?
Verified by a demo script, which toggled all ports and verified returned status.
Any platform specific information?
No.
Supported testbed topology if it's a new test case?
No.
Documentation