Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spytest] feature: add functionality to retrieve console information #16249

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gupurush
Copy link

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

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

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?

  • Added new method get_console() in framework.py to access testbed console info
  • Implemented get_console_info() in infra.py as a utility function
  • Added get_console() in testbed.py to retrieve console IP, port, and protocol from device info

How 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:

devices:
    SD1:
        device_type: DevSonic
        console: {protocol: telnet, ip: x.x.x.x, port: y}
        access: {protocol: ssh, ip: xx.xx.xx.xx, port: yy}

Console info retrieval from framework

vars = st.ensure_min_topology("D1")
console_info = st.get_console_info(vars.D1)
console_protocol = console_info.protocol
console_ip = console_info.ip
console_port = console_info.port

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.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

2 participants