[framework] Add DUT connection by console port#2204
[framework] Add DUT connection by console port#2204bingwang-ms merged 5 commits intosonic-net:masterfrom
Conversation
eed9eab to
373675e
Compare
|
This pull request introduces 7 alerts when merging 373675e19b9011dca73c87308234ac9c429f5189 into 647b57e - view on LGTM.com new alerts:
|
There was a problem hiding this comment.
How do we handle console connections that require Active Directory password. This is the case for most of the new DUTs (for eg. DX10s) that are onboarded and some Fanout switches. I think we will not want to have AD creds in secrets vars file.
There was a problem hiding this comment.
Great question. The auth method used in Lab highly depends on Microsoft AD. Perhaps we could try to add a public account for test.
There was a problem hiding this comment.
This method seems to be returning return_msg
There was a problem hiding this comment.
Thanks. I missed it. I will post an update to fix it.
There was a problem hiding this comment.
This condition is repeating in the line 74. Is there a reason to check twice?
There was a problem hiding this comment.
Good catch. The check in ln68-71 is not necessary. But the check in ln74-77 must be kept to handle the case when password is not required to login.
tests/conftest.py
Outdated
There was a problem hiding this comment.
This assumes that all the console servers use the same username/password?
There was a problem hiding this comment.
Good catch. I need to come up with a better method to manage account info for various console server.
|
most of the part looks good to me. maybe we can get it merged first and then iterate? |
Thanks. Now I'm waiting for this PR #2257 (Pdu and Console connection info in connection graph), which puts console meta data in connection graph. Currently, I put them in inventory file. But it shouldn't be too much work. |
As we all know, Ansible run commands via SSH connection from mgmt port. However, the connection is not stable or not usable for some scenes, like vrf test, reboot test and etc. Therefore, we need a more robust way to connect and run command on DUT (or other hosts). This commit add enables framework to connect DUT by console port.
78c597d to
dff6cb1
Compare
1. Support alt password for console and SNOiC 2. Support new console server 'menu_ports' Signed-off-by: bingwang <bingwang@microsoft.com>
0859016 to
d401bdc
Compare
|
@yxieca @vaibhavhd @wangxin Sorry for the late update. Please help to review again.
Please note that the current code reads console information from inventory file and reads creds from secret file. The next step is to put console information into connect_graph_facts. I will work with @sujinmkang to complete PR #2257 |
|
This pull request introduces 1 alert when merging ba7cdb5 into 20d729d - view on LGTM.com new alerts:
|
Signed-off-by: bingwang <bingwang@microsoft.com>
…ance submodule head (sonic-net#14029) utilities: * a4f141f1 2023-01-10 | [sfputil] Firmware download/upgrade CLI support for QSFP-DD (sonic-net#1947) (sonic-net#2349) (HEAD -> 202205) [CliveNi] swss-common: * 41fcad8 2023-01-30 | Increase the netlink buffer size from 3MB to 16MB. (sonic-net#739) (HEAD -> 202205) [KISHORE KUNAL] sairedis: * 5ce9990 2023-02-27 | [Dual-ToR] update sai.profile with SAI_ADDITIONAL_MAC_ENABLED attribute if corresponding arg passed to syncd (sonic-net#1201) (HEAD -> 202205) [Andriy Yurkiv] * 3c2e0c5 2023-02-23 | Use new value of STATE_DB FAST_REBOOT entry (sonic-net#1196) [Aryeh Feigin] * fe7756f 2023-02-28 | [submodule][SAI]Advance SAI head (sonic-net#1210) (github/202205) [Richard.Yu] platform-common: * 321a8e7 2022-09-23 | Cdb fw upgrade (sonic-net#308) (HEAD -> 202205) [CliveNi] swss: * ceea558 2023-02-28 | [orchagent]: Get bridge port ID from orchagent cache instead of SAI API (sonic-net#2657) (HEAD -> 202205) [Lawrence Lee] * bd04e24 2023-03-01 | [dualtor] Fix neighbor miss when mux is not ready (sonic-net#2676) (HEAD -> 202205) [Longxiang Lyu] * 7d87a90 2023-02-28 | [ci] Fix pipeline error about team5 not found. (sonic-net#2684) [Liu Shilong] * 93a924c 2023-02-27 | [aclorch] Fixed issue sonic-net#2204.Support IN_PORTS qualifer in MIRRORV6 table. (sonic-net#2668) [Rajkumar-Marvell] * 9d87ec4 2023-02-23 | swss: Fix Invalid port oid messages generated because of voq counters. (sonic-net#2653) [Sambath Kumar Balasubramanian] Signed-off-by: Ying Xie <ying.xie@microsoft.com>
swss: * 143cd44 2023-03-04 | Revert "[aclorch] Fixed issue sonic-net#2204.Support IN_PORTS qualifer in MIRRORV6 table. (sonic-net#2668)" (sonic-net#2687) (HEAD -> 202205, github/202205) [StormLiangMS] * 25812f8 2023-02-06 | [test_mux] add sleep in test_NH (sonic-net#2648) [Nikola Dancejic] Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Description of PR
Summary:
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
As we all know, Ansible run commands via SSH connection from mgmt port. However, the connection is not stable or not usable for some scenes, like vrf test, reboot test and etc. Therefore, we need a more robust way to connect and run command on DUT. This commit add enables framework to connect DUT by console port.
How did you do it?
Cueerntly, two types of console connection in star lab are supported, that is console on Digi (digi_console) and console servers using telnet. Some interfaces are needed to be overwriten if more console types are to support.
and console username and password are managed by Ansible secret vars.
3. Add a new fixture duthost_console for establishing connection to DUT by console port.
4. All public interfaces are inherited from netmiko. But only send_command is tested for now.
https://ktbyers.github.io/netmiko/docs/netmiko/index.html#netmiko.BaseConnection.send_command
How did you verify/test it?
I write a demo script to verify it
Any platform specific information?
No.
Supported testbed topology if it's a new test case?
N/A.
Documentation
Please refer to Netmiko doc
https://ktbyers.github.io/netmiko/docs/netmiko/index.html