Ejemplo n.º 1
0
 def test_regression(
     self,
     m_git_ls_remote,
     m_package_version_for_hash,
     m_git_branch_exists,
     m_fetch_repos,
 ):
     config.use_shaman = False
     config.gitbuilder_host = 'example.com'
     m_package_version_for_hash.return_value = 'ceph_hash'
     m_git_branch_exists.return_value = True
     m_git_ls_remote.return_value = "suite_branch"
     self.args_dict = {
         'base_yaml_paths': [],
         'ceph_branch': 'master',
         'machine_type': 'smithi',
         'kernel_flavor': 'basic',
         'kernel_branch': 'testing',
         'suite': 'krbd',
     }
     self.args = YamlConfig.from_dict(self.args_dict)
     with patch.multiple(
             'teuthology.packaging.GitbuilderProject',
             _get_package_sha1=DEFAULT,
     ) as m:
         assert m != dict()
         m['_get_package_sha1'].return_value = 'SHA1'
         conf = dict(
             os_type='ubuntu',
             os_version='16.04',
         )
         assert packaging.GitbuilderProject('ceph', conf).sha1 == 'SHA1'
         run_ = self.klass(self.args)
         assert run_.base_config['kernel']['sha1'] == 'SHA1'
Ejemplo n.º 2
0
 def test_regression(
     self,
     m_git_ls_remote,
     m_package_version_for_hash,
     m_git_branch_exists,
     m_fetch_repos,
 ):
     config.use_shaman = False
     config.gitbuilder_host = 'example.com'
     m_package_version_for_hash.return_value = 'ceph_hash'
     m_git_branch_exists.return_value = True
     m_git_ls_remote.return_value = "suite_branch"
     self.args_dict = {
         'base_yaml_paths': [],
         'ceph_branch': 'master',
         'machine_type': 'smithi',
         'kernel_flavor': 'basic',
         'kernel_branch': 'testing',
         'suite': 'krbd',
     }
     self.args = YamlConfig.from_dict(self.args_dict)
     with patch.multiple(
         'teuthology.packaging.GitbuilderProject',
         _get_package_sha1=DEFAULT,
     ) as m:
         assert m != dict()
         m['_get_package_sha1'].return_value = 'SHA1'
         conf = dict(
             os_type='ubuntu',
             os_version='16.04',
         )
         assert packaging.GitbuilderProject('ceph', conf).sha1 == 'SHA1'
         run_ = self.klass(self.args)
         assert run_.base_config['kernel']['sha1'] == 'SHA1'
Ejemplo n.º 3
0
 def setup(self):
     self.args_dict = dict(
         suite='suite',
         suite_branch='suite_branch',
         ceph_branch='ceph_branch',
         ceph_sha1='ceph_sha1',
         teuthology_branch='teuthology_branch',
         kernel_branch=None,
         kernel_flavor='kernel_flavor',
         distro='ubuntu',
         machine_type='machine_type',
         base_yaml_paths=list(),
     )
     self.args = YamlConfig.from_dict(self.args_dict)
Ejemplo n.º 4
0
 def setup(self):
     self.args_dict = dict(
         suite='suite',
         suite_branch='suite_branch',
         ceph_branch='ceph_branch',
         ceph_sha1='ceph_sha1',
         teuthology_branch='teuthology_branch',
         kernel_branch=None,
         kernel_flavor='kernel_flavor',
         distro='ubuntu',
         machine_type='machine_type',
         base_yaml_paths=list(),
     )
     self.args = YamlConfig.from_dict(self.args_dict)
Ejemplo n.º 5
0
 def setup(self):
     self.args_dict = dict(
         suite='suite',
         suite_branch='suite_branch',
         suite_relpath='',
         ceph_branch='ceph_branch',
         ceph_sha1='ceph_sha1',
         email='*****@*****.**',
         teuthology_branch='teuthology_branch',
         kernel_branch=None,
         flavor='flavor',
         distro='ubuntu',
         machine_type='machine_type',
         base_yaml_paths=list(),
     )
     self.args = YamlConfig.from_dict(self.args_dict)
Ejemplo n.º 6
0
 def setup(self):
     self.args_dict = dict(
         suite='suite',
         suite_relpath='',
         suite_dir='suite_dir',
         suite_branch='master',
         ceph_branch='ceph_branch',
         ceph_sha1='ceph_sha1',
         teuthology_branch='master',
         kernel_branch=None,
         flavor='flavor',
         distro='ubuntu',
         distro_version='14.04',
         machine_type='machine_type',
         base_yaml_paths=list(),
     )
     self.args = YamlConfig.from_dict(self.args_dict)
Ejemplo n.º 7
0
def process_args(args):
    conf = YamlConfig()
    rename_args = {
        'ceph': 'ceph_branch',
        'sha1': 'ceph_sha1',
        'kernel': 'kernel_branch',
        # FIXME: ceph flavor and kernel flavor are separate things
        'flavor': 'kernel_flavor',
        '<config_yaml>': 'base_yaml_paths',
        'filter': 'filter_in',
    }
    for (key, value) in args.items():
        # Translate --foo-bar to foo_bar
        key = key.lstrip('--').replace('-', '_')
        # Rename the key if necessary
        key = rename_args.get(key) or key
        if key == 'suite_branch':
            value = value or override_arg_defaults('--suite-branch', None)
        if key == 'suite' and value is not None:
            value = normalize_suite_name(value)
        if key == 'suite_relpath' and value is None:
            value = ''
        elif key in ('limit', 'priority', 'num', 'newest', 'seed', 'job_threshold'):
            value = int(value)
        elif key == 'subset' and value is not None:
            # take input string '2/3' and turn into (2, 3)
            value = tuple(map(int, value.split('/')))
        elif key in ('filter_all', 'filter_in', 'filter_out', 'rerun_statuses'):
            if not value:
                value = []
            else:
                value = [x.strip() for x in value.split(',')]
        elif key == 'ceph_repo':
            value = expand_short_repo_name(
                value,
                config.get_ceph_git_url())
        elif key == 'suite_repo':
            value = expand_short_repo_name(
                value,
                config.get_ceph_qa_suite_git_url())
        elif key in ('validate_sha1', 'filter_fragments'):
            value = strtobool(value)
        conf[key] = value
    return conf