pass
-@contextlib.contextmanager
-def ship_utilities(ctx, config):
- """
- Write a copy of valgrind.supp to each of the remote sites. Set executables used
- by Ceph in /usr/local/bin. When finished (upon exit of the teuthology run), remove
- these files.
-
- :param ctx: Context
- :param config: Configuration
- """
- assert config is None
- testdir = teuthology.get_testdir(ctx)
- filenames = []
-
- 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)
-
- FILES = ['daemon-helper', 'adjust-ulimits', 'kcon_most']
- destdir = '/usr/bin'
- for filename in FILES:
- log.info('Shipping %r...', filename)
- src = os.path.join(os.path.dirname(__file__), filename)
- dst = os.path.join(destdir, filename)
- filenames.append(dst)
- with file(src, 'rb') as f:
- for rem in ctx.cluster.remotes.iterkeys():
- teuthology.sudo_write_file(
- remote=rem,
- path=dst,
- data=f,
- )
- f.seek(0)
- rem.run(
- args=[
- 'sudo',
- 'chmod',
- 'a=rx',
- '--',
- dst,
- ],
- )
-
- try:
- yield
- finally:
- log.info('Removing shipped files: %s...', ' '.join(filenames))
- run.wait(
- ctx.cluster.run(
- args=[
- 'sudo',
- 'rm',
- '-f',
- '--',
- ] + list(filenames),
- wait=False,
- ),
- )
-
-
def assign_devs(roles, devs):
"""
Create a dictionary of devs indexed by roles
with contextutil.nested(
lambda: ceph_log(ctx=ctx, config=None),
- lambda: ship_utilities(ctx=ctx, config=None),
lambda: valgrind_post(ctx=ctx, config=config),
lambda: cluster(ctx=ctx, config=dict(
conf=config.get('conf', {}),
yield
+@contextlib.contextmanager
+def ship_utilities(ctx, config):
+ """
+ Write a copy of valgrind.supp to each of the remote sites. Set executables used
+ by Ceph in /usr/local/bin. When finished (upon exit of the teuthology run), remove
+ these files.
+
+ :param ctx: Context
+ :param config: Configuration
+ """
+ assert config is None
+ testdir = teuthology.get_testdir(ctx)
+ filenames = []
+
+ 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)
+
+ FILES = ['daemon-helper', 'adjust-ulimits', 'kcon_most']
+ destdir = '/usr/bin'
+ for filename in FILES:
+ log.info('Shipping %r...', filename)
+ src = os.path.join(os.path.dirname(__file__), filename)
+ dst = os.path.join(destdir, filename)
+ filenames.append(dst)
+ with file(src, 'rb') as f:
+ for rem in ctx.cluster.remotes.iterkeys():
+ teuthology.sudo_write_file(
+ remote=rem,
+ path=dst,
+ data=f,
+ )
+ f.seek(0)
+ rem.run(
+ args=[
+ 'sudo',
+ 'chmod',
+ 'a=rx',
+ '--',
+ dst,
+ ],
+ )
+
+ try:
+ yield
+ finally:
+ log.info('Removing shipped files: %s...', ' '.join(filenames))
+ run.wait(
+ ctx.cluster.run(
+ args=[
+ 'sudo',
+ 'rm',
+ '-f',
+ '--',
+ ] + list(filenames),
+ wait=False,
+ ),
+ )
+
+
@contextlib.contextmanager
def task(ctx, config):
"""
wait_for_package=ctx.config.get('wait_for_package', False),
project=project,
)),
+ lambda: ship_utilities(ctx=ctx, config=None),
):
yield