2012-04-12 01:03:44 +00:00
|
|
|
import contextlib
|
|
|
|
import logging
|
|
|
|
|
|
|
|
from teuthology.parallel import parallel
|
2013-01-23 20:37:39 +00:00
|
|
|
from teuthology import misc as teuthology
|
2012-04-12 01:03:44 +00:00
|
|
|
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
@contextlib.contextmanager
|
|
|
|
def task(ctx, config):
|
|
|
|
"""
|
|
|
|
Run fsx on an rbd image.
|
|
|
|
|
|
|
|
Currently this requires running as client.admin
|
|
|
|
to create a pool.
|
|
|
|
|
|
|
|
Specify which clients to run on as a list::
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
ceph:
|
|
|
|
rbd_fsx:
|
|
|
|
clients: [client.0, client.1]
|
|
|
|
|
|
|
|
You can optionally change some properties of fsx:
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
ceph:
|
|
|
|
rbd_fsx:
|
|
|
|
clients: <list of clients>
|
|
|
|
seed: <random seed number, or 0 to use the time>
|
|
|
|
ops: <number of operations to do>
|
|
|
|
size: <maximum image size in bytes>
|
|
|
|
"""
|
|
|
|
log.info('starting rbd_fsx...')
|
|
|
|
with parallel() as p:
|
|
|
|
for role in config['clients']:
|
|
|
|
p.spawn(_run_one_client, ctx, config, role)
|
|
|
|
yield
|
|
|
|
|
|
|
|
def _run_one_client(ctx, config, role):
|
2013-01-23 20:37:39 +00:00
|
|
|
testdir = teuthology.get_testdir(ctx)
|
2012-04-12 01:03:44 +00:00
|
|
|
(remote,) = ctx.cluster.only(role).remotes.iterkeys()
|
|
|
|
remote.run(
|
|
|
|
args=[
|
2013-01-23 20:37:39 +00:00
|
|
|
'CEPH_CONF={tdir}/ceph.conf'.format(tdir=testdir),
|
|
|
|
'LD_LIBRARY_PATH={tdir}/binary/usr/local/lib'.format(tdir=testdir),
|
|
|
|
'{tdir}/enable-coredump'.format(tdir=testdir),
|
|
|
|
'{tdir}/binary/usr/local/bin/ceph-coverage'.format(tdir=testdir),
|
|
|
|
'{tdir}/archive/coverage'.format(tdir=testdir),
|
|
|
|
'{tdir}/binary/usr/local/bin/test_librbd_fsx'.format(tdir=testdir),
|
2012-04-12 01:03:44 +00:00
|
|
|
'-d',
|
|
|
|
'-W', '-R', # mmap doesn't work with rbd
|
2012-04-19 20:32:01 +00:00
|
|
|
'-p', str(config.get('progress_interval', 100)), # show progress
|
2013-01-23 20:37:39 +00:00
|
|
|
'-P', '{tdir}/archive'.format(tdir=testdir),
|
2012-05-06 04:22:30 +00:00
|
|
|
'-t', str(config.get('truncbdy',1)),
|
2012-04-12 01:03:44 +00:00
|
|
|
'-l', str(config.get('size', 1073741824)),
|
|
|
|
'-S', str(config.get('seed', 0)),
|
|
|
|
'-N', str(config.get('ops', 1000)),
|
|
|
|
'pool_{pool}'.format(pool=role),
|
|
|
|
'image_{image}'.format(image=role),
|
|
|
|
],
|
|
|
|
)
|