]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Merge branch 'master' into rh
authorrakeshgm <rgowdege@redhat.com>
Fri, 25 Oct 2019 19:36:14 +0000 (01:06 +0530)
committerrakeshgm <rgowdege@redhat.com>
Fri, 25 Oct 2019 19:36:14 +0000 (01:06 +0530)
17 files changed:
1  2 
scripts/suite.py
setup.py
teuthology/lock/ops.py
teuthology/misc.py
teuthology/nuke/__init__.py
teuthology/orchestra/remote.py
teuthology/results.py
teuthology/run.py
teuthology/suite/run.py
teuthology/task/ceph_ansible.py
teuthology/task/exec.py
teuthology/task/install/redhat.py
teuthology/task/install/util.py
teuthology/task/internal/__init__.py
teuthology/task/internal/lock_machines.py
teuthology/task/internal/redhat.py
teuthology/test/task/test_install.py

Simple merge
diff --cc setup.py
Simple merge
index 14485244e87781a3ad7d95bf66c5e9c45ecf8f92,d5fbf092ba1e96b6beb2ded87ea3af19449e8a80..59e5b6e492225f9ce6bd3c7493452056c45d58fe
@@@ -103,8 -127,9 +121,9 @@@ def lock_many(ctx, num, machine_type, u
                                    machine)
                          unlock_one(ctx, machine, user)
                      ok_machs = keys.do_update_keys(ok_machs.keys())[1]
