[action] [PR:604] [Smartswitch] Host container differentiation for sensor commands#111
Merged
prabhataravind merged 1 commit intoAzure:202506from Nov 4, 2025
Merged
Conversation
<!-- Provide a general summary of your changes in the Title above -->
#### Description
<!--
Describe your changes in detail
-->
Differentiate commands being executed in host and container seperately for some smartswitch specific functions,
sensord commands can only be executed inside hte pmon docker container, so these commands need to differentiate between host and container execution
#### Motivation and Context
<!--
Why is this change required? What problem does it solve?
If this pull request closes/resolves an open Issue, make sure you
include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here
-->
This is done because these functions are called from inside the pmon docker during chassis command execution and from the host directly during reboot command execution
#### How Has This Been Tested?
<!--
Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc.
-->
```
tests/module_base_test.py::TestModuleBase::test_module_base PASSED [ 2%]
tests/module_base_test.py::TestModuleBase::test_is_container_detection PASSED [ 2%]
tests/module_base_test.py::TestModuleBase::test_sensors PASSED [ 2%]
tests/module_base_test.py::TestModuleBase::test_pci_entry_state_db PASSED [ 2%]
tests/module_base_test.py::TestModuleBase::test_file_operation_lock PASSED [ 2%]
tests/module_base_test.py::TestModuleBase::test_pci_operation_lock PASSED [ 2%]
tests/module_base_test.py::TestModuleBase::test_sensord_operation_lock PASSED [ 3%]
tests/module_base_test.py::TestModuleBase::test_handle_pci_removal PASSED [ 3%]
tests/module_base_test.py::TestModuleBase::test_handle_pci_rescan PASSED [ 3%]
tests/module_base_test.py::TestModuleBase::test_handle_sensor_removal PASSED [ 3%]
tests/module_base_test.py::TestModuleBase::test_handle_sensor_addition PASSED [ 3%]
tests/module_base_test.py::TestModuleBase::test_module_pre_shutdown PASSED [ 3%]
tests/module_base_test.py::TestModuleBase::test_module_post_startup PASSED [ 3%]
```
Manual test with:
`reboot -d DPU0`
and `config chassis modules startup DPU0`
#### Additional Information (Optional)
Collaborator
Author
|
Original PR: sonic-net/sonic-platform-common#604 |
Collaborator
Author
|
/azp run |
prabhataravind
approved these changes
Nov 4, 2025
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
Differentiate commands being executed in host and container seperately for some smartswitch specific functions,
sensord commands can only be executed inside hte pmon docker container, so these commands need to differentiate between host and container execution
Motivation and Context
This is done because these functions are called from inside the pmon docker during chassis command execution and from the host directly during reboot command execution
How Has This Been Tested?
Manual test with:
reboot -d DPU0and
config chassis modules startup DPU0Additional Information (Optional)