[dualtor] Implement fixtures for test setup#2899
[dualtor] Implement fixtures for test setup#2899bingwang-ms wants to merge 1 commit intosonic-net:masterfrom
Conversation
This commit implements 4 new fixtures 1 set_upper_tor_active (function level) 2 set_lower_tor_active (function level) 3 set_upper_tor_active_module (module level) 4 set_lower_tor_active_module (module level) Signed-off-by: bingwang <[email protected]>
| """ | ||
| A function level fixture to toggle mux to upper tor for all interfaces | ||
| """ | ||
| force_active_tor(upper_tor_host, "all") |
There was a problem hiding this comment.
Please use the mux simulator to change the active ToR. Using the CLI commands should be reserved for the test cases that require manually changing the active ToR. Since the CLI commands are a feature that is being tested, we don't want to use them elsewhere.
There was a problem hiding this comment.
I agree, we should use MUX simulator for toggle usecases. But, what is force_active_tor helper to be used for?
We should also make the fixtures in MUX simulator as function scope instead of module.
There was a problem hiding this comment.
This also makes me ask why do we need this fixtures when we have similar task being done by fixtures present in mux_simulator_control.py?
toggle_all_simulator_ports_to_lower_tor()
toggle_all_simulator_ports_to_upper_tor()
.....
There was a problem hiding this comment.
I think using CLI is better than using the mux_simulator interfaces. Actually, the CLI will call mux_simulator at last. These fixtures are intended to be used before dualtor test cases that require a certain ToR as active.
In other word, I don't think we should call mux_simulator interfaces directly. Test cases should do what human do. So I think CLI is a better choice.
| """ | ||
| A function level fixture to toggle mux to lower tor for all interfaces | ||
| """ | ||
| force_active_tor(lower_tor_host, "all") |
There was a problem hiding this comment.
Thanks. Will update.
| """ | ||
| A module level fixture to toggle mux to upper tor for all interfaces | ||
| """ | ||
| force_active_tor(upper_tor_host, "all") |
| """ | ||
| A module level fixture to toggle mux to lower tor for all interfaces | ||
| """ | ||
| force_active_tor(lower_tor_host, "all") No newline at end of file |
There was a problem hiding this comment.
Same as above, plus add newline to EOF
|
The PR is no longer needed as we already have |
…atically (sonic-net#15835) src/sonic-utilities * bc7c7929 - (HEAD -> 202205, origin/202205) Add FEC correctable and uncorrectable port stats (sonic-net#2027) (10 hours ago) [Prince George] * 58db48ad - [show][muxcable] update `show mux tunnel-route` to check soc_ipv6 as well (10 hours ago) [Jing Zhang] * 24fc1db8 - [dualtor][route_check] filter out `soc_ipv6` (sonic-net#2899) (10 hours ago) [Jing Zhang] * d89d4832 - [route_check][dualtor] Ignore vlan neighbor route miss (sonic-net#2888) (10 hours ago) [Longxiang Lyu]
Signed-off-by: bingwang [email protected]
Description of PR
Summary:
Fix #2834
This commit implements 4 new fixtures
Type of change
Approach
What is the motivation for this PR?
This PR is to implement several fixtures for dualtor test case setup.
For dualtor testcases, it's required to call one of these fixtures to ensure that the active ToR is expected.
How did you do it?
This PR implements 4 new fixtures.
How did you verify/test it?
Verified by a demo script
Any platform specific information?
No.
Supported testbed topology if it's a new test case?
Dualtor specific.
Documentation