Skip to content

Commit

Permalink
Merge remote-tracking branch 'gh/next'
Browse files Browse the repository at this point in the history
Conflicts:
	configure.ac
	src/ceph.in
	src/pybind/ceph_argparse.py
  • Loading branch information
Sage Weil committed Jul 25, 2013
2 parents 78214af + 870c474 commit ddaf6d5
Show file tree
Hide file tree
Showing 17 changed files with 234 additions and 135 deletions.
1 change: 1 addition & 0 deletions ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ License: LGPL-2.0
Requires: librados2 = %{version}-%{release}
Requires: librbd1 = %{version}-%{release}
Requires: libcephfs1 = %{version}-%{release}
Requires: python-flask
%if 0%{defined suse_version}
%py_requires
%endif
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AC_PREREQ(2.59)
# VERSION define is not used by the code. It gets a version string
# from 'git describe'; see src/ceph_ver.[ch]

AC_INIT([ceph], [0.66], [[email protected]])
AC_INIT([ceph], [0.67], [[email protected]])

# Create release string. Used with VERSION for RPMs.
RPM_RELEASE=0
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ceph (0.67-rc2-1) precise; urgency=low

* New upstream release

-- Gary Lowell <[email protected]> Wed, 24 Jul 2013 16:18:33 -0700

ceph (0.67-rc1-1) precise; urgency=low

* New upstream release
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Description: Ceph test and benchmarking tools.
Package: python-ceph
Architecture: linux-any
Section: python
Depends: librados2, librbd1, ${misc:Depends}, ${python:Depends}
Depends: librados2, librbd1, python-flask, ${misc:Depends}, ${python:Depends}
X-Python-Version: >= 2.6
Description: Python libraries for the Ceph distributed filesystem
Ceph is a distributed storage and network file system designed to provide
Expand Down
115 changes: 58 additions & 57 deletions qa/workunits/rest/test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/python

import exceptions
import json
import os
# import nosetests
import requests
import subprocess
import sys
Expand Down Expand Up @@ -43,9 +43,10 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):

if contenttype.startswith('application'):
if r_contenttype == 'application/json':
# may raise
try:
assert(r.json != None)
# older requests.py doesn't create r.myjson; create it myself
r.myjson = json.loads(r.content)
assert(r.myjson != None)
except Exception as e:
fail(r, 'Invalid JSON returned: "{0}"'.format(str(e)))

Expand Down Expand Up @@ -83,7 +84,7 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
assert('client.xx' in r.content)

r = expect('auth/list.json', 'GET', 200, 'json')
dictlist = r.json['output']['auth_dump']
dictlist = r.myjson['output']['auth_dump']
xxdict = [d for d in dictlist if d['entity'] == 'client.xx'][0]
assert(xxdict)
assert('caps' in xxdict)
Expand All @@ -97,7 +98,7 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
expect('auth/caps?entity=client.xx&caps=osd&caps=allow rw', 'PUT', 200,
'json', JSONHDR)
r = expect('auth/list.json', 'GET', 200, 'json')
dictlist = r.json['output']['auth_dump']
dictlist = r.myjson['output']['auth_dump']
xxdict = [d for d in dictlist if d['entity'] == 'client.xx'][0]
assert(xxdict)
assert('caps' in xxdict)
Expand All @@ -116,20 +117,20 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
expect('auth/del?entity=client.xx', 'PUT', 200, 'json', JSONHDR)

r = expect('osd/dump', 'GET', 200, 'json', JSONHDR)
assert('epoch' in r.json['output'])
assert('epoch' in r.myjson['output'])

assert('GLOBAL' in expect('df', 'GET', 200, 'plain').content)
assert('CATEGORY' in expect('df?detail=detail', 'GET', 200, 'plain').content)
# test param with no value (treated as param=param)
assert('CATEGORY' in expect('df?detail', 'GET', 200, 'plain').content)

