nova/nova/tests/unit/pci
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
..
__init__.py move all tests to nova/tests/unit 2014-11-12 15:31:08 -05:00
fakes.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_devspec.py Rename exception.PciConfigInvalidWhitelist to PciConfigInvalidSpec 2022-08-10 17:08:35 +02:00
test_manager.py Generate request_id for Flavor based InstancePCIRequest 2022-08-27 12:44:11 +02:00
test_request.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_stats.py Trigger reschedule if PCI consumption fail on compute 2022-08-25 10:00:10 +02:00
test_utils.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_whitelist.py Enhance PCI passthrough whitelist to support regex 2016-12-11 00:53:14 +02:00