[Stateless SG] Add test to check connectivity between vms
This patch adds new test (for both stateful and stateless type of
security groups) which creates: 2 VMs connected to 2 different networks
and using 2 different SGs. Both networks connected to the same router.
Finally it checks TCP connectivity between VMs.
In case of stateless SG additional security group rule needs to be added
to allow ingress traffic on the ephemeral ports' range.
Change-Id: Icf318d8e7a76286ee2c2b8626d80e554aa5289f6
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index eb03c93..4d769dc 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -630,13 +630,14 @@
self._log_local_network_status()
raise
- def nc_client(self, ip_address, port, protocol):
+ def nc_client(self, ip_address, port, protocol, ssh_client=None):
"""Check connectivity to TCP/UDP port at host via nc.
- Client is always executed locally on host where tests are executed.
+ If ssh_client is not given, it is executed locally on host where tests
+ are executed. Otherwise ssh_client object is used to execute it.
"""
cmd = get_ncat_client_cmd(ip_address, port, protocol)
- result = shell.execute_local_command(cmd)
+ result = shell.execute(cmd, ssh_client=ssh_client)
self.assertEqual(0, result.exit_status)
return result.stdout