Add support for [pci] report_in_placement

... which was added during Zed cycle[1].

[1] 06389f8d849c6380a5f3763f03e84f804c4d29f2

Change-Id: Ibaf313d64f0a14babe7503b597820cedfa7acae8
This commit is contained in:
Takashi Kajinami 2023-11-03 23:10:08 +09:00
parent 1c2f147c2a
commit 09d19b9d52
3 changed files with 28 additions and 4 deletions

View File

@ -10,9 +10,14 @@
# Example of format:
# [ { "vendor_id" => "1234","product_id" => "5678" },
# { "vendor_id" => "4321","product_id" => "8765", "physical_network" => "default" } ]
#
# [*report_in_placement*]
# (optional) Enable PCI resource inventory reporting to Placement.
# Defaults to $facts['os_service_default']
#
class nova::compute::pci(
$passthrough = $facts['os_service_default']
$passthrough = $facts['os_service_default'],
$report_in_placement = $facts['os_service_default'],
) {
include nova::deps
@ -24,6 +29,7 @@ class nova::compute::pci(
$passthrough_real = $facts['os_service_default']
}
nova_config {
'pci/device_spec': value => $passthrough_real;
'pci/device_spec': value => $passthrough_real;
'pci/report_in_placement': value => $report_in_placement;
}
}

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``nova::compute::pci::report_in_placement`` parameter has been
added.

View File

@ -4,8 +4,21 @@ describe 'nova::compute::pci' do
shared_examples_for 'nova-compute-pci' do
context 'with default parameters' do
it 'clears pci device_spec configuration' do
it 'configures default values' do
is_expected.to contain_nova_config('pci/device_spec').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('pci/report_in_placement').with(:value => '<SERVICE DEFAULT>')
end
end
context 'with parameters' do
let :params do
{
:report_in_placement => true
}
end
it 'configures given values' do
is_expected.to contain_nova_config('pci/report_in_placement').with(:value => true)
end
end