-
Notifications
You must be signed in to change notification settings - Fork 1k
[smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling #19313
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
[smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling #19313
Changes from 8 commits
48527c8
9b21769
3472ef0
ed70103
c29ff02
f36817f
da21ac7
194bb5c
c907f7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,9 +43,21 @@ def num_dpu_modules(platform_api_conn): # noqa F811 | |
| return num_modules | ||
|
|
||
|
|
||
| @pytest.fixture(scope='function', autouse=True) | ||
|
||
| def skip_for_non_smartswitch(duthosts, enum_rand_one_per_hwsku_hostname): | ||
| """ | ||
| Skip test if not running on a smartswitch testbed | ||
| """ | ||
| duthost = duthosts[enum_rand_one_per_hwsku_hostname] | ||
| if not duthost.facts.get('is_smartswitch'): | ||
| pytest.skip("Test is supported only on smartswitch testbeds. " | ||
| "is_smartswitch: {}".format(duthost.facts.get('is_smartswitch'))) | ||
|
|
||
|
|
||
| @pytest.fixture(scope='function', autouse=True) | ||
| def check_smartswitch_and_dark_mode(duthosts, enum_rand_one_per_hwsku_hostname, | ||
| platform_api_conn, num_dpu_modules): # noqa F811 | ||
| platform_api_conn, num_dpu_modules, # noqa F811 | ||
| skip_for_non_smartswitch): | ||
| """ | ||
| Checks whether given testbed is running | ||
| 202405 image or below versions | ||
|
|
@@ -57,9 +69,6 @@ def check_smartswitch_and_dark_mode(duthosts, enum_rand_one_per_hwsku_hostname, | |
|
|
||
| duthost = duthosts[enum_rand_one_per_hwsku_hostname] | ||
|
|
||
| if "DPUS" not in duthost.facts: | ||
| pytest.skip("Test is not supported for this testbed") | ||
|
|
||
| darkmode = is_dark_mode_enabled(duthost, platform_api_conn, num_dpu_modules) # noqa F811 | ||
|
|
||
| if darkmode: | ||
|
|
||
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.
does it support light mode and dark mode?
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.
@JibinBao, Variable is defined for all topo, it will be only true for smartswitch (in both darkmode and litmode)