'Test that when normalizing the return from Ironic virt driver\'s
get_inventory() method, we don\'t overwrite the information that the
virt driver gave us.'

def test_normalize_ironic(self):

    self.flags(reserved_host_disk_mb=100, reserved_host_memory_mb=10, reserved_host_cpus=1)
    vcpus = 24
    memory_mb = 1024
    disk_gb = 200
    cn = objects.ComputeNode(mock.sentinel.ctx, ram_allocation_ratio=1.5, cpu_allocation_ratio=16.0, disk_allocation_ratio=1.0)
    inv = {obj_fields.ResourceClass.VCPU: {'total': vcpus, 'reserved': 0, 'min_unit': 1, 'max_unit': vcpus, 'step_size': 1, 'allocation_ratio': 1.0}, obj_fields.ResourceClass.MEMORY_MB: {'total': memory_mb, 'reserved': 0, 'min_unit': 1, 'max_unit': memory_mb, 'step_size': 1, 'allocation_ratio': 1.0}, obj_fields.ResourceClass.DISK_GB: {'total': disk_gb, 'reserved': 0, 'min_unit': 1, 'max_unit': disk_gb, 'step_size': 1, 'allocation_ratio': 1.0}}
    expected = copy.deepcopy(inv)
    resource_tracker._normalize_inventory_from_cn_obj(inv, cn)
    self.assertEqual(expected, inv)
