Add "-d 1" option to the ncat client.
In nc run as client, when it is provided by the nmap (nmap-ncat package in Centos/RHEL for example) it could happend that client which was started with input string given through pipe (echo "test" | nc ... ) was closed sooner than it received response from the nc server. In such case nc client was finished without error (exit code 0) but also without printing any message from server and that causes tests failures. To avoid that there is option "-d 1" (--delay) added. According to the nc man page [1] this option can be used to configure "Wait between read/writes". [1] https://man7.org/linux/man-pages/man1/ncat.1.html Change-Id: Id49654aa5ca59eeb0585646d3fd5aa0de22337b5
This commit is contained in:
parent
da45177a2f
commit
fddcd186a4
|
@ -76,9 +76,11 @@ def get_ncat_server_cmd(port, protocol, msg=None):
|
|||
|
||||
def get_ncat_client_cmd(ip_address, port, protocol, ssh_client=None):
|
||||
cmd = 'echo "knock knock" | nc '
|
||||
ncat_version = get_ncat_version(ssh_client=ssh_client)
|
||||
if ncat_version > packaging_version.Version('7.60'):
|
||||
cmd += '-d 1 '
|
||||
if protocol.lower() == neutron_lib_constants.PROTO_NAME_UDP:
|
||||
cmd += '-u '
|
||||
ncat_version = get_ncat_version(ssh_client=ssh_client)
|
||||
if ncat_version > packaging_version.Version('7.60'):
|
||||
cmd += '-z '
|
||||
cmd += '-w 1 %(host)s %(port)s' % {'host': ip_address, 'port': port}
|
||||
|
|
Loading…
Reference in New Issue