Adapt to the new [pci] device_spec parameter

and replaces the deprecated [pci] passthrough_whitelist parameter.

Depends-on: https://review.opendev.org/c/openstack/nova/+/843834
Change-Id: Ia534d2acd8f5488b1358376bb5bd1f0f7302fbaa
This commit is contained in:
Takashi Kajinami 2022-08-18 01:25:37 +09:00
parent d8739ad539
commit 502aec2406
2 changed files with 16 additions and 11 deletions

View File

@ -24,6 +24,11 @@ class nova::compute::pci(
$passthrough_real = $::os_service_default
}
nova_config {
'pci/passthrough_whitelist': value => $passthrough_real;
'pci/device_spec': value => $passthrough_real;
}
# TODO(tkajinam): Remove this after Zed release.
nova_config {
'pci/passthrough_whitelist': ensure => absent;
}
}

View File

@ -4,8 +4,8 @@ describe 'nova::compute::pci' do
shared_examples_for 'nova-compute-pci' do
context 'with default parameters' do
it 'clears pci_passthrough_whitelist configuration' do
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(:value => '<SERVICE DEFAULT>')
it 'clears pci device_spec configuration' do
is_expected.to contain_nova_config('pci/device_spec').with(:value => '<SERVICE DEFAULT>')
end
end
@ -25,8 +25,8 @@ describe 'nova::compute::pci' do
],
}
end
it 'configures nova pci_passthrough_whitelist entries' do
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(
it 'configures nova pci device_spec entries' do
is_expected.to contain_nova_config('pci/device_spec').with(
'value' => ['{"vendor_id":"8086","product_id":"0126"}','{"vendor_id":"9096","product_id":"1520","physical_network":"physnet1"}']
)
end
@ -39,8 +39,8 @@ describe 'nova::compute::pci' do
}
end
it 'configures nova pci_passthrough_whitelist entries' do
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(
it 'configures nova pci device_spec entries' do
is_expected.to contain_nova_config('pci/device_spec').with(
'value' => ['{"vendor_id":"8086","product_id":"0126"}','{"vendor_id":"9096","product_id":"1520","physical_network":"physnet1"}']
)
end
@ -53,8 +53,8 @@ describe 'nova::compute::pci' do
}
end
it 'clears pci_passthrough_whitelist configuration' do
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(:value => '<SERVICE DEFAULT>')
it 'clears pci device_spec configuration' do
is_expected.to contain_nova_config('pci/device_spec').with(:value => '<SERVICE DEFAULT>')
end
end
@ -65,8 +65,8 @@ describe 'nova::compute::pci' do
}
end
it 'clears pci_passthrough_whitelist configuration' do
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(:value => '<SERVICE DEFAULT>')
it 'clears pci device_spec configuration' do
is_expected.to contain_nova_config('pci/device_spec').with(:value => '<SERVICE DEFAULT>')
end
end
end