]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/rbd_fsx.py
2 Run fsx on an rbd image
7 from teuthology
.exceptions
import ConfigError
8 from teuthology
.parallel
import parallel
9 from teuthology
import misc
as teuthology
10 from tasks
.ceph_manager
import get_valgrind_args
12 log
= logging
.getLogger(__name__
)
14 @contextlib.contextmanager
15 def task(ctx
, config
):
17 Run fsx on an rbd image.
19 Currently this requires running as client.admin
22 Specify which clients to run on as a list::
27 clients: [client.0, client.1]
29 You can optionally change some properties of fsx:
34 clients: <list of clients>
35 seed: <random seed number, or 0 to use the time>
36 ops: <number of operations to do>
37 size: <maximum image size in bytes>
38 valgrind: [--tool=<valgrind tool>]
40 log
.info('starting rbd_fsx...')
42 for role
in config
['clients']:
43 p
.spawn(_run_one_client
, ctx
, config
, role
)
46 def _run_one_client(ctx
, config
, role
):
47 """Spawned task that runs the client"""
48 krbd
= config
.get('krbd', False)
49 nbd
= config
.get('nbd', False)
50 testdir
= teuthology
.get_testdir(ctx
)
51 (remote
,) = ctx
.cluster
.only(role
).remotes
.keys()
55 args
.append('sudo') # rbd(-nbd) map/unmap need privileges
59 '{tdir}/archive/coverage'.format(tdir
=testdir
)
62 overrides
= ctx
.config
.get('overrides', {})
63 teuthology
.deep_merge(config
, overrides
.get('rbd_fsx', {}))
65 if config
.get('valgrind'):
66 args
= get_valgrind_args(
68 'fsx_{id}'.format(id=role
),
70 config
.get('valgrind')
73 cluster_name
, type_
, client_id
= teuthology
.split_role(role
)
75 msg
= 'client role ({0}) must be a client'.format(role
)
76 raise ConfigError(msg
)
79 'ceph_test_librbd_fsx',
80 '--cluster', cluster_name
,
82 '-d', # debug output for all operations
83 '-W', '-R', # mmap doesn't work with rbd
84 '-p', str(config
.get('progress_interval', 100)), # show progress
85 '-P', '{tdir}/archive'.format(tdir
=testdir
),
86 '-r', str(config
.get('readbdy',1)),
87 '-w', str(config
.get('writebdy',1)),
88 '-t', str(config
.get('truncbdy',1)),
89 '-h', str(config
.get('holebdy',1)),
90 '-l', str(config
.get('size', 250000000)),
91 '-S', str(config
.get('seed', 0)),
92 '-N', str(config
.get('ops', 1000)),
95 args
.append('-K') # -K enables krbd mode
97 args
.append('-M') # -M enables nbd mode
98 if config
.get('direct_io', False):
99 args
.append('-Z') # -Z use direct IO
100 if not config
.get('randomized_striping', True):
101 args
.append('-U') # -U disables randomized striping
102 if not config
.get('punch_holes', True):
103 args
.append('-H') # -H disables discard ops
104 if config
.get('deep_copy', False):
105 args
.append('-g') # -g deep copy instead of clone
106 if config
.get('journal_replay', False):
107 args
.append('-j') # -j replay all IO events from journal
108 if config
.get('keep_images', False):
109 args
.append('-k') # -k keep images on success
111 config
.get('pool_name', 'pool_{pool}'.format(pool
=role
)),
112 'image_{image}'.format(image
=role
),
115 remote
.run(args
=args
)