Use paramiko for ssh connection in test_wr_arp#2037
Merged
wangxin merged 3 commits intosonic-net:masterfrom Aug 7, 2020
wangxin:fix-wr-arp-pr
Merged
Use paramiko for ssh connection in test_wr_arp#2037wangxin merged 3 commits intosonic-net:masterfrom wangxin:fix-wr-arp-pr
wangxin merged 3 commits intosonic-net:masterfrom
wangxin:fix-wr-arp-pr
Conversation
The test_wr_arp script put ssh key of ptfhost on dut to have password less ssh connection. Then the ptfhost can execute command remote on dut through this ssh connection. The problem is that the ssh key saved in ~/.ssh/authorized_keys on dut host may not persist after warm reboot. It would also be a problem when secure boot feature is introduced. This PR updated the test_wr_arp script to use paramiko for ssh connection and remote command execution between ptfhost and dut. Changes: * Update the ptf test script to use paramiko for SSH connection with dut * Disabled loganalyzer because test_wr_arp need to do warm-reboot on dut Signed-off-by: Xin Wang <[email protected]>
|
This pull request introduces 1 alert when merging 5e1cf6f into 9da74ca - view on LGTM.com new alerts:
|
bingwang-ms
reviewed
Aug 5, 2020
| stdout = so.readlines() | ||
| stderr = se.readlines() | ||
| self.log('executed command {}, stdout={}, stderr={}'.format(cmd, stdout, stderr)) | ||
| return_code = 0 |
Collaborator
There was a problem hiding this comment.
Can we get return code of exec_command? Is it possible to ignore some error if we always return 0 here?
Collaborator
Author
There was a problem hiding this comment.
The paramiko library uses pattern of sending cmd string and receiving returned results in streams. There is no return code returned by the exec_command method of the paramiko.SSHClient.
Collaborator
Author
There was a problem hiding this comment.
Sure, pushed a new commit.
|
This pull request introduces 2 alerts when merging 9db07ea into 4f02bb5 - view on LGTM.com new alerts:
|
Collaborator
Author
|
retest this please |
tahmed-dev
approved these changes
Aug 6, 2020
kazinator-arista
pushed a commit
to kazinator-arista/sonic-mgmt
that referenced
this pull request
Mar 4, 2026
sonic-swss 1aa40f7 Remove port serdes object before removing port (sonic-net#2152) 876d690 [doc] Updating Policer config in Configuration manual (sonic-net#2144) sonic-utilities dfed952 show_platfom_info not run for simx (sonic-net#2042) 71fdee7 [aclshow] fix aclshow when clear is called before counters are populated (sonic-net#2037) a48a027 [sonic-package-manager] implement blocking feature state change (sonic-net#2035) c51871d [ci] Fix python dependencies reference path. (sonic-net#2060)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Fixes # (issue)
The test_wr_arp.py test failed for two reasons:
Type of change
Approach
What is the motivation for this PR?
The test_wr_arp script put ssh key of ptfhost on dut to have password less
ssh connection. Then the ptfhost can execute command remote on dut
through this ssh connection. The problem is that the ssh key saved in
~/.ssh/authorized_keys on dut host may not persist after warm reboot.
It would also be a problem when secure boot feature is introduced. This
PR updated the test_wr_arp script to use paramiko for ssh connection
and remote command execution between ptfhost and dut.
How did you do it?
How did you verify/test it?
Test run the test_wr_arp.py script on latest 201911 image.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation