]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
scrub_test: Fixes need with wip-13507
authorDavid Zafman <dzafman@redhat.com>
Fri, 29 Apr 2016 22:33:44 +0000 (15:33 -0700)
committerDavid Zafman <dzafman@redhat.com>
Tue, 1 Nov 2016 18:01:34 +0000 (11:01 -0700)
Accept an attribute if not present as False
Change required due change to dict with "epoch" and "inconsistents"

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 4d0c668e9eb50c2149cfe36caee37c531541d1be)

tasks/scrub_test.py

index f68cafc8ec5fc874805fea6a9e2d2c2934f20900..b4f14a483fa457f454ffe6f957d97de658c53ddd 100644 (file)
@@ -261,9 +261,8 @@ class InconsistentObjChecker:
             log.info('shard = %r' % shard)
             log.info('attr = %s' % attr_name)
             assert 'osd' in shard
-            assert attr_name in shard
             osd = shard['osd']
-            attr = shard[attr_name]
+            attr = shard.get(attr_name, False)
             if osd == self.osd:
                 assert bad_attr is None, \
                     "multiple entries found for the given OSD"
@@ -325,10 +324,10 @@ def test_list_inconsistent_obj(ctx, manager, osd_remote, pg, acting, osd_id,
             with contextlib.closing(StringIO()) as out:
                 mon.run(args=cmd.split(), stdout=out)
                 objs = json.loads(out.getvalue())
-            assert len(objs) == 1
+            assert len(objs['inconsistents']) == 1
 
             checker = InconsistentObjChecker(osd_id, acting, obj_name)
-            inc_obj = objs[0]
+            inc_obj = objs['inconsistents'][0]
             log.info('inc = %r', inc_obj)
             checker.basic_checks(inc_obj)
             for check in checks: