Esempio n. 1
0
    def setUp(self):
        super(HeatIntegrationTest, self).setUp()

        self.conf = config.init_conf()

        self.assertIsNotNone(self.conf.auth_url,
                             'No auth_url configured')
        self.assertIsNotNone(self.conf.username,
                             'No username configured')
        self.assertIsNotNone(self.conf.password,
                             'No password configured')

        self.manager = clients.ClientManager(self.conf)
        self.identity_client = self.manager.identity_client
        self.orchestration_client = self.manager.orchestration_client
        self.compute_client = self.manager.compute_client
        self.network_client = self.manager.network_client
        self.volume_client = self.manager.volume_client
        self.object_client = self.manager.object_client
        self.metering_client = self.manager.metering_client
        self.useFixture(fixtures.FakeLogger(format=_LOG_FORMAT))
        self.updated_time = {}
        if self.conf.disable_ssl_certificate_validation:
            self.verify_cert = False
        else:
            self.verify_cert = self.conf.ca_file or True
Esempio n. 2
0
def requires_convergence(test_method):
    '''Decorator for convergence-only tests.

    The decorated test will be skipped when convergence is disabled.
    '''
    convergence_enabled = config.init_conf(
    ).heat_plugin.convergence_engine_enabled
    skipper = testtools.skipUnless(convergence_enabled,
                                   "Convergence-only tests are disabled")
    return skipper(test_method)
Esempio n. 3
0
 def setup_clients_for_admin(self):
     self.assertIsNotNone(self.conf.admin_username,
                          'No admin username configured')
     self.assertIsNotNone(self.conf.admin_password,
                          'No admin password configured')
     conf = config.init_conf()
     conf.username = self.conf.admin_username
     conf.password = self.conf.admin_password
     conf.tenant_name = self.conf.admin_tenant_name
     self.setup_clients(conf)
Esempio n. 4
0
 def setUp(self):
     super(EncryptionVolTypeTest, self).setUp()
     self.conf = config.init_conf()
     # cinder security policy usage of volume type is limited
     # to being used by administrators only.
     # Temporarily set username as admin for this test case.
     self.conf.username = '******'
     self.manager = clients.ClientManager(self.conf)
     self.client = self.manager.orchestration_client
     self.volume_client = self.manager.volume_client
 def setUp(self):
     super(EncryptionVolTypeTest, self).setUp()
     self.conf = config.init_conf()
     # cinder security policy usage of volume type is limited
     # to being used by administrators only.
     # Temporarily set username as admin for this test case.
     self.conf.username = '******'
     self.manager = clients.ClientManager(self.conf)
     self.client = self.manager.orchestration_client
     self.volume_client = self.manager.volume_client
Esempio n. 6
0
def requires_convergence(test_method):
    '''Decorator for convergence-only tests.

    The decorated test will be skipped when convergence is disabled.
    '''
    convergence_enabled = config.init_conf(
    ).heat_plugin.convergence_engine_enabled
    skipper = testtools.skipUnless(convergence_enabled,
                                   "Convergence-only tests are disabled")
    return skipper(test_method)
 def setUp(self):
     super(EncryptionVolTypeTest, self).setUp()
     if not self.conf.admin_username or not self.conf.admin_password:
         self.skipTest('No admin creds found, skipping')
     self.conf = config.init_conf()
     # cinder security policy usage of volume type is limited
     # to being used by administrators only.
     # Temporarily switch to admin
     self.conf.username = self.conf.admin_username
     self.conf.password = self.conf.admin_password
     self.manager = clients.ClientManager(self.conf)
     self.client = self.manager.orchestration_client
     self.volume_client = self.manager.volume_client
 def setUp(self):
     super(EncryptionVolTypeTest, self).setUp()
     if not self.conf.admin_username or not self.conf.admin_password:
         self.skipTest('No admin creds found, skipping')
     self.conf = config.init_conf()
     # cinder security policy usage of volume type is limited
     # to being used by administrators only.
     # Temporarily switch to admin
     self.conf.username = self.conf.admin_username
     self.conf.password = self.conf.admin_password
     self.manager = clients.ClientManager(self.conf)
     self.client = self.manager.orchestration_client
     self.volume_client = self.manager.volume_client
Esempio n. 9
0
    def setUp(self):
        super(HeatIntegrationTest, self).setUp()

        self.conf = config.init_conf()

        self.assertIsNotNone(self.conf.auth_url, 'No auth_url configured')
        self.assertIsNotNone(self.conf.username, 'No username configured')
        self.assertIsNotNone(self.conf.password, 'No password configured')

        self.manager = clients.ClientManager(self.conf)
        self.identity_client = self.manager.identity_client
        self.orchestration_client = self.manager.orchestration_client
        self.compute_client = self.manager.compute_client
        self.network_client = self.manager.network_client
        self.volume_client = self.manager.volume_client
Esempio n. 10
0
    def setUp(self):
        super(HeatIntegrationTest, self).setUp()

        self.conf = config.init_conf().heat_plugin

        self.assertIsNotNone(self.conf.auth_url, 'No auth_url configured')
        self.assertIsNotNone(self.conf.username, 'No username configured')
        self.assertIsNotNone(self.conf.password, 'No password configured')
        self.setup_clients(self.conf)
        self.useFixture(fixtures.FakeLogger(format=_LOG_FORMAT))
        self.updated_time = {}
        if self.conf.disable_ssl_certificate_validation:
            self.verify_cert = False
        else:
            self.verify_cert = self.conf.ca_file or True