r = expect('df', 'GET', 200, 'json', JSONHDR)
assert('total_used' in r.json['output']['stats'])
assert('total_used' in r.myjson['output']['stats'])
r = expect('df', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/stats/stats/total_used') is not None)

r = expect('df?detail', 'GET', 200, 'json', JSONHDR)
assert('rd_kb' in r.json['output']['pools'][0]['stats'])
assert('rd_kb' in r.myjson['output']['pools'][0]['stats'])
r = expect('df?detail', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/stats/pools/pool/stats/rd_kb') is not None)

Expand All @@ -149,16 +150,16 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
expect('mds/compat/rm_incompat?feature=4', 'PUT', 200, '')

r = expect('mds/compat/show', 'GET', 200, 'json', JSONHDR)
assert('incompat' in r.json['output'])
assert('incompat' in r.myjson['output'])
r = expect('mds/compat/show', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/mds_compat/incompat') is not None)

# EEXIST from CLI
expect('mds/deactivate?who=2', 'PUT', 400, '')

r = expect('mds/dump.json', 'GET', 200, 'json')
assert('created' in r.json['output'])
current_epoch = r.json['output']['epoch']
assert('created' in r.myjson['output'])
current_epoch = r.myjson['output']['epoch']
r = expect('mds/dump.xml', 'GET', 200, 'xml')
assert(r.tree.find('output/mdsmap/created') is not None)

Expand All @@ -171,7 +172,7 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
200, '')
expect('osd/pool/create?pool=data2&pg_num=10', 'PUT', 200, '')
r = expect('osd/dump', 'GET', 200, 'json', JSONHDR)
pools = r.json['output']['pools']
pools = r.myjson['output']['pools']
poolnum = None
for p in pools:
if p['pool_name'] == 'data2':
Expand All @@ -185,10 +186,10 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
'&sure=--yes-i-really-really-mean-it', 'PUT', 200, '')
expect('mds/set_max_mds?maxmds=4', 'PUT', 200, '')
r = expect('mds/dump.json', 'GET', 200, 'json')
assert(r.json['output']['max_mds'] == 4)
assert(r.myjson['output']['max_mds'] == 4)
expect('mds/set_max_mds?maxmds=3', 'PUT', 200, '')
r = expect('mds/stat.json', 'GET', 200, 'json')
assert('info' in r.json['output']['mdsmap'])
assert('info' in r.myjson['output']['mdsmap'])
r = expect('mds/stat.xml', 'GET', 200, 'xml')
assert(r.tree.find('output/mds_stat/mdsmap/info') is not None)

Expand All @@ -199,17 +200,17 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
r = expect('mon/getmap', 'GET', 200, '')
assert(len(r.content) != 0)
r = expect('mon_status.json', 'GET', 200, 'json')
assert('name' in r.json['output'])
assert('name' in r.myjson['output'])
r = expect('mon_status.xml', 'GET', 200, 'xml')
assert(r.tree.find('output/mon_status/name') is not None)

bl = '192.168.0.1:0/1000'
expect('osd/blacklist?blacklistop=add&addr=' + bl, 'PUT', 200, '')
r = expect('osd/blacklist/ls.json', 'GET', 200, 'json')
assert([b for b in r.json['output'] if b['addr'] == bl])
assert([b for b in r.myjson['output'] if b['addr'] == bl])
expect('osd/blacklist?blacklistop=rm&addr=' + bl, 'PUT', 200, '')
r = expect('osd/blacklist/ls.json', 'GET', 200, 'json')
assert([b for b in r.json['output'] if b['addr'] == bl] == [])
assert([b for b in r.myjson['output'] if b['addr'] == bl] == [])

expect('osd/crush/tunables?profile=legacy', 'PUT', 200, '')
expect('osd/crush/tunables?profile=bobtail', 'PUT', 200, '')
Expand All @@ -222,73 +223,73 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):

expect('osd/down?ids=0', 'PUT', 200, '')
r = expect('osd/dump', 'GET', 200, 'json', JSONHDR)
assert(r.json['output']['osds'][0]['osd'] == 0)
assert(r.json['output']['osds'][0]['up'] == 0)
assert(r.myjson['output']['osds'][0]['osd'] == 0)
assert(r.myjson['output']['osds'][0]['up'] == 0)

