From c23b6db264bf1a268ac8d50da5b2278081334e2e Mon Sep 17 00:00:00 2001 From: Kota Tsuyuzaki Date: Wed, 7 Jun 2017 00:44:41 -0700 Subject: [PATCH] Use config_number method instead of node_id + 1 Change-Id: I596a2ac947f7e5f9c0cb3286779ece5e40feefd0 --- test/probe/test_container_merge_policy_index.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/probe/test_container_merge_policy_index.py b/test/probe/test_container_merge_policy_index.py index 570ad0f9..96ef1f72 100644 --- a/test/probe/test_container_merge_policy_index.py +++ b/test/probe/test_container_merge_policy_index.py @@ -396,11 +396,11 @@ class TestContainerMergePolicyIndex(ReplProbeTest): (node, direct_client.direct_head_container( node, container_part, self.account, self.container_name)) for node in container_nodes] - old_container_node_ids = [ - node['id'] for node, metadata in head_responses + old_container_nodes = [ + node for node, metadata in head_responses if int(old_policy) == int(metadata['X-Backend-Storage-Policy-Index'])] - self.assertEqual(2, len(old_container_node_ids)) + self.assertEqual(2, len(old_container_nodes)) # hopefully memcache still has the new policy cached self.brain.put_object(headers={'x-object-meta-test': 'custom-meta'}, @@ -425,7 +425,8 @@ class TestContainerMergePolicyIndex(ReplProbeTest): # and get rows enqueued from old nodes for server_type in ('container-replicator', 'container-updater'): server = Manager([server_type]) - tuple(server.once(number=n + 1) for n in old_container_node_ids) + for node in old_container_nodes: + server.once(number=self.config_number(node)) # verify entry in the queue for the "misplaced" new_policy for container in int_client.iter_containers('.misplaced_objects'):