Don't use "Zero-I/O mode" in nc client in the TCP mode
It seems that using "Zero-I/O mode" ("-z" option) in nc client is
necessary for the UDP tests but it is causing failures when it runs it TCP
mode.
Closes: rhbz#2211094
Change-Id: I7d313a7afc60825885854eaa6de858b1f53e5e46
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index d972953..e07294f 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -75,15 +75,13 @@
def get_ncat_client_cmd(ip_address, port, protocol, ssh_client=None):
- udp = ''
- if protocol.lower() == neutron_lib_constants.PROTO_NAME_UDP:
- udp = '-u'
cmd = 'echo "knock knock" | nc '
- ncat_version = get_ncat_version(ssh_client=ssh_client)
- if ncat_version > packaging_version.Version('7.60'):
- cmd += '-z '
- cmd += '-w 1 %(udp)s %(host)s %(port)s' % {
- 'udp': udp, 'host': ip_address, 'port': port}
+ 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}
return cmd