From 5fcfa32f21709054f054bcda719df090777f52d5 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Wed, 31 Aug 2016 19:05:25 +0200 Subject: [PATCH] tasks/rbd_fio: don't use sudo unnecessarily Creating and cloning images doesn't require sudo. Signed-off-by: Ilya Dryomov (cherry picked from commit ec97445740bbf7848488fbb6213e74d50a355547) --- qa/tasks/rbd_fio.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/qa/tasks/rbd_fio.py b/qa/tasks/rbd_fio.py index 74c849b78abe9..9ff7deb32eaa4 100644 --- a/qa/tasks/rbd_fio.py +++ b/qa/tasks/rbd_fio.py @@ -133,13 +133,13 @@ def run_fio(remote, config, rbd_test_dir): rbd_name = 'i{i}f{f}{sn}'.format(i=frmt,f=feature_name,sn=sn) rbd_snap_name = 'i{i}f{f}{sn}@i{i}f{f}{sn}Snap'.format(i=frmt,f=feature_name,sn=sn) rbd_clone_name = 'i{i}f{f}{sn}Clone'.format(i=frmt,f=feature_name,sn=sn) - create_args=['sudo', 'rbd', 'create', + create_args=['rbd', 'create', '--size', '{size}'.format(size=image_size), '--image', rbd_name, '--image-format', '{f}'.format(f=frmt)] map(lambda x: create_args.extend(['--image-feature', x]), feature) remote.run(args=create_args) - remote.run(args=['sudo', 'rbd', 'info', rbd_name]) + remote.run(args=['rbd', 'info', rbd_name]) if ioengine != 'rbd': out=StringIO.StringIO() remote.run(args=['sudo', 'rbd', 'map', rbd_name ],stdout=out) @@ -147,9 +147,9 @@ def run_fio(remote, config, rbd_test_dir): rbd_dev=dev.group(1) if config.get('test-clone-io'): log.info("Testing clones using fio") - remote.run(args=['sudo', 'rbd', 'snap', 'create', rbd_snap_name]) - remote.run(args=['sudo', 'rbd', 'snap', 'protect', rbd_snap_name]) - remote.run(args=['sudo', 'rbd', 'clone', rbd_snap_name, rbd_clone_name]) + remote.run(args=['rbd', 'snap', 'create', rbd_snap_name]) + remote.run(args=['rbd', 'snap', 'protect', rbd_snap_name]) + remote.run(args=['rbd', 'clone', rbd_snap_name, rbd_clone_name]) remote.run(args=['sudo', 'rbd', 'map', rbd_clone_name], stdout=out) dev=re.search(r'(/dev/rbd\d+)',out.getvalue()) rbd_clone_dev=dev.group(1) @@ -167,9 +167,9 @@ def run_fio(remote, config, rbd_test_dir): else: if config.get('test-clone-io'): log.info("Testing clones using fio") - remote.run(args=['sudo', 'rbd', 'snap', 'create', rbd_snap_name]) - remote.run(args=['sudo', 'rbd', 'snap', 'protect', rbd_snap_name]) - remote.run(args=['sudo', 'rbd', 'clone', rbd_snap_name, rbd_clone_name]) + remote.run(args=['rbd', 'snap', 'create', rbd_snap_name]) + remote.run(args=['rbd', 'snap', 'protect', rbd_snap_name]) + remote.run(args=['rbd', 'clone', rbd_snap_name, rbd_clone_name]) fio_config.write('[{img_name}]\n'.format(img_name=rbd_name)) if config.get('rw'): rw=config['rw'] @@ -192,9 +192,9 @@ def run_fio(remote, config, rbd_test_dir): remote.run(args=['cd' , run.Raw(rbd_test_dir), run.Raw(';'), 'wget' , fio , run.Raw(';'), run.Raw('tar -xvf fio*tar.gz'), run.Raw(';'), run.Raw('cd fio-fio*'), 'configure', run.Raw(';') ,'make']) - remote.run(args=['sudo', 'ceph', '-s']) + remote.run(args=['ceph', '-s']) remote.run(args=['sudo', run.Raw('{tdir}/fio-fio-{v}/fio {f}'.format(tdir=rbd_test_dir,v=fio_version,f=fio_config.name))]) - remote.run(args=['sudo', 'ceph', '-s']) + remote.run(args=['ceph', '-s']) finally: log.info("Cleaning up fio install") remote.run(args=['rm','-rf', run.Raw(rbd_test_dir)]) -- 2.39.5