Skip to content

[plugins/connection/switch] Use timeout from args rather than hard coded value#838

Merged
lguohan merged 2 commits intosonic-net:masterfrom
wangxin:connection-switch-pr
Mar 22, 2019
Merged

[plugins/connection/switch] Use timeout from args rather than hard coded value#838
lguohan merged 2 commits intosonic-net:masterfrom
wangxin:connection-switch-pr

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Mar 22, 2019

Description of PR

Summary:
Fixes # (issue)

The connection plugin 'switch' uses hard coded timeout value 60s for
establishing SSH connection to target. After connection is spawned, then
the timeout value for matching expected output is set to value passed in
from keyword arguments.

In practice, sometimes the hard coded 60s timeout is not enough for
establishing SSH connection to targets. This improvement is to use value
passed in from keyword arguments for connection timeout. Since the
pexpect lib uses the same timeout value for establishing SSH connection
and matching expected output, there is no need to set timeout for
spawned connection in later code.

With this change, we can pass in a longer timeout value from arguments
when necessary.

Type of change

  • Bug fix
  • [] Testbed and Framework(new/improvement)
  • [] Test case(new/improvement)

Approach

How did you do it?

Replace hard coded timeout values with value passed in from arguments. When no timeout argument is passed in, use default 60s.

How did you verify/test it?

Tested on Mellanox platform.

Any platform specific information?

No.

Supported testbed topology if it's a new test case?

Documentation

Xin Wang added 2 commits March 22, 2019 16:29
The connection plugin 'switch' uses hard coded timeout value 60s for
establishing SSH connection to target. After connection is spawned, then
the timeout value for matching expected output is set to value passed in
from keyword arguments.

In practice, sometimes the hard coded 60s timeout is not enough for
establishing SSH connection to targets. This improvement is to use value
passed in from keyword arguments for connection timeout. Since the
pexpect lib uses the same timeout value for establishing SSH connection
and matching expected output, there is no need to set timeout for
spawned connection in later code.

Signed-off-by: Xin Wang <xinw@mellanox.com>
* Replace hard coded SSH ConnectionTimeout with value from args too

Signed-off-by: Xin Wang <xinw@mellanox.com>
Copy link
Contributor

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@lguohan lguohan merged commit 3d158dc into sonic-net:master Mar 22, 2019
@wangxin wangxin deleted the connection-switch-pr branch May 24, 2019 03:33
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
 [201911][thermal control] Backport changes from master branch (sonic-net#929)
     [201911][config] Support abbreviation (sonic-net#933)
       Add 'hw-management-generate-dump.sh' to 'show techsupport'
       command (sonic-net#934)
       [fwutil]: Update fwutil to v2.0.0.0. (sonic-net#942)
       Fixes bug for PFCWD feature parameters (sonic-net#838)
     Fixed fast-reboot for BFN platform (sonic-net#871)
     [config] Add 'interface transceiver' subgroup with 'lpmode' and
     'reset' subcommands (sonic-net#904)
      [warm-reboot]: added pre-check for ISSU file (sonic-net#915)
       [config] Don't attempt to restart disabled services (sonic-net#944)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants