[ptf] Support alt_password for PTF to DUT SSH connection#2662
Merged
vaibhavhd merged 2 commits intosonic-net:masterfrom Dec 21, 2020
Merged
[ptf] Support alt_password for PTF to DUT SSH connection#2662vaibhavhd merged 2 commits intosonic-net:masterfrom
vaibhavhd merged 2 commits intosonic-net:masterfrom
Conversation
lolyu
approved these changes
Dec 20, 2020
kazinator-arista
pushed a commit
to kazinator-arista/sonic-mgmt
that referenced
this pull request
Mar 4, 2026
…onic-net#14169) swss: * 2447754 2023-02-23 | Do not allow to add port to .1Q bridge while router port deletion is not completed (sonic-net#2669) (HEAD -> 202205) [Lior Avramov] * 641c65c 2023-03-07 | [bfdorch] add default TOS value for BFD session (sonic-net#2689) (HEAD -> 202205) [Baorong Liu] * 95d3f6d 2023-03-08 | [ACL] Write ACL table/rule creation status into STATE_DB (sonic-net#2662) [bingwang-ms] swss-common: * 1fdeb9e 2023-03-03 | Define ACL_TABLE and ACL_RULE table in STATE_DB (sonic-net#748) (HEAD -> 202205, github/202205) [bingwang-ms] platform-common: * c441bd7 2023-03-07 | [sonic_ssd] Nokia-7215: Fix "show platform ssdhealth" (sonic-net#337) (HEAD -> 202205) [Pavan-Nokia] Signed-off-by: Ying Xie <ying.xie@microsoft.com>
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: In reboot/upgrades, the PTF's SSH key stored inside DUT gets deleted. Use a retry mechanism (
alt_password) when default admin password does not work.Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
For tests running on PTF container, alt password is not supported.
Use case - To enable alt_password for the tests running in PTF where there is a reboot/upgrade leading to deletion of SSH key and known hosts file inside DUT.
Note that the tests running on sonic-mgmt container have SSH retry support for device password and alt_password.
The error seen when key is deleted and default password does not work:
How did you do it?
Added retry mechanism when
AuthenticationExceptionis hit when trying the default password.Fixed the exception catch sequence leading to auth errors being caught by
SSHException.Fixed an import error and typo.
How did you verify/test it?
Tested with the fix:
From paramiko log, the 2nd attempt at login with alt_password is successful
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation