mdsmapfile=$TMPDIR/mdsmap.$$
current_epoch=$(ceph mds getmap -o $mdsmapfile --no-log-to-stderr 2>&1 | grep epoch | sed 's/.*epoch //')
[ -s $mdsmapfile ]
- ((epoch = current_epoch + 1))
- ceph mds setmap -i $mdsmapfile $epoch
rm $mdsmapfile
ceph osd pool create data2 10
r = expect('mds/dump.xml', 'GET', 200, 'xml')
assert(r.tree.find('output/mdsmap/created') is not None)
- failresps = []
- while len(failresps) < 10:
- r = expect('mds/dump.json', 'GET', 200, 'json')
- assert('created' in r.myjson['output'])
- current_epoch = r.myjson['output']['epoch']
-
- map = expect('mds/getmap', 'GET', 200, '')
- assert(len(map.content) != 0)
- msg, r = expect_nofail(
- 'mds/setmap?epoch={0}'.format(current_epoch + 1), 'PUT', 200,
- 'plain', {'Content-Type':'text/plain'}, data=map.content
- )
- if msg:
- failresps.append(msg + r.content)
- else:
- break
-
- if len(failresps) == 10:
- fail(r, 'Could not mds setmap in 10 tries; responses:' +
- '\n'.join(failresps))
expect('mds/newfs?metadata=0&data=1&sure=--yes-i-really-mean-it', 'PUT',
200, '')
expect('osd/pool/create?pool=data2&pg_num=10', 'PUT', 200, '')