Esempio n. 11
0
    def setUp(self):
        super(HeatIntegrationTest, self).setUp()

        self.conf = config.init_conf().heat_plugin

        self.assertIsNotNone(self.conf.auth_url,
                             'No auth_url configured')
        self.assertIsNotNone(self.conf.username,
                             'No username configured')
        self.assertIsNotNone(self.conf.password,
                             'No password configured')
        self.setup_clients(self.conf)
        self.useFixture(fixtures.FakeLogger(format=_LOG_FORMAT))
        self.updated_time = {}
        if self.conf.disable_ssl_certificate_validation:
            self.verify_cert = False
        else:
            self.verify_cert = self.conf.ca_file or True
Esempio n. 12
0
    def setUp(self):
        super(HeatIntegrationTest, self).setUp()

        self.conf = config.init_conf()

        self.assertIsNotNone(self.conf.auth_url,
                             'No auth_url configured')
        self.assertIsNotNone(self.conf.username,
                             'No username configured')
        self.assertIsNotNone(self.conf.password,
                             'No password configured')

        self.manager = clients.ClientManager(self.conf)
        self.identity_client = self.manager.identity_client
        self.orchestration_client = self.manager.orchestration_client
        self.compute_client = self.manager.compute_client
        self.network_client = self.manager.network_client
        self.volume_client = self.manager.volume_client
        self.useFixture(fixtures.FakeLogger(format=_LOG_FORMAT))
Esempio n. 13
0
    def setUp(self):
        super(HeatIntegrationTest, self).setUp()

        self.conf = config.init_conf()

        self.assertIsNotNone(self.conf.auth_url, 'No auth_url configured')
        self.assertIsNotNone(self.conf.username, 'No username configured')
        self.assertIsNotNone(self.conf.password, 'No password configured')

        self.manager = clients.ClientManager(self.conf)
        self.identity_client = self.manager.identity_client
        self.orchestration_client = self.manager.orchestration_client
        self.compute_client = self.manager.compute_client
        self.network_client = self.manager.network_client
        self.volume_client = self.manager.volume_client
        self.object_client = self.manager.object_client
        self.metering_client = self.manager.metering_client
        self.useFixture(fixtures.FakeLogger(format=_LOG_FORMAT))
        self.updated_time = {}
Esempio n. 14
0
def load_tests(loader, standard_tests, pattern):
    logging.setup(config.init_conf(), __name__)

    suite = unittest.TestSuite()

    heat_integration_dir = os.path.dirname(os.path.abspath(__file__))
    top_level_dir = os.path.split(heat_integration_dir)[0]
    if pattern:
        discovered = loader.discover(heat_integration_dir,
                                     pattern=pattern,
                                     top_level_dir=top_level_dir)
    else:
        discovered = loader.discover(heat_integration_dir,
                                     top_level_dir=top_level_dir)
    suite.addTests(discovered)

    # Discover tests from the heat-tempest-plugin if it is present, using
    # the Tempest plugin mechanism so we don't need a hard dependency on it.
    from tempest.test_discover import plugins as tempest_plugins

    ext_plugins = tempest_plugins.TempestTestPluginManager()
    plugin_data = ext_plugins.get_plugin_load_tests_tuple()
    heat_plugin_data = plugin_data.get('heat')
    if heat_plugin_data is not None:
        plugin_dir, plugin_path = heat_plugin_data
        LOG.info('Found Heat Tempest plugin: %s, %s', plugin_dir, plugin_path)
        if pattern:
            discovered = loader.discover(plugin_dir,
                                         pattern=pattern,
                                         top_level_dir=plugin_path)
        else:
            discovered = loader.discover(plugin_dir, top_level_dir=plugin_path)
        suite.addTests(discovered)
    else:
        LOG.error('Heat Tempest plugin not found')
        LOG.info('Available Tempest plugins: %s',
                 ', '.join(plugin_data.keys()))

    return suite
Esempio n. 15
0
def load_tests(loader, standard_tests, pattern):
    logging.setup(config.init_conf(), __name__)

    suite = unittest.TestSuite()

    heat_integration_dir = os.path.dirname(os.path.abspath(__file__))
    top_level_dir = os.path.split(heat_integration_dir)[0]
    if pattern:
        discovered = loader.discover(heat_integration_dir, pattern=pattern,
                                     top_level_dir=top_level_dir)
    else:
        discovered = loader.discover(heat_integration_dir,
                                     top_level_dir=top_level_dir)
    suite.addTests(discovered)

    # Discover tests from the heat-tempest-plugin if it is present, using
    # the Tempest plugin mechanism so we don't need a hard dependency on it.
    from tempest.test_discover import plugins as tempest_plugins

    ext_plugins = tempest_plugins.TempestTestPluginManager()
    plugin_data = ext_plugins.get_plugin_load_tests_tuple()
    heat_plugin_data = plugin_data.get('heat')
    if heat_plugin_data is not None:
        plugin_dir, plugin_path = heat_plugin_data
        LOG.info('Found Heat Tempest plugin: %s, %s', plugin_dir, plugin_path)
        if pattern:
            discovered = loader.discover(plugin_dir, pattern=pattern,
                                         top_level_dir=plugin_path)
        else:
            discovered = loader.discover(plugin_dir,
                                         top_level_dir=plugin_path)
        suite.addTests(discovered)
    else:
        LOG.error('Heat Tempest plugin not found')
        LOG.info('Available Tempest plugins: %s',
                 ', '.join(plugin_data.keys()))

    return suite