From de54f230315e853e77467cb938ae020ccf8ea1e1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 22 Aug 2014 15:28:33 -0700 Subject: [PATCH] tasks/s3tests: push boto config with idle_timeout setting Signed-off-by: Sage Weil (cherry picked from commit 9d466aa110e293cb88c1f61cc7391d59b64b553b) --- tasks/boto.cfg.template | 2 ++ tasks/s3tests.py | 47 +++++++++++++++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 tasks/boto.cfg.template diff --git a/tasks/boto.cfg.template b/tasks/boto.cfg.template new file mode 100644 index 0000000000000..cdfe8873b4240 --- /dev/null +++ b/tasks/boto.cfg.template @@ -0,0 +1,2 @@ +[Boto] +http_socket_timeout = {idle_timeout} diff --git a/tasks/s3tests.py b/tasks/s3tests.py index cd4bd6fda3a0d..48f49ac8b20f5 100644 --- a/tasks/s3tests.py +++ b/tasks/s3tests.py @@ -262,7 +262,34 @@ def configure(ctx, config): path='{tdir}/archive/s3-tests.{client}.conf'.format(tdir=testdir, client=client), data=conf_fp.getvalue(), ) - yield + + log.info('Configuring boto...') + boto_src = os.path.join(os.path.dirname(__file__), 'boto.cfg.template') + for client, properties in config['clients'].iteritems(): + with file(boto_src, 'rb') as f: + (remote,) = ctx.cluster.only(client).remotes.keys() + conf = f.read().format( + idle_timeout=config.get('idle_timeout', 30) + ) + teuthology.write_file( + remote=remote, + path='{tdir}/boto.cfg'.format(tdir=testdir), + data=conf, + ) + + try: + yield + + finally: + log.info('Cleaning up boto...') + for client, properties in config['clients'].iteritems(): + (remote,) = ctx.cluster.only(client).remotes.keys() + remote.run( + args=[ + 'rm', + '{tdir}/boto.cfg'.format(tdir=testdir), + ], + ) @contextlib.contextmanager def sync_users(ctx, config): @@ -291,13 +318,14 @@ def run_tests(ctx, config): testdir = teuthology.get_testdir(ctx) for client, client_config in config.iteritems(): args = [ - 'S3TEST_CONF={tdir}/archive/s3-tests.{client}.conf'.format(tdir=testdir, client=client), - '{tdir}/s3-tests/virtualenv/bin/nosetests'.format(tdir=testdir), - '-w', - '{tdir}/s3-tests'.format(tdir=testdir), - '-v', - '-a', '!fails_on_rgw', - ] + 'S3TEST_CONF={tdir}/archive/s3-tests.{client}.conf'.format(tdir=testdir, client=client), + 'BOTO_CONFIG={tdir}/boto.cfg'.format(tdir=testdir), + '{tdir}/s3-tests/virtualenv/bin/nosetests'.format(tdir=testdir), + '-w', + '{tdir}/s3-tests'.format(tdir=testdir), + '-v', + '-a', '!fails_on_rgw', + ] if client_config is not None and 'extra_args' in client_config: args.extend(client_config['extra_args']) @@ -325,7 +353,7 @@ def task(ctx, config): - rgw: [client.0] - s3tests: [client.0] - To run against a server on client.1:: + To run against a server on client.1 and increase the boto timeout to 10m:: tasks: - ceph: @@ -333,6 +361,7 @@ def task(ctx, config): - s3tests: client.0: rgw_server: client.1 + idle_timeout: 600 To pass extra arguments to nose (e.g. to run a certain test):: -- 2.39.5