nova/nova/tests/unit/pci
Stephen Finucane adc705ee0c pci: Add a '_filter_pools' helper function
Two functions, 'consume_requests' and 'apply_requests' (via the
'_apply_request' helper), used very similar code to identify the PCI
device pools that could be used to satisfy a request for PCI devices.
Rather than duplicating this code, introduce a new '_filter_pools'
helper than will do this filtering and return a list of matching pools,
if any. This is essentially the old '_apply_request' function without
any decreasing of pool count information.

While we're here, we inline a simple function with a single caller and
add whitespace to make things a little easier to grok.

Change-Id: Icf3d684446e01d2c04d91954a1fd0ec659b418e3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Related-Bug: #1852727
2020-11-26 18:07:29 +00:00
..
__init__.py move all tests to nova/tests/unit 2014-11-12 15:31:08 -05:00
fakes.py Fix mock.patch usage in unit tests 2018-09-13 02:54:07 +00:00
test_devspec.py Merge "pci: Validate behavior of empty devname" 2017-09-21 13:57:54 +00:00
test_manager.py Reproduce bug 1897528 2020-11-16 11:16:57 +01:00
test_request.py support pci numa affinity policies in flavor and image 2019-12-11 14:39:12 +00:00
test_stats.py pci: Add a '_filter_pools' helper function 2020-11-26 18:07:29 +00:00
test_utils.py Remove six.moves 2020-11-07 03:25:02 +00:00
test_whitelist.py Enhance PCI passthrough whitelist to support regex 2016-12-11 00:53:14 +02:00