]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: ceph_objectstore_tool.py check for malformed JSON for erasure code objs
authorDavid Zafman <dzafman@redhat.com>
Sat, 15 Nov 2014 19:46:15 +0000 (11:46 -0800)
committerDavid Zafman <dzafman@redhat.com>
Tue, 3 Mar 2015 18:44:18 +0000 (10:44 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 40717aa4c399e87d2c3e32038f78788eb213f87d)

src/test/ceph_objectstore_tool.py

index 028ce09a42c43b08f18c4884144fe54222bcbc49..d28efa4d17df268886215217f64d59f9524438f8 100755 (executable)
@@ -468,6 +468,9 @@ def main(argv):
     for JSON in JSONOBJ:
         jsondict = json.loads(JSON)
         db[jsondict['namespace']][jsondict['oid']]['json'] = JSON
+        if string.find(jsondict['oid'], EC_NAME) == 0 and 'shard_id' not in jsondict:
+            logging.error("Malformed JSON {json}".format(json=JSON))
+            ERRORS += 1
 
     # Test get-bytes
     print "Test get-bytes and set-bytes"