[smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling#19313
Merged
qiluo-msft merged 9 commits intosonic-net:masterfrom Jul 9, 2025
Merged
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
tests/common/plugins/conditional_mark/tests_mark_conditions_platform_tests.yaml
Outdated
Show resolved
Hide resolved
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
nikamirrr
approved these changes
Jul 2, 2025
prabhataravind
approved these changes
Jul 2, 2025
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
congh-nvidia
reviewed
Jul 3, 2025
Contributor
There was a problem hiding this comment.
Hi @vvolam , as what I understand, there will be conflicts if we have same tests in here and in the other yaml files. We can only split the mark conditions based on tests but not platforms.
Even if you only want to add tests in smartswitch/ here, it is confusing and there could be mistakes in the future.
Looks like the file is to skip the smartswitch tests on other platforms, can add a fixture to do this for the tests under smartsiwtch/ ?
Other changes look good to me.
Contributor
Author
There was a problem hiding this comment.
@congh-nvidia I have added the new fixture. Thank you!
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
11 tasks
11 tasks
11 tasks
yejianquan
pushed a commit
that referenced
this pull request
Jul 25, 2025
…rtswitch (#19617) (#19733) Description of PR Use duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_smartswitch") instead of 'duthost.get_facts().get("is_smartswitch")' , because is_smartswitch is defined in dut_basic_facts not in facts Skip warm-reboot and fast-reboot check test for test_check_reset_status on smartswitch skip test_bgp_session_interface_down on smartswitch when reboot type is warm-reboot Summary: Fixes # (issue) Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Approach What is the motivation for this PR? Fix issue introduced by PR: [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling #19313 Skip some tests on smartswitch, because smartswitch does not support warm-reboot and fast-reboot How did you do it? Use duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_smartswitch") instead of 'duthost.get_facts().get("is_smartswitch")' , because is_smartswitch is defined in dut_basic_facts Skip warm-reboot and fast-reboot for test_check_reset_status on smartswitch skip warm-reboot for test_bgp_session_interface_down on smartswitch How did you verify/test it? Run the tests on smartswitch Any platform specific information? smartswitch Supported testbed topology if it's a new test case?
xixuej
added a commit
to xixuej/sonic-mgmt
that referenced
this pull request
Jul 28, 2025
This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313)
roy-sror
pushed a commit
that referenced
this pull request
Jul 29, 2025
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com>
11 tasks
yejianquan
pushed a commit
that referenced
this pull request
Jul 30, 2025
cherry-pick #19574 Description of PR Summary: This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (#19313) The way to check if is dpu should use duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_dpu") instead of duthost.get_facts().get('is_dpu') becasue PR #19313 added the facts into dut_basic_facts Resolve merge conflicts for branch 202505 Co-authored-by: Cong Hou <congh@nvidia.com>
nissampa
pushed a commit
to nissampa/sonic-mgmt_dpu_test
that referenced
this pull request
Aug 7, 2025
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced.
nissampa
pushed a commit
to nissampa/sonic-mgmt_dpu_test
that referenced
this pull request
Aug 7, 2025
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com>
ashutosh-agrawal
pushed a commit
to ashutosh-agrawal/sonic-mgmt
that referenced
this pull request
Aug 14, 2025
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced.
ashutosh-agrawal
pushed a commit
to ashutosh-agrawal/sonic-mgmt
that referenced
this pull request
Aug 14, 2025
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com>
vidyac86
pushed a commit
to vidyac86/sonic-mgmt
that referenced
this pull request
Oct 23, 2025
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced.
vidyac86
pushed a commit
to vidyac86/sonic-mgmt
that referenced
this pull request
Oct 23, 2025
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com>
opcoder0
pushed a commit
to opcoder0/sonic-mgmt
that referenced
this pull request
Dec 8, 2025
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced. Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
opcoder0
pushed a commit
to opcoder0/sonic-mgmt
that referenced
this pull request
Dec 8, 2025
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com> Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
gshemesh2
pushed a commit
to gshemesh2/sonic-mgmt
that referenced
this pull request
Dec 16, 2025
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced. Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
gshemesh2
pushed a commit
to gshemesh2/sonic-mgmt
that referenced
this pull request
Dec 16, 2025
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com> Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
AharonMalkin
pushed a commit
to AharonMalkin/sonic-mgmt
that referenced
this pull request
Dec 16, 2025
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced. Signed-off-by: Aharon Malkin <amalkin@nvidia.com>
AharonMalkin
pushed a commit
to AharonMalkin/sonic-mgmt
that referenced
this pull request
Dec 16, 2025
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com> Signed-off-by: Aharon Malkin <amalkin@nvidia.com>
gshemesh2
pushed a commit
to gshemesh2/sonic-mgmt
that referenced
this pull request
Dec 21, 2025
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced. Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
gshemesh2
pushed a commit
to gshemesh2/sonic-mgmt
that referenced
this pull request
Dec 21, 2025
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com> Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
venu-nexthop
pushed a commit
to venu-nexthop/sonic-mgmt
that referenced
this pull request
Jan 13, 2026
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced.
venu-nexthop
pushed a commit
to venu-nexthop/sonic-mgmt
that referenced
this pull request
Jan 13, 2026
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com>
gshemesh2
pushed a commit
to gshemesh2/sonic-mgmt
that referenced
this pull request
Jan 26, 2026
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced. Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
gshemesh2
pushed a commit
to gshemesh2/sonic-mgmt
that referenced
this pull request
Jan 26, 2026
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com> Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
ytzur1
pushed a commit
to ytzur1/sonic-mgmt
that referenced
this pull request
Feb 2, 2026
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced. Signed-off-by: Yael Tzur <ytzur@nvidia.com>
ytzur1
pushed a commit
to ytzur1/sonic-mgmt
that referenced
this pull request
Feb 2, 2026
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com> Signed-off-by: Yael Tzur <ytzur@nvidia.com>
venu-nexthop
pushed a commit
to venu-nexthop/sonic-mgmt
that referenced
this pull request
Mar 27, 2026
…rm-specific test handling (sonic-net#19313) Description of PR Summary: This PR adds is_smartswitch and is_dpu device facts to the dut_basic_facts module, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from the SonicHost class and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a new tests_mark_conditions_smartswitch.yaml marker configuration file to skip SmartSwitch-incompatible tests declaratively. Approach What is the motivation for this PR? Some tests such as fast_reboot and warm_reboot are not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain. How did you do it? Added is_smartswitch and is_dpu flags to the dut_basic_facts module. Removed is_smartswitch() and is_dpu() methods from the SonicHost class. Replaced all direct method calls with duthost.facts['is_smartswitch'] and duthost.facts['is_dpu']. Updated tests_mark_conditions_platform_tests.yaml to skip reboot tests on SmartSwitches. Introduced a new marker file tests_mark_conditions_smartswitch.yaml to manage SmartSwitch-specific test conditions. Cleaned up redundant code and made logic consistent across reboot and techsupport tests. How did you verify/test it? Ran platform tests and verified that SmartSwitch-incompatible cases are skipped automatically. Validated dut_basic_facts returns correct values for is_smartswitch and is_dpu across multiple platforms. Confirmed test_reboot.py and test_techsupport.py logic correctly reflects the updated fact-based checks. Any platform specific information? Applies to SmartSwitch and DPU platforms only. Supported testbed topology if it's a new test case? Not applicable. No new test case introduced.
venu-nexthop
pushed a commit
to venu-nexthop/sonic-mgmt
that referenced
this pull request
Mar 27, 2026
* Refactor DPU check in device_utils and test_watchdog This changes is because is_dpu method was removed by below PR [smartswitch]: Add is_smartswitch and is_dpu facts to simplify platform-specific test handling (sonic-net#19313) * Fix the condition for dpu in techsupport test * Fix skip dpu logic in techsupport test --------- Co-authored-by: Cong Hou <congh@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
This PR adds
is_smartswitchandis_dpudevice facts to thedut_basic_factsmodule, enabling easier conditional test logic based on platform type. It removes redundant implementations of the same logic from theSonicHostclass and updates existing test logic to consume these new variables through the Ansible facts system. This change also introduces a newtests_mark_conditions_smartswitch.yamlmarker configuration file to skip SmartSwitch-incompatible tests declaratively.Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
Some tests such as
fast_rebootandwarm_rebootare not applicable on SmartSwitch platforms or require different handling on DPU nodes. This PR simplifies the detection of such platform roles using shared Ansible facts instead of scattered implementations. This approach makes test conditions easier to read, reuse, and maintain.How did you do it?
is_smartswitchandis_dpuflags to thedut_basic_factsmodule.is_smartswitch()andis_dpu()methods from theSonicHostclass.duthost.facts['is_smartswitch']andduthost.facts['is_dpu'].tests_mark_conditions_platform_tests.yamlto skip reboot tests on SmartSwitches.tests_mark_conditions_smartswitch.yamlto manage SmartSwitch-specific test conditions.How did you verify/test it?
dut_basic_factsreturns correct values foris_smartswitchandis_dpuacross multiple platforms.test_reboot.pyandtest_techsupport.pylogic correctly reflects the updated fact-based checks.Any platform specific information?
Applies to SmartSwitch and DPU platforms only.
Supported testbed topology if it's a new test case?
Not applicable. No new test case introduced.
Documentation
N/A