neutron-tempest-plugin/neutron_tempest_plugin/common
Federico Ressi 6f0644e271 Reuse SSH connections for executing multiple commands.
When using SSH client to execute a command a Paramiko
client is created, it is connected to server and then the
client reference is forgot without closing socket.

This produces a leak of SSH connections. It also slow
down test executions when more than one command has to
be executed with the same SSH client (for example when
executing ping between VMs).

This change also add convenience methods to SSH client:

- connect() method allows to create and connect Paramiko
  client to be used by tests directly (for exaple to open
  a command like socat, cat, nc and redirect STDIN/STDOUT
  to generate or receive network traffic. The method is
  going to return the same Paramiko client instance
  until close() method is called.

- close() method allows to close paramiko client socket and
  release resources.

- execute_script() spawn a script interpreter (Bash by default) on
  a remote machinge to execute a script provided as a string.
  For convenience by default it combines STDOUT and STDERR to LOG
  an human friendly message when the script fails.

Change-Id: I3a70131f03aea342c8e8a04038000bd974cca921
2018-08-27 15:27:07 +00:00
..
__init__.py Refactored Neutron tempest plugin directory structure 2017-11-13 09:19:11 +05:30
constants.py use EGRESS_DIRECTION and INGRESS_DIRECTION from neutron-lib 2018-02-13 12:48:58 -07:00
socat.py Add test tools for executing socat on guest images. 2018-08-16 06:11:54 +00:00
ssh.py Reuse SSH connections for executing multiple commands. 2018-08-27 15:27:07 +00:00
tempest_fixtures.py Refactored Neutron tempest plugin directory structure 2017-11-13 09:19:11 +05:30
utils.py Fix some pep8 errors, update tox.ini 2018-05-02 11:51:17 -04:00