expect('osd/unset?key=noup', 'PUT', 200, '')

for i in range(0,100):
r = expect('osd/dump', 'GET', 200, 'json', JSONHDR)
assert(r.json['output']['osds'][0]['osd'] == 0)
if r.json['output']['osds'][0]['up'] == 1:
assert(r.myjson['output']['osds'][0]['osd'] == 0)
if r.myjson['output']['osds'][0]['up'] == 1:
break
else:
print >> sys.stderr, "waiting for osd.0 to come back up"
time.sleep(10)

r = expect('osd/dump', 'GET', 200, 'json', JSONHDR)
assert(r.json['output']['osds'][0]['osd'] == 0)
assert(r.json['output']['osds'][0]['up'] == 1)
assert(r.myjson['output']['osds'][0]['osd'] == 0)
assert(r.myjson['output']['osds'][0]['up'] == 1)

r = expect('osd/find?id=1', 'GET', 200, 'json', JSONHDR)
assert(r.json['output']['osd'] == 1)
assert(r.myjson['output']['osd'] == 1)

expect('osd/out?ids=1', 'PUT', 200, '')
r = expect('osd/dump', 'GET', 200, 'json', JSONHDR)
assert(r.json['output']['osds'][1]['osd'] == 1)
assert(r.json['output']['osds'][1]['in'] == 0)
assert(r.myjson['output']['osds'][1]['osd'] == 1)
assert(r.myjson['output']['osds'][1]['in'] == 0)

expect('osd/in?ids=1', 'PUT', 200, '')
r = expect('osd/dump', 'GET', 200, 'json', JSONHDR)
assert(r.json['output']['osds'][1]['osd'] == 1)
assert(r.json['output']['osds'][1]['in'] == 1)
assert(r.myjson['output']['osds'][1]['osd'] == 1)
assert(r.myjson['output']['osds'][1]['in'] == 1)

r = expect('osd/find?id=0', 'GET', 200, 'json', JSONHDR)
assert(r.json['output']['osd'] == 0)
assert(r.myjson['output']['osd'] == 0)

