Esempio n. 1
0
    def setUp(self):
        super(FunctionalTest, self).setUp()
        if not config_ini:
            raise test_exceptions.ConfFileError('Configuration file parameter'
                                                ' --tc-file is missing or '
                                                'the file has wrong format')

        self.src_cloud = generate_load.Prerequisites(
                cloud_prefix='SRC',
                configuration_ini=config_ini,
                config=config)
        self.dst_cloud = generate_load.Prerequisites(
                cloud_prefix='DST',
                configuration_ini=config_ini,
                config=config)
        self.migration_utils = utils.MigrationUtils(config)
        self.src_vms_from_config = \
            self.migration_utils.get_all_vms_from_config()
        self.config_ini_path = config_ini['general']['configuration_ini_path']
        self.cloudferry_dir = config_ini['general']['cloudferry_dir']
        tenant = base.get_nosetest_cmd_attribute_val('migrated_tenant')
        filter_path = config_ini['general'].get(
            'filter_path',
            get_option_from_config_ini('filter_path')) if tenant \
            else config.all_tenants_filter_filename
        self.filtering_utils = utils.FilteringUtils(
            os.path.join(self.cloudferry_dir, filter_path))
        suppress_dependency_logging()
Esempio n. 2
0
    def __init__(self,
                 config,
                 configuration_ini,
                 cloud_prefix='SRC',
                 results_path='.'):
        self.configuration_ini = configuration_ini
        self.results_path = results_path
        logging_config.dictConfig(conf.logging_configuration)
        self.log = logging.getLogger(__name__)
        self.filtering_utils = utils.FilteringUtils(
            self.configuration_ini['migrate']['filter_path'])
        self.migration_utils = utils.MigrationUtils(config)
        self.src_vms_from_config = \
            self.migration_utils.get_all_vms_from_config()

        self.config = config
        self.cloud_prefix = cloud_prefix.lower()

        self.username = self.configuration_ini[self.cloud_prefix]['user']
        self.password = self.configuration_ini[self.cloud_prefix]['password']
        self.tenant = self.configuration_ini[self.cloud_prefix]['tenant']
        self.auth_url = self.configuration_ini[self.cloud_prefix]['auth_url']

        self.keystoneclient = keystone.Client(auth_url=self.auth_url,
                                              username=self.username,
                                              password=self.password,
                                              tenant_name=self.tenant)
        self.keystoneclient.authenticate()

        self.novaclient = nova.Client(username=self.username,
                                      api_key=self.password,
                                      project_id=self.tenant,
                                      auth_url=self.auth_url)

        self.token = self.keystoneclient.auth_token

        self.image_endpoint = \
            self.keystoneclient.service_catalog.get_endpoints(
                service_type='image',
                endpoint_type='publicURL')['image'][0]['publicURL']

        self.glanceclient = glance(endpoint=self.image_endpoint,
                                   token=self.token)

        self.neutronclient = neutron.Client(username=self.username,
                                            password=self.password,
                                            tenant_name=self.tenant,
                                            auth_url=self.auth_url)

        self.cinderclient = cinder.Client(self.username, self.password,
                                          self.tenant, self.auth_url)
        self.openstack_release = self._get_openstack_release()
        self.server_groups_supported = self.openstack_release in [
            'icehouse', 'juno'
        ]
        self.swift_connection = SwiftConnection(self.auth_url, self.username,
                                                self.password, self.tenant)
Esempio n. 3
0
    def setUp(self):
        super(FunctionalTest, self).setUp()
        suppress_dependency_logging()
        if not config_ini:
            raise test_exceptions.ConfFileError('Configuration file parameter'
                                                ' --tc-file is missing or '
                                                'the file has wrong format')

        self.src_cloud = generate_load.Prerequisites(
            cloud_prefix='SRC', configuration_ini=config_ini, config=config)
        self.dst_cloud = generate_load.Prerequisites(
            cloud_prefix='DST', configuration_ini=config_ini, config=config)
        self.migration_utils = utils.MigrationUtils(config)
        self.config_ini_path = config_ini['general']['configuration_ini_path']
        self.cloudferry_dir = config_ini['general']['cloudferry_dir']
        self.filtering_utils = utils.FilteringUtils(
            os.path.join(self.cloudferry_dir,
                         get_option_from_config_ini('filter_path')))