[spytest] feature: add functionality to retrieve console information #16249
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:
Added functionality to retrieve console information from testbed devices in spytest framework. This enables access to console details (IP, port, protocol) for test cases and debugging purposes.
Type of change
Approach
What is the motivation for this PR?
To provide easy access to device console information within spytest framework, which helps in debugging and monitoring test cases that require console access.
How did you do it?
get_console()
in framework.py to access testbed console infoget_console_info()
in infra.py as a utility functionget_console()
in testbed.py to retrieve console IP, port, and protocol from device infoHow did you verify/test it?
By running spytest with a testbed configuration that includes console information and verifying the returned console details match the configuration.
Sample testbed yaml file includes:
Console info retrieval from framework
Any platform specific information?
No, this is platform-independent and works with any device that has console information configured in the testbed.
Supported testbed topology if it's a new test case?
Not applicable as this is a framework improvement.
Documentation
This is a framework enhancement that adds new utility functions. No specific documentation updates required as the functions are self-documented through their interface.