From 810cae1a1d03138abfa54cd31059723ec0c22ab1 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 31 Oct 2011 14:26:41 -0700 Subject: [PATCH] testrados: specify CEPH_CONF directly Signed-off-by: Samuel Just --- teuthology/task/testrados.py | 61 +++++++++++++----------------------- 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/teuthology/task/testrados.py b/teuthology/task/testrados.py index 97a36d2dbf232..fe46d9da81c2c 100644 --- a/teuthology/task/testrados.py +++ b/teuthology/task/testrados.py @@ -46,40 +46,31 @@ def task(ctx, config): (remote,) = ctx.cluster.only(role).remotes.iterkeys() remotes.append(remote) - remote.run( - args=[ - 'cp', - '/tmp/cephtest/ceph.conf', - '/tmp/cephtest/data/ceph.conf', - ], - logger=log.getChild('testrados.{id}'.format(id=id_)), - wait=True, - ) - - commandstring = "" + args = [] if not config.get('snaps', False): - commandstring = " ".join([ - 'cd', '/tmp/cephtest/data;', - 'export CEPH_CLIENT_ID={id_}; LD_PRELOAD=/tmp/cephtest/binary/usr/local/lib/librados.so.2 /tmp/cephtest/binary/usr/local/bin/testreadwrite'.format( - id_=id_), - str(config.get('ops', '10000')), - str(config.get('objects', '500')), - str(50), - str(config.get('maxinflight', '16')), - ]) + args = [ + 'CEPH_CLIENT_ID={id_};'.format(id_=id_), + 'CEPH_CONF=/tmp/cephtest/ceph.conf', + 'LD_PRELOAD=/tmp/cephtest/binary/usr/local/lib/librados.so.2', + '/tmp/cephtest/binary/usr/local/bin/testreadwrite', + str(config.get('ops', '10000')), + str(config.get('objects', '500')), + str(50), + str(config.get('maxinflight', '16')) + ] else: - commandstring = " ".join([ - 'cd', '/tmp/cephtest/data;', - 'export CEPH_CLIENT_ID={id_}; LD_PRELOAD=/tmp/cephtest/binary/usr/local/lib/librados.so.2 /tmp/cephtest/binary/usr/local/bin/testsnaps'.format( - id_=id_), - str(config.get('ops', '1000')), - str(config.get('objects', '25')), - str(config.get('maxinflight', '16')), - ]) - + args = [ + 'CEPH_CLIENT_ID={id_};'.format(id_=id_), + 'CEPH_CONF=/tmp/cephtest/ceph.conf', + 'LD_PRELOAD=/tmp/cephtest/binary/usr/local/lib/librados.so.2', + '/tmp/cephtest/binary/usr/local/bin/testsnaps', + str(config.get('ops', '10000')), + str(config.get('objects', '500')), + str(config.get('maxinflight', '16')) + ] proc = remote.run( - args=['/bin/sh', '-c', commandstring], + args=args, logger=log.getChild('testrados.{id}'.format(id=id_)), stdin=run.PIPE, wait=False @@ -89,15 +80,5 @@ def task(ctx, config): try: yield finally: - for i in remotes: - i.run( - args=[ - 'rm', - '/tmp/cephtest/data/ceph.conf' - ], - logger=log.getChild('testrados.{id}'.format(id=id_)), - wait=True, - ) - log.info('joining testrados') run.wait(testrados.itervalues()) -- 2.39.5