test jack detection if is dsp d3 status - fix skip#1334
test jack detection if is dsp d3 status - fix skip#1334arikgreen merged 1 commit intothesofproject:mainfrom
Conversation
Fixed test skipping bug on non SDW platforms, if the usbrelay module is not installed. Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
55c3fb9 to
f77e83c
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes a test skipping bug on non-SDW platforms when the usbrelay module is not installed. The changes improve the error handling logic to ensure the test properly skips when required dependencies are missing.
Key changes:
- Refactored command existence checks and execution validation to use more concise error handling patterns
- Ensured proper test skipping behavior when usbrelay is unavailable
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| dlogi "Checking usbrelay availability..." | ||
| if ! command -v usbrelay > /dev/null; then | ||
| command -v usbrelay || { |
There was a problem hiding this comment.
The command -v usbrelay check will output to stdout when the command exists, which may clutter logs. The original code redirected this output to /dev/null. Consider adding > /dev/null to maintain clean output: command -v usbrelay > /dev/null || {
| command -v usbrelay || { | |
| command -v usbrelay > /dev/null || { |
|
|
||
| if ! usbrelay_switch --debug > /dev/null; then | ||
| } | ||
| usbrelay_switch --debug || { |
There was a problem hiding this comment.
The usbrelay_switch --debug command will output debug information to stdout/stderr when it succeeds, which may clutter logs. The original code redirected this output to /dev/null. Consider adding > /dev/null to maintain clean output: usbrelay_switch --debug > /dev/null || {
| usbrelay_switch --debug || { | |
| usbrelay_switch --debug > /dev/null || { |
redzynix
left a comment
There was a problem hiding this comment.
Thanks Artur, this fix works as intended
Fixed test skipping bug on non SDW platforms, if the usbrelay module is not installed.