def test_log_net_debug(self): self.log_ip_ns_mock = self.patch('tempest.common.debug.log_ip_ns') self.log_ovs_db_mock = self.patch('tempest.common.debug.log_ovs_db') debug.log_net_debug() self.log_ip_ns_mock.assert_called_with() self.log_ovs_db_mock.assert_called_with()
def _check_public_network_connectivity(self, should_connect=True, msg=None): # The target login is assumed to have been configured for # key-based authentication by cloud-init. ssh_login = CONF.compute.image_ssh_user LOG.debug('checking network connections') floating_ip, server = self.floating_ip_tuple ip_address = floating_ip.floating_ip_address private_key = None if should_connect: private_key = self.servers[server].private_key try: self._check_vm_connectivity(ip_address, ssh_login, private_key, should_connect=should_connect) except Exception: ex_msg = 'Public network connectivity check failed' if msg: ex_msg += ": " + msg LOG.exception(ex_msg) self._log_console_output(servers=self.servers.keys()) debug.log_net_debug() raise
def ssh_to_server(self): try: self.linux_client = self.get_remote_client(self.floating_ip.ip) self.linux_client.validate_authentication() except Exception: LOG.exception('ssh to server failed') self._log_console_output() debug.log_net_debug() raise
def ssh_to_server(self): try: self.linux_client = self.get_remote_client(self.floating_ip['ip']) except Exception as e: LOG.exception('ssh to server failed') self._log_console_output() # network debug is called as part of ssh init if not isinstance(e, test.exceptions.SSHTimeout): debug.log_net_debug() raise
def _check_connectivity(self, access_point, ip, should_succeed=True): if should_succeed: msg = "Timed out waiting for %s to become reachable" % ip else: msg = "%s is reachable" % ip try: self.assertTrue(self._check_remote_connectivity(access_point, ip, should_succeed), msg) except Exception: debug.log_net_debug() raise
def _check_connectivity(self, access_point, ip, should_succeed=True): if should_succeed: msg = "Timed out waiting for %s to become reachable" % ip else: msg = "%s is reachable" % ip try: self.assertTrue( self._check_remote_connectivity(access_point, ip, should_succeed), msg) except Exception: debug.log_net_debug() raise
def _check_connectivity(self, access_point, ip, should_succeed=True): if should_succeed: msg = "Timed out waiting for %s to become reachable" % ip else: # todo(yfried): remove this line when bug 1252620 is fixed return True msg = "%s is reachable" % ip try: self.assertTrue(self._check_remote_connectivity(access_point, ip, should_succeed), msg) except Exception: debug.log_net_debug() raise
def _check_connectivity(self, access_point, ip, should_succeed=True): if should_succeed: msg = "Timed out waiting for %s to become reachable" % ip else: # todo(yfried): remove this line when bug 1252620 is fixed return True msg = "%s is reachable" % ip try: self.assertTrue( self._check_remote_connectivity(access_point, ip, should_succeed), msg) except Exception: debug.log_net_debug() raise
def _check_tenant_network_connectivity(self): if not CONF.network.tenant_networks_reachable: msg = 'Tenant networks not configured to be reachable.' LOG.info(msg) return # The target login is assumed to have been configured for # key-based authentication by cloud-init. ssh_login = CONF.compute.image_ssh_user try: for server, key in self.servers.iteritems(): for net_name, ip_addresses in server.networks.iteritems(): for ip_address in ip_addresses: self._check_vm_connectivity(ip_address, ssh_login, key.private_key) except Exception: LOG.exception('Tenant connectivity check failed') self._log_console_output(servers=self.servers.keys()) debug.log_net_debug() raise