]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/filestore_idempotent.py
2 Filestore/filejournal handler
5 from teuthology
.orchestra
import run
8 from teuthology
import misc
as teuthology
10 log
= logging
.getLogger(__name__
)
12 def task(ctx
, config
):
14 Test filestore/filejournal handling of non-idempotent events.
16 Currently this is a kludge; we require the ceph task preceeds us just
17 so that we get the tarball installed to run the test binary.
20 :param config: Configuration
22 assert config
is None or isinstance(config
, list) \
23 or isinstance(config
, dict), \
24 "task only supports a list or dictionary for configuration"
25 all_clients
= ['client.{id}'.format(id=id_
)
26 for id_
in teuthology
.all_roles_of_type(ctx
.cluster
, 'client')]
29 if isinstance(config
, list):
30 config
= dict.fromkeys(config
)
31 clients
= config
.keys()
33 # just use the first client...
35 (remote
,) = ctx
.cluster
.only(client
).remotes
.iterkeys()
37 testdir
= teuthology
.get_testdir(ctx
)
39 dir = '%s/ceph.data/test.%s' % (testdir
, client
)
41 seed
= int(random
.uniform(1,100))
42 start
= 800 + random
.randint(800,1200)
46 log
.info('creating a working dir')
47 remote
.run(args
=['mkdir', dir])
52 'wget','-q', '-Orun_seed_to.sh',
53 'http://git.ceph.com/?p=ceph.git;a=blob_plain;f=src/test/objectstore/run_seed_to.sh;hb=HEAD',
55 'wget','-q', '-Orun_seed_to_range.sh',
56 'http://git.ceph.com/?p=ceph.git;a=blob_plain;f=src/test/objectstore/run_seed_to_range.sh;hb=HEAD',
58 'chmod', '+x', 'run_seed_to.sh', 'run_seed_to_range.sh',
61 log
.info('running a series of tests')
66 './run_seed_to_range.sh', str(seed
), str(start
), str(end
),
75 'cp', '-a', dir, '{tdir}/archive/idempotent_failure'.format(tdir
=testdir
),
77 raise Exception("./run_seed_to_range.sh errored out")
81 'rm', '-rf', '--', dir