try:
yield
finally:
- log.info('Removing s3-tests...')
- for client in config:
- ctx.cluster.only(client).run(
- args=[
- 'rm',
- '-rf',
- '{tdir}/s3-tests'.format(tdir=teuthology.get_testdir(ctx)),
- ],
- )
+ cleanup_tests(ctx, config)
def _config_user(s3tests_conf, section, user):
s3tests_conf[section].setdefault('user_id', user)
yield
+@contextlib.contextmanager
+def cleanup_tests(ctx, config):
+ log.info('Removing s3-tests...')
+ for client in config:
+ ctx.cluster.only(client).run(
+ args=[
+ 'rm',
+ '-rf',
+ '{tdir}/s3-tests'.format(tdir=teuthology.get_testdir(ctx)),
+ ],
+ )
+
@contextlib.contextmanager
def task(ctx, config):
"""
s3tests_conf=s3tests_conf,
)),
lambda: run_tests(ctx=ctx, config=config),
+ lambda: cleanup_tests(ctx=ctx, config=config),
):
yield
try:
yield
finally:
- log.info('Removing s3-tests...')
- for client in config:
- ctx.cluster.only(client).run(
- args=[
- 'rm',
- '-rf',
- '{tdir}/s3-tests'.format(tdir=testdir),
- ],
- )
+ cleanup_tests(ctx, config)
@contextlib.contextmanager
def download(ctx, config):
do_run_tests(ctx, config)
yield
+@contextlib.contextmanager
+def cleanup_tests(ctx, config):
+ log.info('Removing s3-tests...')
+ testdir = teuthology.get_testdir(ctx)
+ for client in config:
+ ctx.cluster.only(client).run(
+ args=[
+ 'rm',
+ '-rf',
+ '{tdir}/s3-tests'.format(tdir=testdir),
+ ],
+ )
+ yield
+
@contextlib.contextmanager
def task(ctx, config):
"""
s3tests_conf=s3tests_conf,
)),
lambda: run_tests(ctx=ctx, config=config),
+ lambda: cleanup_tests(ctx=ctx, config=config),
):
yield
try:
yield
finally:
- log.info('Removing swift...')
- for client in config:
- ctx.cluster.only(client).run(
- args=[
- 'rm',
- '-rf',
- '{tdir}/swift'.format(tdir=testdir),
- ],
- )
+ cleanup_tests(ctx, config)
def _config_user(testswift_conf, account, user, suffix):
testswift_conf['func_test'].setdefault('account{s}'.format(s=suffix), account);
)
yield
+@contextlib.contextmanager
+def cleanup_tests(ctx, config):
+ log.info('Removing swift...')
+ testdir = teuthology.get_testdir(ctx)
+ for client in config:
+ ctx.cluster.only(client).run(
+ args=[
+ 'rm',
+ '-rf',
+ '{tdir}/swift'.format(tdir=testdir),
+ ],
+ )
@contextlib.contextmanager
def task(ctx, config):
testswift_conf=testswift_conf,
)),
lambda: run_tests(ctx=ctx, config=config),
+ lambda: cleanup_tests(ctx=ctx, config=config),
):
yield