2 Run fsx on an rbd image
7 from teuthology.parallel import parallel
8 from teuthology import misc as teuthology
10 log = logging.getLogger(__name__)
12 @contextlib.contextmanager
13 def task(ctx, config):
15 Run fsx on an rbd image.
17 Currently this requires running as client.admin
20 Specify which clients to run on as a list::
25 clients: [client.0, client.1]
27 You can optionally change some properties of fsx:
32 clients: <list of clients>
33 seed: <random seed number, or 0 to use the time>
34 ops: <number of operations to do>
35 size: <maximum image size in bytes>
36 valgrind: [--tool=<valgrind tool>]
38 log.info('starting rbd_fsx...')
40 for role in config['clients']:
41 p.spawn(_run_one_client, ctx, config, role)
44 def _run_one_client(ctx, config, role):
45 """Spawned task that runs the client"""
46 krbd = config.get('krbd', False)
47 nbd = config.get('nbd', False)
48 testdir = teuthology.get_testdir(ctx)
49 (remote,) = ctx.cluster.only(role).remotes.iterkeys()
53 args.append('sudo') # rbd(-nbd) map/unmap need privileges
57 '{tdir}/archive/coverage'.format(tdir=testdir)
60 overrides = ctx.config.get('overrides', {})
61 teuthology.deep_merge(config, overrides.get('rbd_fsx', {}))
63 if config.get('valgrind'):
64 args = teuthology.get_valgrind_args(
66 'fsx_{id}'.format(id=role),
68 config.get('valgrind')
72 'ceph_test_librbd_fsx',
73 '-d', # debug output for all operations
74 '-W', '-R', # mmap doesn't work with rbd
75 '-p', str(config.get('progress_interval', 100)), # show progress
76 '-P', '{tdir}/archive'.format(tdir=testdir),
77 '-r', str(config.get('readbdy',1)),
78 '-w', str(config.get('writebdy',1)),
79 '-t', str(config.get('truncbdy',1)),
80 '-h', str(config.get('holebdy',1)),
81 '-l', str(config.get('size', 250000000)),
82 '-S', str(config.get('seed', 0)),
83 '-N', str(config.get('ops', 1000)),
86 args.append('-K') # -K enables krbd mode
88 args.append('-M') # -M enables nbd mode
89 if config.get('direct_io', False):
90 args.append('-Z') # -Z use direct IO
91 if not config.get('randomized_striping', True):
92 args.append('-U') # -U disables randomized striping
93 if not config.get('punch_holes', True):
94 args.append('-H') # -H disables discard ops
95 if config.get('journal_replay', False):
96 args.append('-j') # -j replay all IO events from journal
98 'pool_{pool}'.format(pool=role),
99 'image_{image}'.format(image=role),
102 remote.run(args=args)