nova/nova/tests/unit
Balazs Gibizer ccab6fed46 Generate request_id for Flavor based InstancePCIRequest
The InstancePCIRequest.request_id is used to correlate allocated
PciDevice objects with the InstancePCIRequest object triggered the PCI
allocation. For neutron port based PCI requests the
IstancePCIRequest.request_id was already set to a generated UUID by
nova. But for Flavor based request the request_id was kept None. The
placement PCI scheduling code depends on the request_id to be a unique
identifier of the request. So this patch starts filling the request_id
for flavor based requests as well.

This change showed than in some places nova still uses the request_id ==
None condition to distinguish between flavor based and neutron based
requests. This logic is now adapted to use the newer and better
InstancePCIRequest.source based approach. Also we took the opportunity
to move the logic of querying PCI devices allocated to an instance to the
Instance ovo.

This change fills the request_id for newly created flavor based
InstancePCIRequest ovos. But the change in logic to use the
InstancePCIRequest.source property instead of the request_id == None
condition works even if the request_id is None for already existing
InstancePCIRequest objects. So this patch does not include a data
migration logic to fill request_id for existing objects.

blueprint: pci-device-tracking-in-placement
Change-Id: I53e03ff7a0221db682b043fb6d5adba3f5c9fdbe
2022-08-27 12:44:11 +02:00
..
accelerator Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
api Remove double mocking... again 2022-08-08 19:50:02 +02:00
cmd Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
compute Handle PCI dev reconf with allocations 2022-08-26 19:05:45 +02:00
conductor Avoid n-cond startup abort for keystone failures 2022-08-18 07:37:42 -07:00
conf Expose the mdev class 2021-08-27 14:52:01 +01:00
console Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
db BlockDeviceMapping: Add encryption fields 2022-08-02 21:25:47 +00:00
fake_loadables
fixtures Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
image Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
keymgr
limit Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
network Generate request_id for Flavor based InstancePCIRequest 2022-08-27 12:44:11 +02:00
notifications image_meta: Add ephemeral encryption properties 2022-08-02 21:25:47 +00:00
objects Generate request_id for Flavor based InstancePCIRequest 2022-08-27 12:44:11 +02:00
pci Generate request_id for Flavor based InstancePCIRequest 2022-08-27 12:44:11 +02:00
policies Remove system scope from all APIs 2022-08-24 13:12:16 +00:00
privsep Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
scheduler Merge "scheduler: Add an ephemeral encryption pre filter" 2022-08-19 03:47:53 +00:00
servicegroup Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
ssl_cert
storage Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
virt Generate request_id for Flavor based InstancePCIRequest 2022-08-27 12:44:11 +02:00
volume Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
__init__.py
fake_block_device.py
fake_build_request.py
fake_console_auth_token.py
fake_crypto.py
fake_diagnostics.py
fake_flavor.py
fake_hosts.py
fake_instance.py Remove (almost) all references to 'instance_type' 2021-03-29 12:24:15 +01:00
fake_ldap.py Remove six.moves 2020-11-07 03:25:02 +00:00
fake_network_cache_model.py Use UUID as vif and network_id in vif tests 2020-09-07 10:31:52 +02:00
fake_network.py db: Unify 'nova.db.api', 'nova.db.sqlalchemy.api' 2021-08-09 15:34:40 +01:00
fake_pci_device_pools.py
fake_policy.py Separate flavor extra specs policy for server APIs 2022-02-24 16:33:26 +00:00
fake_processutils.py Remove six.binary_type/integer_types/string_types 2020-12-13 11:25:14 +00:00
fake_request_spec.py Reproduce bug 1952941 2021-12-03 09:08:15 +00:00
fake_requests.py
fake_server_actions.py db: Unify 'nova.db.api', 'nova.db.sqlalchemy.api' 2021-08-09 15:34:40 +01:00
fake_volume.py
image_fixtures.py
matchers.py Remove six.text_type (2/2) 2020-12-13 11:26:35 +00:00
test_api_validation.py api: Rename 'parameter_types.hostname' -> 'fqdn' 2021-08-19 11:16:59 +01:00
test_availability_zones.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_baserpc.py
test_block_device.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_cache.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_cinder.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_conf.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_configdrive2.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_context.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_crypto.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_exception_wrapper.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_exception.py rpc: Rework 'get_notifier', 'wrap_exception' 2021-03-01 11:06:48 +00:00
test_fixtures.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_hacking.py hacking: force explicit import of python's mock 2022-08-02 15:31:19 +02:00
test_identity.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_json_ref.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_loadables.py
test_matchers.py
test_metadata.py Remove double mocking 2022-08-02 15:31:15 +02:00
test_notifications.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_notifier.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_policy.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_profiler.py Remove six.moves 2020-11-07 03:25:02 +00:00
test_quota.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_rpc.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_safeutils.py
test_service_auth.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_service.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_test_utils.py db: Unify 'nova.db.api', 'nova.db.sqlalchemy.api' 2021-08-09 15:34:40 +01:00
test_test.py Remove double mocking 2022-08-02 15:31:15 +02:00
test_utils.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_versions.py Change API unexpected exception message 2021-02-17 21:30:07 +00:00
test_weights.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_wsgi.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
utils.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00