mempages=[], pinned_cpus=set([]), siblings=[]), objects.NUMACell(id=1, cpuset=set([3, 4]), memory=512, cpu_usage=0, memory_usage=0, mempages=[], pinned_cpus=set([]), siblings=[]) ]) fake_numa_topology_db_format = fake_numa_topology._to_json() fake_supported_instances = [('x86_64', 'kvm', 'hvm')] fake_hv_spec = hv_spec.HVSpec(arch=fake_supported_instances[0][0], hv_type=fake_supported_instances[0][1], vm_mode=fake_supported_instances[0][2]) fake_supported_hv_specs = [fake_hv_spec] # for backward compatibility, each supported instance object # is stored as a list in the database fake_supported_hv_specs_db_format = jsonutils.dumps([fake_hv_spec.to_list()]) fake_pci = jsonutils.dumps(fake_pci_device_pools.fake_pool_list_primitive) fake_compute_node = { 'created_at': NOW, 'updated_at': None, 'deleted_at': None, 'deleted': False, 'id': 123, 'uuid': uuidsentinel.fake_compute_node, 'service_id': None, 'host': 'fake',
from nova.objects import service from nova.tests.unit.objects import test_objects from nova.virt import hardware NOW = timeutils.utcnow().replace(microsecond=0) fake_stats = {'num_foo': '10'} fake_stats_db_format = jsonutils.dumps(fake_stats) # host_ip is coerced from a string to an IPAddress # but needs to be converted to a string for the database format fake_host_ip = '127.0.0.1' fake_numa_topology = hardware.VirtNUMAHostTopology(cells=[ hardware.VirtNUMATopologyCellUsage(0, set([1, 2]), 512), hardware.VirtNUMATopologyCellUsage(1, set([3, 4]), 512) ]) fake_numa_topology_db_format = fake_numa_topology.to_json() fake_hv_spec = hv_spec.HVSpec(arch='foo', hv_type='bar', vm_mode='foobar') fake_supported_hv_specs = [fake_hv_spec] # for backward compatibility, each supported instance object # is stored as a list in the database fake_supported_hv_specs_db_format = jsonutils.dumps([fake_hv_spec.to_list()]) fake_compute_node = { 'created_at': NOW, 'updated_at': None, 'deleted_at': None, 'deleted': False, 'id': 123, 'service_id': 456, 'vcpus': 4, 'memory_mb': 4096, 'local_gb': 1024, 'vcpus_used': 2,
cpu_usage=0, memory_usage=0, mempages=[], pinned_cpus=set([]), siblings=[]), objects.NUMACell(id=1, cpuset=set([3, 4]), memory=512, cpu_usage=0, memory_usage=0, mempages=[], pinned_cpus=set([]), siblings=[]) ]) fake_numa_topology_db_format = fake_numa_topology._to_json() fake_hv_spec = hv_spec.HVSpec(arch='x86_64', hv_type='kvm', vm_mode='hvm') fake_supported_hv_specs = [fake_hv_spec] # for backward compatibility, each supported instance object # is stored as a list in the database fake_supported_hv_specs_db_format = jsonutils.dumps([fake_hv_spec.to_list()]) fake_pci = jsonutils.dumps(fake_pci_device_pools.fake_pool_list_primitive) fake_compute_node = { 'created_at': NOW, 'updated_at': None, 'deleted_at': None, 'deleted': False, 'id': 123, 'service_id': 456, 'host': 'fake', 'vcpus': 4, 'memory_mb': 4096,