+                 update_nodes(ok_machs)
                  return ok_machs
 -            elif machine_type in reimage_types:
 +            else:
                  reimaged = dict()
                  console_log_conf = dict(
                      logfile_name='{shortname}_reimage.log',
index ecbacde93418c870aeb45c267b26538fde079c51,3472f8b565334f7d01121fc93fef7112e2f00164..aac97ed6d1bfabb675fd670cf91f64f55ded7b98
@@@ -25,13 -23,12 +24,13 @@@ import pprin
  from netaddr.strategy.ipv4 import valid_str as _is_ipv4
  from netaddr.strategy.ipv6 import valid_str as _is_ipv6
  from teuthology import safepath
 +from teuthology.parallel import parallel
  from teuthology.exceptions import (CommandCrashedError, CommandFailedError,
                                     ConnectionLostError)
- from .orchestra import run
- from .config import config
- from .contextutil import safe_while
- from .orchestra.opsys import DEFAULT_OS_VERSION
+ from teuthology.orchestra import run
+ from teuthology.config import config
+ from teuthology.contextutil import safe_while
+ from teuthology.orchestra.opsys import DEFAULT_OS_VERSION
  
  log = logging.getLogger(__name__)
  
Simple merge
Simple merge
Simple merge
index 2e65fbc4b47b61d409d6d0b619731017fe76cf8c,4d3099268ae4b0af5dfa52a8bad8ee7b50d83f43..a31e5855771bca7a46ac9f7e44d195a5f9e8f8d4
@@@ -228,22 -226,16 +228,25 @@@ def get_initial_tasks(lock, config, mac
          init_tasks.extend([
              {'pcp': None},
              {'selinux': None},
-             {'clock': None}
          ])
 -    if config.get('ceph_cm_ansible', True):
 -        init_tasks.append({'ansible.cephlab': None})
  
+     # clock_sync_task: 'clock' or 'clock.check'
+     clock_sync_task = config.get('clock_sync_task', 'clock')
+     init_tasks.append({clock_sync_task: None})
      if 'redhat' in config:
          init_tasks.extend([
 +            {'internal.setup_stage_cdn': None}
 +        ])
 +    # dont run cm-ansible by default unless requested in config
 +    # nodes are reimaged by FOG and the images provided
 +    # by FOG have already gone through cm-ansible run
 +    if config.get('run-cm-ansible', False):
 +        init_tasks.extend([{'ansible.cephlab': None}])
 +
 +    if 'redhat' in config:
 +        init_tasks.extend([
 +            {'internal.git_ignore_ssl': None},
              {'internal.setup_cdn_repo': None},
              {'internal.setup_base_repo': None},
              {'internal.setup_additional_repo': None},
index 485bb6e7499f728bc93bcd178e90767bb336df04,f5ca1c1984477572a61e78acdc12a08314e87811..916cca4d7a32009ba3a9d01a9badf10a93a6210e
@@@ -8,18 -8,17 +8,18 @@@ import yam
  
  from datetime import datetime
  from tempfile import NamedTemporaryFile
 +from math import floor
  
- from ..config import config, JobConfig
- from ..exceptions import (
+ from teuthology.config import config, JobConfig
+ from teuthology.exceptions import (
      BranchNotFoundError, CommitNotFoundError, VersionNotFoundError
  )
- from ..misc import deep_merge, get_results_url
- from ..orchestra.opsys import OS
+ from teuthology.misc import deep_merge, get_results_url
+ from teuthology.orchestra.opsys import OS
  
- from . import util
- from .build_matrix import combine_path, build_matrix
- from .placeholder import substitute_placeholders, dict_templ
+ from teuthology.suite import util
+ from teuthology.suite.build_matrix import combine_path, build_matrix
+ from teuthology.suite.placeholder import substitute_placeholders, dict_templ
  
  log = logging.getLogger(__name__)
  
index 8b8c45f2b20d05f06a49908920b560984079a755,4446791f645ff962c93193015d71ca54627fa0b4..781a55992dd3d209b5c69dbdf0c3a08d1baa5633
@@@ -3,22 -3,16 +3,22 @@@ import o
  import re
  import logging
  import yaml
 -
 +import time
 +import errno
 +import socket
  from cStringIO import StringIO
  
- from . import Task
+ from teuthology.task import Task
  from tempfile import NamedTemporaryFile
- from ..config import config as teuth_config
- from ..misc import get_scratch_devices
+ from teuthology.config import config as teuth_config
+ from teuthology.misc import get_scratch_devices
  from teuthology import contextutil
  from teuthology.orchestra import run
 +from teuthology.orchestra.daemon import DaemonGroup
 +from teuthology.task.install import ship_utilities
  from teuthology import misc
 +from teuthology import misc as teuthology
 +
  log = logging.getLogger(__name__)
  
  
@@@ -169,13 -119,12 +169,14 @@@ class CephAnsible(Task)
          log.debug("Running %s", args)
          # If there is an installer.0 node, use that for the installer.
          # Otherwise, use the first mon node as installer node.
 -        ansible_loc = self.ctx.cluster.only('installer.0')
 -        (ceph_first_mon,) = self.ctx.cluster.only(
 -            misc.get_first_mon(self.ctx,
 -                               self.config)).remotes.keys()
 +        ansible_loc = self.each_cluster.only('installer.0')
 +#        self.each_cluster = self.each_cluster.only(lambda role: role.startswith(self.cluster_name))
 +#        self.remove_cluster_prefix()
 +        (ceph_first_mon,) = self.ctx.cluster.only(misc.get_first_mon(
 +            self.ctx, self.config, self.cluster_name)).remotes.iterkeys()
++
          if ansible_loc.remotes:
-             (ceph_installer,) = ansible_loc.remotes.iterkeys()
+             (ceph_installer,) = ansible_loc.remotes.keys()
          else:
              ceph_installer = ceph_first_mon
          self.ceph_first_mon = ceph_first_mon
index d57df2ef8d3763e55bd7add2305bb2020303cde1,2d38fa3b8c7bce206224df0450bfbda255be1518..95c6be5194650a7659266304b435f04bc08a4315
@@@ -49,37 -40,17 +49,38 @@@ def task(ctx, config)
          roles = teuthology.all_roles(ctx.cluster)
          config = dict((id_, a) for id_ in roles)
  
 -    for role, ls in config.items():
 -        (remote,) = ctx.cluster.only(role).remotes.keys()
 -        log.info('Running commands on role %s host %s', role, remote.name)
 -        for c in ls:
 -            c.replace('$TESTDIR', testdir)
 -            remote.run(
 -                args=[
 -                    'sudo',
 -                    'TESTDIR={tdir}'.format(tdir=testdir),
 -                    'bash',
 -                    '-c',
 -                    c],
 -                )
 +    for role, ls in config.iteritems():
 +        if 'mon' in role or 'osd' in role \
 +                or 'client' in role:
 +            (remote,) = ctx.cluster.only(role).remotes.iterkeys()
 +            log.info('Running commands on role %s host %s', role, remote.name)
 +            for c in ls:
 +                c.replace('$TESTDIR', testdir)
 +                if retry:
 +                    with safe_while(sleep=sleep_for_retry, tries=retry,
 +                                    action="exec_with_retry") as proceed:
 +                        while proceed():
 +                            proc = remote.run(
 +                                      args=[
 +                                          'sudo',
 +                                          'TESTDIR={tdir}'.format(tdir=testdir),
 +                                          'bash',
 +                                          '-c',
 +                                          c],
 +                                      timeout=timeout,
 +                                      check_status=False,
 +                                      wait=True,
 +                                     )
 +                            if proc.exitstatus == 0:
 +                                break
 +                else:
 +                    remote.run(
 +                        args=[
 +                            'sudo',
 +                            'TESTDIR={tdir}'.format(tdir=testdir),
 +                            'bash',
 +                            '-c',
 +                            c],
 +                        timeout=timeout
 +                        )
Simple merge
index 75b3d06de1cf243bffaa38de8fa576a546884269,64268221fd89d4f135400ce54b6611607b5bcf5a..4975de37180cc7ad1945b57908716d7189a5bc62
@@@ -62,27 -62,30 +62,31 @@@ def ship_utilities(ctx, config)
      :param ctx: Context
      :param config: Configuration
      """
 -    assert config is None
      testdir = teuthology.get_testdir(ctx)
      filenames = []
 -
 +    if config is None:
 +        config = dict()
 +    log.info(config)
      log.info('Shipping valgrind.supp...')
-     with file(
-         os.path.join(os.path.dirname(__file__), 'valgrind.supp'),
-         'rb'
-             ) as f:
-         fn = os.path.join(testdir, 'valgrind.supp')
-         filenames.append(fn)
-         for rem in ctx.cluster.remotes.iterkeys():
-             teuthology.sudo_write_file(
-                 remote=rem,
-                 path=fn,
-                 data=f,
-                 )
-             f.seek(0)
+     assert 'suite_path' in ctx.config
+     try:
+         with open(
+             os.path.join(ctx.config['suite_path'], 'valgrind.supp'),
+             'rb'
+                 ) as f:
+             fn = os.path.join(testdir, 'valgrind.supp')
+             filenames.append(fn)
+             for rem in ctx.cluster.remotes.keys():
+                 teuthology.sudo_write_file(
+                     remote=rem,
+                     path=fn,
+                     data=f,
+                     )
+                 f.seek(0)
+     except IOError as e:
+         log.info('Cannot ship supression file for valgrind: %s...', e.strerror)
  
 -    FILES = ['daemon-helper', 'adjust-ulimits']
 +    FILES = ['daemon-helper', 'adjust-ulimits', 'ceph-coverage']
      destdir = '/usr/bin'
      for filename in FILES:
          log.info('Shipping %r...', filename)
index 74582a62584aac17ab0d138981229229b545671f,cb095dee28a0bdf8cb8e252f209be122da9369e6..52723c4d98fc7420efd3a71e17e770c8cf270b14
@@@ -19,8 -19,7 +19,9 @@@ from teuthology.config import config a
  from teuthology.exceptions import VersionNotFoundError
  from teuthology.job_status import get_status, set_status
  from teuthology.orchestra import cluster, remote, run
 +from .redhat import setup_cdn_repo, setup_base_repo, setup_additional_repo, setup_stage_cdn # noqa
 +
  log = logging.getLogger(__name__)
  
  
index f3c1c1d38c9214bd8b34bf4186f409d26ad03e91,430fff1e7f167dd7d6438ed882db9d7f4b5290a2..7a912ecad83a83469dc2fb48b5cbb7abe8a728ca
@@@ -140,19 -81,10 +140,19 @@@ def _setup_latest_repo(ctx, config)
      Setup repo based on redhat nodes
      """
      with parallel():
-         for remote in ctx.cluster.remotes.iterkeys():
+         for remote in ctx.cluster.remotes.keys():
              if remote.os.package_type == 'rpm':
 -                remote.run(args=['sudo', 'subscription-manager', 'repos',
 -                                 run.Raw('--disable=*ceph*')])
 +                # pre-cleanup
 +                remote.run(args=['sudo', 'rm', run.Raw('/etc/yum.repos.d/rh*')],
 +                           check_status=False)
 +                remote.run(args=['sudo', 'yum', 'clean', 'metadata'])
 +                remote.run(args=['sudo', 'yum', 'update', 'metadata'])
 +                # skip is required for beta iso testing
 +                if config.get('skip-subscription-manager', False) is True:
 +                    log.info("Skipping subscription-manager command")
 +                else:
 +                    remote.run(args=['sudo', 'subscription-manager', 'repos',
 +                                    run.Raw('--disable=*ceph*')])
                  base_url = config.get('base-repo-url', '')
                  installer_url = config.get('installer-repo-url', '')
                  repos = ['MON', 'OSD', 'Tools', 'Calamari', 'Installer']
Simple merge