Force the kill of the "nc" process only if timeout

If the file is received correctly, the "nc" process in the remote
machine will end gracefully. Only in case of socket timeout, will force
the completion of the process before returning.

Change-Id: I6cec868daa0139f6a49807883f901d2eac84fe14
Related-Bug: #1838068
This commit is contained in:
Rodolfo Alonso Hernandez 2019-08-02 13:42:18 +00:00
parent fa5ebc4b98
commit 31993d50fd
1 changed files with 1 additions and 1 deletions

View File

@ -130,10 +130,10 @@ class QoSTestMixin(object):
except socket.timeout: except socket.timeout:
LOG.warning('Socket timeout while reading the remote file, bytes ' LOG.warning('Socket timeout while reading the remote file, bytes '
'read: %s', total_bytes_read) 'read: %s', total_bytes_read)
self._kill_nc_process(ssh_client)
return False return False
finally: finally:
client_socket.close() client_socket.close()
self._kill_nc_process(ssh_client)
def _create_ssh_client(self): def _create_ssh_client(self):
return ssh.Client(self.fip['floating_ip_address'], return ssh.Client(self.fip['floating_ip_address'],