-
Notifications
You must be signed in to change notification settings - Fork 759
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
[TestbedV2]Add a script to get duts version. #8290
[TestbedV2]Add a script to get duts version. #8290
Conversation
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.
LGTM
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.
LGTM
.azure-pipelines/get_dut_version.py
Outdated
def get_duts_version(sonichosts): | ||
try: | ||
ret = {} | ||
duts_version = sonichosts.command("show version", module_attrs={"become": 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.
show version
does not need sudo
priviledge.
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.
removed
Description of PR In TestbedV2, we need a script to get duts version for futher process. So, we add this script using new sonichost, and this script will return a list contains the output of show version command. What is the motivation for this PR? In TestbedV2, we need a script to get duts version for futher process. So, we add this script using new sonichost, and this script will return a list contains the output of show version command. How did you verify/test it? ``` yutongzhang@89d3967bee2a:/data/sonic-mgmt/tests$ python ../.azure-pipelines/get_dut_version.py -i veos_vtb -t vms-kvm-t0 --tbfile vtestbed.yaml --log-level info /usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release. from cryptography.exceptions import InvalidSignature 2023-05-12 05:55:59,156 get_dut_version.py#53 INFO - Initializing hosts Friday 12 May 2023 05:55:59 +0000 (0:00:00.048) 0:00:00.048 ************ {u'vlab-01': [u'', u'SONiC Software Version: SONiC.master.217155-43683d8ce', u'Distribution: Debian 11.6', u'Kernel: 5.10.0-18-2-amd64', u'Build commit: 43683d8ce', u'Build date: Sun Feb 12 12:36:40 UTC 2023', u'Built by: AzDevOps@vmss-soni000H4X', u'', u'Platform: x86_64-kvm_x86_64-r0', u'HwSKU: Force10-S6000', u'ASIC: vs', u'ASIC Count: 1', u'Serial Number: N/A', u'Model Number: N/A', u'Hardware Revision: N/A', u'Uptime: 05:55:59 up 2:58, 0 users, load average: 0.19, 0.09, 0.06', u'Date: Fri 12 May 2023 05:55:59', u'', u'Docker images:', u'REPOSITORY TAG IMAGE ID SIZE', u'docker-orchagent latest fab81f7965ca 385MB', u'docker-orchagent master.217155-43683d8ce fab81f7965ca 385MB', u'docker-dhcp-relay latest 798c1d8e105e 366MB', u'docker-fpm-frr latest b90063fc114e 403MB', u'docker-fpm-frr master.217155-43683d8ce b90063fc114e 403MB', u'docker-macsec latest a5d96f600dde 376MB', u'docker-eventd latest b078e56f320c 357MB', u'docker-eventd master.217155-43683d8ce b078e56f320c 357MB', u'docker-teamd latest 48c07e3fb87b 374MB', u'docker-teamd master.217155-43683d8ce 48c07e3fb87b 374MB', u'docker-snmp latest 89d581a798c9 397MB', u'docker-snmp master.217155-43683d8ce 89d581a798c9 397MB', u'docker-platform-monitor latest 59d1ec13726a 479MB', u'docker-platform-monitor master.217155-43683d8ce 59d1ec13726a 479MB', u'docker-gbsyncd-vs latest b16d861d199a 367MB', u'docker-gbsyncd-vs master.217155-43683d8ce b16d861d199a 367MB', u'docker-sonic-telemetry latest 28213beda767 655MB', u'docker-sonic-telemetry master.217155-43683d8ce 28213beda767 655MB', u'docker-sonic-p4rt latest 49c358ff0d13 927MB', u'docker-sonic-p4rt master.217155-43683d8ce 49c358ff0d13 927MB', u'docker-mux latest 14a8564a6e4e 405MB', u'docker-mux master.217155-43683d8ce 14a8564a6e4e 405MB', u'docker-lldp latest 6e2eff7f72fb 399MB', u'docker-lldp master.217155-43683d8ce 6e2eff7f72fb 399MB', u'docker-database latest 62cfbd21d70a 357MB', u'docker-database master.217155-43683d8ce 62cfbd21d70a 357MB', u'docker-router-advertiser latest a95354dff017 357MB', u'docker-router-advertiser master.217155-43683d8ce a95354dff017 357MB', u'docker-nat latest 13fbcda3340f 351MB', u'docker-nat master.217155-43683d8ce 13fbcda3340f 351MB', u'docker-sflow latest a3c41fe14a6b 349MB', u'docker-sflow master.217155-43683d8ce a3c41fe14a6b 349MB', u'docker-sonic-mgmt-framework latest b7065fdb0839 477MB', u'docker-sonic-mgmt-framework master.217155-43683d8ce b7065fdb0839 477MB', u'docker-syncd-vs latest 34101b26e558 346MB', u'docker-syncd-vs master.217155-43683d8ce 34101b26e558 346MB']} ``` Signed-off-by: Yutong Zhang <[email protected]>
Description of PR In TestbedV2, we need a script to get duts version for futher process. So, we add this script using new sonichost, and this script will return a list contains the output of show version command. What is the motivation for this PR? In TestbedV2, we need a script to get duts version for futher process. So, we add this script using new sonichost, and this script will return a list contains the output of show version command. How did you verify/test it? ``` yutongzhang@89d3967bee2a:/data/sonic-mgmt/tests$ python ../.azure-pipelines/get_dut_version.py -i veos_vtb -t vms-kvm-t0 --tbfile vtestbed.yaml --log-level info /usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release. from cryptography.exceptions import InvalidSignature 2023-05-12 05:55:59,156 get_dut_version.py#53 INFO - Initializing hosts Friday 12 May 2023 05:55:59 +0000 (0:00:00.048) 0:00:00.048 ************ {u'vlab-01': [u'', u'SONiC Software Version: SONiC.master.217155-43683d8ce', u'Distribution: Debian 11.6', u'Kernel: 5.10.0-18-2-amd64', u'Build commit: 43683d8ce', u'Build date: Sun Feb 12 12:36:40 UTC 2023', u'Built by: AzDevOps@vmss-soni000H4X', u'', u'Platform: x86_64-kvm_x86_64-r0', u'HwSKU: Force10-S6000', u'ASIC: vs', u'ASIC Count: 1', u'Serial Number: N/A', u'Model Number: N/A', u'Hardware Revision: N/A', u'Uptime: 05:55:59 up 2:58, 0 users, load average: 0.19, 0.09, 0.06', u'Date: Fri 12 May 2023 05:55:59', u'', u'Docker images:', u'REPOSITORY TAG IMAGE ID SIZE', u'docker-orchagent latest fab81f7965ca 385MB', u'docker-orchagent master.217155-43683d8ce fab81f7965ca 385MB', u'docker-dhcp-relay latest 798c1d8e105e 366MB', u'docker-fpm-frr latest b90063fc114e 403MB', u'docker-fpm-frr master.217155-43683d8ce b90063fc114e 403MB', u'docker-macsec latest a5d96f600dde 376MB', u'docker-eventd latest b078e56f320c 357MB', u'docker-eventd master.217155-43683d8ce b078e56f320c 357MB', u'docker-teamd latest 48c07e3fb87b 374MB', u'docker-teamd master.217155-43683d8ce 48c07e3fb87b 374MB', u'docker-snmp latest 89d581a798c9 397MB', u'docker-snmp master.217155-43683d8ce 89d581a798c9 397MB', u'docker-platform-monitor latest 59d1ec13726a 479MB', u'docker-platform-monitor master.217155-43683d8ce 59d1ec13726a 479MB', u'docker-gbsyncd-vs latest b16d861d199a 367MB', u'docker-gbsyncd-vs master.217155-43683d8ce b16d861d199a 367MB', u'docker-sonic-telemetry latest 28213beda767 655MB', u'docker-sonic-telemetry master.217155-43683d8ce 28213beda767 655MB', u'docker-sonic-p4rt latest 49c358ff0d13 927MB', u'docker-sonic-p4rt master.217155-43683d8ce 49c358ff0d13 927MB', u'docker-mux latest 14a8564a6e4e 405MB', u'docker-mux master.217155-43683d8ce 14a8564a6e4e 405MB', u'docker-lldp latest 6e2eff7f72fb 399MB', u'docker-lldp master.217155-43683d8ce 6e2eff7f72fb 399MB', u'docker-database latest 62cfbd21d70a 357MB', u'docker-database master.217155-43683d8ce 62cfbd21d70a 357MB', u'docker-router-advertiser latest a95354dff017 357MB', u'docker-router-advertiser master.217155-43683d8ce a95354dff017 357MB', u'docker-nat latest 13fbcda3340f 351MB', u'docker-nat master.217155-43683d8ce 13fbcda3340f 351MB', u'docker-sflow latest a3c41fe14a6b 349MB', u'docker-sflow master.217155-43683d8ce a3c41fe14a6b 349MB', u'docker-sonic-mgmt-framework latest b7065fdb0839 477MB', u'docker-sonic-mgmt-framework master.217155-43683d8ce b7065fdb0839 477MB', u'docker-syncd-vs latest 34101b26e558 346MB', u'docker-syncd-vs master.217155-43683d8ce 34101b26e558 346MB']} ``` Signed-off-by: Yutong Zhang <[email protected]>
Description of PR
In TestbedV2, we need a script to get duts version for futher process. So, we add this script using new
sonichost
, and this script will return a list contains the output ofshow version
command.Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
In TestbedV2, we need a script to get duts version for futher process. So, we add this script using new
sonichost
, and this script will return a list contains the output ofshow version
command.How did you do it?
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation