コード例 #1
0
ファイル: ansible.py プロジェクト: shyukri/teuthology
 def find_repo(self):
     """
     Locate the repo we're using; cloning it from a remote repo if necessary
     """
     repo = self.config.get('repo', '.')
     if repo.startswith(('http://', 'https://', 'git@', 'git://')):
         repo_path = fetch_repo(
             repo,
             self.config.get('branch', 'master'),
         )
     else:
         repo_path = os.path.abspath(os.path.expanduser(repo))
     self.repo_path = repo_path
コード例 #2
0
ファイル: ansible.py プロジェクト: ErwanAliasr1/teuthology
 def find_repo(self):
     """
     Locate the repo we're using; cloning it from a remote repo if necessary
     """
     repo = self.config.get('repo', '.')
     if repo.startswith(('http://', 'https://', 'git@', 'git://')):
         repo_path = fetch_repo(
             repo,
             self.config.get('branch', 'master'),
         )
     else:
         repo_path = os.path.abspath(os.path.expanduser(repo))
     self.repo_path = repo_path
コード例 #3
0
ファイル: rgw_multisite_tests.py プロジェクト: drunkard/ceph
    def setup(self):
        super(RGWMultisiteTests, self).setup()

        overrides = self.ctx.config.get('overrides', {})
        misc.deep_merge(self.config, overrides.get('rgw-multisite-tests', {}))

        if not self.ctx.rgw_multisite:
            raise ConfigError(
                'rgw-multisite-tests must run after the rgw-multisite task')
        realm = self.ctx.rgw_multisite.realm
        master_zone = realm.meta_master_zone()

        branch = self.config.get('branch')
        if not branch:
            # run from suite_path
            suite_path = self.ctx.config.get('suite_path')
            self.module_path = suite_path + '/../src/test/rgw/rgw_multi'
        else:
            # clone the qa branch
            repo = self.config.get('repo',
                                   teuth_config.get_ceph_qa_suite_git_url())
            log.info("cloning suite branch %s from %s...", branch, repo)
            clonedir = fetch_repo(repo, branch)
            # import its version of rgw_multi
            self.module_path = clonedir + '/src/test/rgw/rgw_multi'

        log.info("importing tests from %s", self.module_path)
        spec = importlib.util.spec_from_file_location(
            'rgw_multi', self.module_path + '/__init__.py')
        module = importlib.util.module_from_spec(spec)
        sys.modules[spec.name] = module
        spec.loader.exec_module(module)

        from rgw_multi import multisite, tests

        # create the test user
        log.info('creating test user..')
        user = multisite.User('rgw-multisite-test-user')
        user.create(master_zone, [
            '--display-name', 'Multisite Test User', '--gen-access-key',
            '--gen-secret', '--caps', 'roles=*'
        ])

        config = self.config.get('config', {})
        tests.init_multi(realm, user, tests.Config(**config))
        tests.realm_meta_checkpoint(realm)