-
Notifications
You must be signed in to change notification settings - Fork 658
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
[dpu_tty]: Add a DPU TTY console utility #3535
Conversation
* Add dpu_tty.py * Add dpu_tty.py to scripts Signed-off-by: Wenchung Wang vincwang@cisco.com What I did Add DPU TTY console utility. How I did it * Read platform.json to retrieve TTY settings in DPUS section. Set up TTY console according to TTY device name and baud rate. * Also provide options to overwrite default TTY device and baud rate. ''' "DPUS": { "dpu0": { "serial-console": { "device": "ttyS4", "baud-rate": "115200" } }, "dpu1": { "serial-console": { "device": "ttyS5", "baud-rate": "115200" } } }, ''' How to verify it Run the utility on a smart switch that provides DPU UART console via ttyS device. The test plan is at https://github.com/sonic-net/sonic-mgmt/pull/12701/files section 1.4.
setup.py
Outdated
@@ -120,6 +120,7 @@ | |||
'scripts/decode-syseeprom', | |||
'scripts/dropcheck', | |||
'scripts/disk_check.py', | |||
'scripts/dpu_tty.py', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please rename the application to dpu-tty
? To make the user experience more convenient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
scripts/dpu_tty.py
Outdated
def main(): | ||
|
||
parser = argparse.ArgumentParser(description='DPU TTY Console Utility') | ||
parser.add_argument('-s', '--slot', type=int, required=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the slot used instead of the DPU name?
I suggest using the DPU name (dpu0, dpu1, dpuX) in all places to refer to the DPU. This will remove any future confusion.
parser.add_argument('-n', '--name', type=str, required=True)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented. Please also cover the application with the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wenchungw could you update this document to explain the new CLI being proposed?
https://github.com/sonic-net/sonic-utilities/blob/master/doc/Command-Reference.md
Please add a new section "Console"
Add DPU serial console utility.
Added. |
Added a test log. |
@oleksandrivantsiv please review/approve |
Signed-off-by: Wenchung Wang vincwang@cisco.com
What I did
Add DPU TTY console utility.
How I did it
How to verify it
Run the utility on a smart switch that provides DPU UART console via ttyS device. The test plan is at
https://github.com/sonic-net/sonic-mgmt/pull/12701/files section 1.4.
The utility works only on smart switch that provides DPU serial console connections through TTY /dev/ttyS* devices, for example Mt Fuji. Here is a test log.
Previous command output (if the output of a command-line utility has changed)
N/A
New command output (if the output of a command-line utility has changed)
N/A