Skip to content

feat: Added option to run rshell server as module#44

Open
adrianlasota wants to merge 4 commits into
mainfrom
rshell-script
Open

feat: Added option to run rshell server as module#44
adrianlasota wants to merge 4 commits into
mainfrom
rshell-script

Conversation

@adrianlasota

Copy link
Copy Markdown
Contributor

This pull request refactors the RShell server to support Python module execution, improves startup reliability, and enhances test coverage. The main changes include moving the RShell server to a package for module execution, updating the startup logic to use python -m, adding new tests to cover the updated logic, and improving documentation.

RShell Server Packaging and Startup Improvements:

  • The RShell server has been moved into a package (mfd_connect/rshell_server/) to allow starting it with python -m mfd_connect.rshell_server, and the startup logic in rshell.py was updated to use this approach for improved reliability and cross-platform compatibility. [1] [2] [3] [4] [5]

Testing Enhancements:

  • Comprehensive unit tests were added and updated to cover the new server startup logic, including tests for successful startup, timeout handling, and error conditions when the server fails to start. [1] [2]
  • New tests were added to verify the existence and correctness of the rshell_server package structure and its entry points, ensuring that the package can be imported and executed as a module.

Timeout and Reliability Adjustments:

  • The timeout for the EFI shell check command was increased from 10 to 20 seconds to improve reliability on slow systems, and this behavior is now explicitly tested. [1] [2]

Documentation Updates:

  • The README.md was updated to document the new way to manually start the RShell server using the module execution command.
  • Added docstrings and copyright/license headers to new and updated files. [1] [2] [3]

Test Infrastructure Maintenance:

  • Test scripts were updated to reflect the new package structure, ensuring dynamic imports and path references work correctly with the refactored server code. [1] [2]

These changes modernize the RShell server's deployment, improve testability, and enhance reliability across platforms.

@mfd-intel-bot

Copy link
Copy Markdown
Contributor

We don't publish DEVs .whl.
To build .whl, run 'pip install git+https://github.com/intel/mfd-connect@rshell-script'

@coveralls-official

coveralls-official Bot commented Jul 10, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 79.925% (+0.06%) from 79.864% — rshell-script into main

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the RShell server into an importable/executable package so it can be launched via python -m mfd_connect.rshell_server, and updates RShell’s startup/check logic plus unit tests/docs to match.

Changes:

  • Moved RShell server into mfd_connect/rshell_server/ with __main__.py support and a run() entrypoint.
  • Updated RShellConnection._run_server() to start via module execution and added tests around startup behavior and error paths.
  • Increased EFI shell detection timeout to 20 seconds and added a unit test asserting the new timeout.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/test_mfd_connect/test_rshell.py Adds/updates unit tests for module-based server startup and EFI timeout behavior.
tests/unit/test_mfd_connect/test_rshell_server.py Updates server script path loading and adds a test for the new run() entrypoint.
tests/unit/test_mfd_connect/test_rshell_server_module.py New tests validating rshell_server package structure and module execution wiring.
README.md Documents manual server start via python -m mfd_connect.rshell_server.
mfd_connect/rshell.py Switches server startup to python -m ... and increases EFI shell check timeout.
mfd_connect/rshell_server/rshell_server.py Introduces run() and routes __main__ execution through it.
mfd_connect/rshell_server/main.py Package entrypoint for python -m mfd_connect.rshell_server.
mfd_connect/rshell_server/init.py Initializes the new package with module docstring/header.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mfd_connect/rshell.py
Comment thread mfd_connect/rshell.py Outdated
Comment thread mfd_connect/rshell.py Outdated
Added logging of fail start of rshell server
Changed timeout for check if efi shell

Signed-off-by: Lasota, Adrian <adrian.lasota@intel.com>
Signed-off-by: Lasota, Adrian <adrian.lasota@intel.com>
Comment thread mfd_connect/util/process_utils.py Dismissed
Comment thread mfd_connect/util/process_utils.py Dismissed
Comment thread mfd_connect/util/process_utils.py Dismissed
Signed-off-by: Lasota, Adrian <adrian.lasota@intel.com>
Comment thread mfd_connect/rshell.py Fixed
Signed-off-by: Lasota, Adrian <adrian.lasota@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants