'Tests paging over multiple cells with a uuid marker.
This test is going to setup three compute nodes in two cells for a
total of six compute nodes. Then it will page over them with a limit
of two so there should be three pages total.'

def test_compute_node_get_all_uuid_marker(self):

    count = 0
    for cell in self.cell_mappings[1:]:
        for x in range(3):
            compute_node_uuid = getattr(uuids, ('node_%s' % count))
            with context.target_cell(self.ctxt, cell) as cctxt:
                node = objects.ComputeNode(cctxt, uuid=compute_node_uuid, host=compute_node_uuid, vcpus=2, memory_mb=2048, local_gb=128, vcpus_used=0, memory_mb_used=0, local_gb_used=0, cpu_info='{}', hypervisor_type='fake', hypervisor_version=10)
                node.create()
                count += 1
            host_mapping = objects.HostMapping(self.ctxt, host=compute_node_uuid, cell_mapping=cell)
            host_mapping.create()
    compute_nodes = self.host_api.compute_node_get_all(self.ctxt, limit=2)
    self.assertEqual(2, len(compute_nodes))
    for compute_node in compute_nodes:
        host_mapping = objects.HostMapping.get_by_host(self.ctxt, compute_node.host)
        self.assertEqual(uuids.cell1, host_mapping.cell_mapping.uuid)
    marker = compute_nodes[(-1)].uuid
    compute_nodes = self.host_api.compute_node_get_all(self.ctxt, limit=2, marker=marker)
    self.assertEqual(2, len(compute_nodes))
    host_mapping = objects.HostMapping.get_by_host(self.ctxt, compute_nodes[0].host)
    self.assertEqual(uuids.cell1, host_mapping.cell_mapping.uuid)
    host_mapping = objects.HostMapping.get_by_host(self.ctxt, compute_nodes[1].host)
    self.assertEqual(uuids.cell2, host_mapping.cell_mapping.uuid)
    marker = compute_nodes[(-1)].uuid
    compute_nodes = self.host_api.compute_node_get_all(self.ctxt, limit=3, marker=marker)
    self.assertEqual(2, len(compute_nodes))
    for compute_node in compute_nodes:
        host_mapping = objects.HostMapping.get_by_host(self.ctxt, compute_node.host)
        self.assertEqual(uuids.cell2, host_mapping.cell_mapping.uuid)
