
Added user/project CONF with admin role at cinder group, and when determine context is_admin and without token, do authenticaion with user/project info to call cinder api. When set reclaim_instance_interval > 0, and then delete an instance which booted from volume with `delete_on_termination` set as true. After reclaim_instance_interval time pass, all volumes boot instance with state: attached and in-use, even when attached instances was deleted. This happens because as admin context from `nova.compute.manager._reclaim_queued_deletes` did not have any token info, then call cinder api would be failed. The corresponding nova changes merged in change https://review.opendev.org/#/c/522112/ Related-Bug: #1734025 Change-Id: Ib58c2ca04dfe6d1e1ff849f600a9a24724205078
60 lines
2.3 KiB
Ruby
60 lines
2.3 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'nova::cinder' do
|
|
|
|
shared_examples 'nova::cinder' do
|
|
context 'with required parameters' do
|
|
|
|
it 'configures cinder in nova.conf' do
|
|
should contain_nova_config('cinder/password').with_value('<SERVICE DEFAULT>').with_secret(true)
|
|
should contain_nova_config('cinder/auth_type').with_value('<SERVICE DEFAULT>')
|
|
should contain_nova_config('cinder/auth_url').with_value('<SERVICE DEFAULT>')
|
|
should contain_nova_config('cinder/timeout').with_value('<SERVICE DEFAULT>')
|
|
should contain_nova_config('cinder/region_name').with_value('<SERVICE DEFAULT>')
|
|
should contain_nova_config('cinder/project_name').with_value('services')
|
|
should contain_nova_config('cinder/project_domain_name').with_value('Default')
|
|
should contain_nova_config('cinder/username').with_value('cinder')
|
|
should contain_nova_config('cinder/user_domain_name').with_value('Default')
|
|
end
|
|
|
|
end
|
|
|
|
context 'when specified parameters' do
|
|
let :params do
|
|
{
|
|
:password => 's3cr3t',
|
|
:auth_type => 'v3password',
|
|
:auth_url => 'http://10.0.0.10:5000/v3',
|
|
:timeout => 60,
|
|
:region_name => 'RegionOne',
|
|
}
|
|
end
|
|
|
|
it 'configures cinder in nova.conf' do
|
|
should contain_nova_config('cinder/password').with_value('s3cr3t').with_secret(true)
|
|
should contain_nova_config('cinder/auth_type').with_value('v3password')
|
|
should contain_nova_config('cinder/auth_url').with_value('http://10.0.0.10:5000/v3')
|
|
should contain_nova_config('cinder/timeout').with_value('60')
|
|
should contain_nova_config('cinder/region_name').with_value('RegionOne')
|
|
should contain_nova_config('cinder/project_name').with_value('services')
|
|
should contain_nova_config('cinder/project_domain_name').with_value('Default')
|
|
should contain_nova_config('cinder/username').with_value('cinder')
|
|
should contain_nova_config('cinder/user_domain_name').with_value('Default')
|
|
end
|
|
|
|
end
|
|
end
|
|
|
|
on_supported_os({
|
|
:supported_os => OSDefaults.get_supported_os
|
|
}).each do |os,facts|
|
|
context "on #{os}" do
|
|
let (:facts) do
|
|
facts.merge(OSDefaults.get_facts())
|
|
end
|
|
|
|
it_behaves_like 'nova::cinder'
|
|
end
|
|
end
|
|
end
|