From c35285f14b275b22bdea27fea1643f962bfa1a1f Mon Sep 17 00:00:00 2001 From: Alistair Coles Date: Fri, 18 May 2018 22:42:18 +0100 Subject: [PATCH] Use correct policy when faking misplaced objects in probe test Before, merge_objects() always used storage policy index of 0 when inserting a fake misplaced object into a shard container. If the shard broker had a different policy index then the misplaced object would not show in listings causing test_misplaced_object_movement() to fail. This test bug might be exposed by having policy index 0 be an EC policy, since the probe test requires a replication policy and would therefore choose a non-zero policy index. The fix is simply to specify the shard's policy index when inserting the fake object. Change-Id: Iec3f8ec29950220bb1b2ead9abfdfb1a261517d6 --- test/probe/test_sharder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/probe/test_sharder.py b/test/probe/test_sharder.py index 77ee3dd35b..64758b991d 100644 --- a/test/probe/test_sharder.py +++ b/test/probe/test_sharder.py @@ -1758,7 +1758,8 @@ class TestContainerSharding(BaseTestContainerSharding): shard_broker.merge_items( [{'name': name, 'created_at': Timestamp.now().internal, 'size': 0, 'content_type': 'text/plain', - 'etag': hashlib.md5().hexdigest(), 'deleted': deleted}]) + 'etag': hashlib.md5().hexdigest(), 'deleted': deleted, + 'storage_policy_index': shard_broker.storage_policy_index}]) return shard_nodes[0] all_obj_names = self._make_object_names(self.max_shard_size)