def run(self, **kwargs): # pylint: disable=protected-access """Run all read operations to check connections""" status = testcase.TestCase.EX_RUN_ERROR try: assert self.cloud self.start_time = time.time() self.__logger.debug("list_services: %s", functest_utils.list_services(self.cloud)) if env.get('NO_TENANT_NETWORK').lower() == 'true': self.func_list.remove("list_floating_ip_pools") self.func_list.remove("list_floating_ips") self.func_list.remove("list_routers") for func in self.func_list: self.__logger.debug("%s: %s", func, getattr(self.cloud, func)()) data = self.cloud._network_client.get("/service-providers.json") self.__logger.debug( "list_service_providers: %s", self.cloud._get_and_munchify('service_providers', data)) functest_utils.get_openstack_version(self.cloud) self.result = 100 status = testcase.TestCase.EX_OK except Exception: # pylint: disable=broad-except self.__logger.exception('Cannot run %s', self.case_name) finally: self.stop_time = time.time() return status
def test_openstack_version_exc(self, *args): cloud = mock.Mock() self.assertEqual(functest_utils.get_openstack_version(cloud), "Unknown") args[0].assert_called_once_with(cloud)
def test_openstack_version10(self, *args): cloud = mock.Mock() self.assertEqual(functest_utils.get_openstack_version(cloud), "Rocky or newer") args[0].assert_called_once_with(cloud)