r = expect('osd/getmaxosd', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/getmaxosd/max_osd') is not None)
r = expect('osd/getmaxosd', 'GET', 200, 'json', JSONHDR)
saved_maxosd = r.json['output']['max_osd']
saved_maxosd = r.myjson['output']['max_osd']
expect('osd/setmaxosd?newmax=10', 'PUT', 200, '')
r = expect('osd/getmaxosd', 'GET', 200, 'json', JSONHDR)
assert(r.json['output']['max_osd'] == 10)
assert(r.myjson['output']['max_osd'] == 10)
expect('osd/setmaxosd?newmax={0}'.format(saved_maxosd), 'PUT', 200, '')
r = expect('osd/getmaxosd', 'GET', 200, 'json', JSONHDR)
assert(r.json['output']['max_osd'] == saved_maxosd)
assert(r.myjson['output']['max_osd'] == saved_maxosd)

r = expect('osd/create', 'PUT', 200, 'json', JSONHDR)
assert('osdid' in r.json['output'])
osdid = r.json['output']['osdid']
assert('osdid' in r.myjson['output'])
osdid = r.myjson['output']['osdid']
expect('osd/lost?id={0}'.format(osdid), 'PUT', 400, '')
expect('osd/lost?id={0}&sure=--yes-i-really-mean-it'.format(osdid),
'PUT', 200, 'json', JSONHDR)
expect('osd/rm?ids={0}'.format(osdid), 'PUT', 200, '')
r = expect('osd/ls', 'GET', 200, 'json', JSONHDR)
assert(isinstance(r.json['output'], list))
assert(isinstance(r.myjson['output'], list))
r = expect('osd/ls', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/osds/osd') is not None)


expect('osd/pause', 'PUT', 200, '')
r = expect('osd/dump', 'GET', 200, 'json', JSONHDR)
assert('pauserd,pausewr' in r.json['output']['flags'])
assert('pauserd,pausewr' in r.myjson['output']['flags'])
expect('osd/unpause', 'PUT', 200, '')
r = expect('osd/dump', 'GET', 200, 'json', JSONHDR)
assert('pauserd,pausewr' not in r.json['output']['flags'])
assert('pauserd,pausewr' not in r.myjson['output']['flags'])

r = expect('osd/tree', 'GET', 200, 'json', JSONHDR)
assert('nodes' in r.json['output'])
assert('nodes' in r.myjson['output'])
r = expect('osd/tree', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/tree/nodes') is not None)
expect('osd/pool/mksnap?pool=data&snap=datasnap', 'PUT', 200, '')
Expand All @@ -297,21 +298,21 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
expect('osd/pool/rmsnap?pool=data&snap=datasnap', 'PUT', 200, '')

expect('osd/pool/create?pool=data2&pg_num=10', 'PUT', 200, '')
r = expect('osd/lspools', 'PUT', 200, 'json', JSONHDR)
assert([p for p in r.json['output'] if p['poolname'] == 'data2'])
r = expect('osd/lspools', 'GET', 200, 'json', JSONHDR)
assert([p for p in r.myjson['output'] if p['poolname'] == 'data2'])
expect('osd/pool/rename?srcpool=data2&destpool=data3', 'PUT', 200, '')
r = expect('osd/lspools', 'PUT', 200, 'json', JSONHDR)
assert([p for p in r.json['output'] if p['poolname'] == 'data3'])
r = expect('osd/lspools', 'GET', 200, 'json', JSONHDR)
assert([p for p in r.myjson['output'] if p['poolname'] == 'data3'])
expect('osd/pool/delete?pool=data3', 'PUT', 400, '')
expect('osd/pool/delete?pool=data3&pool2=data3&sure=--yes-i-really-really-mean-it', 'PUT', 200, '')

r = expect('osd/stat', 'GET', 200, 'json', JSONHDR)
assert('num_up_osds' in r.json['output'])
assert('num_up_osds' in r.myjson['output'])
r = expect('osd/stat', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/osdmap/num_up_osds') is not None)

r = expect('osd/ls', 'GET', 200, 'json', JSONHDR)
for osdid in r.json['output']:
for osdid in r.myjson['output']:
# XXX no tell yet
# expect('tell?target=osd.{0}&args=version'.format(osdid), 'PUT',
# 200, '')
Expand All @@ -321,7 +322,7 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
expect('pg/debug?debugop=degraded_pgs_exist', 'GET', 200, '')
expect('pg/deep-scrub?pgid=0.0', 'PUT', 200, '')
r = expect('pg/dump', 'GET', 200, 'json', JSONHDR)
assert('pg_stats_sum' in r.json['output'])
assert('pg_stats_sum' in r.myjson['output'])
r = expect('pg/dump', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/pg_map/pg_stats_sum') is not None)

Expand All @@ -335,8 +336,8 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
assert(len(r.content) != 0)

r = expect('pg/map?pgid=0.0', 'GET', 200, 'json', JSONHDR)
assert('acting' in r.json['output'])
assert(r.json['output']['pgid'] == '0.0')
assert('acting' in r.myjson['output'])
assert(r.myjson['output']['pgid'] == '0.0')
r = expect('pg/map?pgid=0.0', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/pg_map/acting') is not None)
assert(r.tree.find('output/pg_map/pgid').text == '0.0')
Expand All @@ -348,15 +349,15 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):

expect('pg/set_full_ratio?ratio=0.90', 'PUT', 200, '')
r = expect('pg/dump', 'GET', 200, 'json', JSONHDR)
assert(float(r.json['output']['full_ratio']) == 0.90)
assert(float(r.myjson['output']['full_ratio']) == 0.90)
expect('pg/set_full_ratio?ratio=0.95', 'PUT', 200, '')
expect('pg/set_nearfull_ratio?ratio=0.90', 'PUT', 200, '')
r = expect('pg/dump', 'GET', 200, 'json', JSONHDR)
assert(float(r.json['output']['near_full_ratio']) == 0.90)
assert(float(r.myjson['output']['near_full_ratio']) == 0.90)
expect('pg/set_full_ratio?ratio=0.85', 'PUT', 200, '')

r = expect('pg/stat', 'GET', 200, 'json', JSONHDR)
assert('pg_stats_sum' in r.json['output'])
assert('pg_stats_sum' in r.myjson['output'])
r = expect('pg/stat', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/pg_map/pg_stats_sum') is not None)

Expand All @@ -367,12 +368,12 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):

# report's CRC needs to be handled
# r = expect('report', 'GET', 200, 'json', JSONHDR)
# assert('osd_stats' in r.json['output'])
# assert('osd_stats' in r.myjson['output'])
# r = expect('report', 'GET', 200, 'xml', XMLHDR)
# assert(r.tree.find('output/report/osdmap') is not None)

r = expect('status', 'GET', 200, 'json', JSONHDR)
assert('osdmap' in r.json['output'])
assert('osdmap' in r.myjson['output'])
r = expect('status', 'GET', 200, 'xml', XMLHDR)
assert(r.tree.find('output/status/osdmap') is not None)

Expand All @@ -393,21 +394,21 @@ def expect(url, method, respcode, contenttype, extra_hdrs=None, data=None):
for v in ['pg_num', 'pgp_num', 'size', 'min_size', 'crash_replay_interval',
'crush_ruleset']:
r = expect('osd/pool/get.json?pool=data&var=' + v, 'GET', 200, 'json')
assert(v in r.json['output'])
assert(v in r.myjson['output'])

r = expect('osd/pool/get.json?pool=data&var=size', 'GET', 200, 'json')
assert(r.json['output']['size'] == 2)
assert(r.myjson['output']['size'] == 2)

expect('osd/pool/set?pool=data&var=size&val=3', 'PUT', 200, 'plain')
r = expect('osd/pool/get.json?pool=data&var=size', 'GET', 200, 'json')
assert(r.json['output']['size'] == 3)
assert(r.myjson['output']['size'] == 3)

expect('osd/pool/set?pool=data&var=size&val=2', 'PUT', 200, 'plain')
r = expect('osd/pool/get.json?pool=data&var=size', 'GET', 200, 'json')
assert(r.json['output']['size'] == 2)
assert(r.myjson['output']['size'] == 2)

r = expect('osd/pool/get.json?pool=rbd&var=crush_ruleset', 'GET', 200, 'json')
assert(r.json['output']['crush_ruleset'] == 2)
assert(r.myjson['output']['crush_ruleset'] == 2)

expect('osd/thrash?num_epochs=10', 'PUT', 200, '')
print 'OK'
8 changes: 4 additions & 4 deletions src/ceph-disk
Original file line number Diff line number Diff line change
Expand Up @@ -1960,7 +1960,7 @@ def main_list(args):
journal_map = {}
for base, parts in sorted(partmap.iteritems()):
for p in parts:
dev = '/dev/' + p
dev = get_dev_path(p)
part_uuid = get_partition_uuid(dev)
if part_uuid:
uuid_map[part_uuid] = dev
Expand All @@ -1980,11 +1980,11 @@ def main_list(args):

for base, parts in sorted(partmap.iteritems()):
if parts:
print '/dev/%s :' % base
print '%s :' % get_dev_path(base)
for p in sorted(parts):
list_dev('/dev/' + p, uuid_map, journal_map)
list_dev(get_dev_path(p), uuid_map, journal_map)
else:
list_dev('/dev/' + base, uuid_map, journal_map)
list_dev(get_dev_path(base), uuid_map, journal_map)


###########################
Expand Down
Loading

0 comments on commit ddaf6d5

Please sign in to comment.