puppet-nova/spec/classes/nova_cinder_spec.rb
Takashi Kajinami d0aee23dae Migrate back cross_az_attach
The previous change[1] migrated some parameters related cinder
from nova to nova::cinder, but cross_az_attach shouldn't be migrate
because the parameter is used in nova-api and nova-compute and in some
cases nova::cinder class is not actually loaded in api side.
(We actually don't include nova::cinder for controllers in TripleO)

This patch partially reverts the change by [1], so that we keep
cross_az_attach in more common place, which is surely loaded in
both control plane and hypervisor.

[1] 72103db985

Change-Id: I2e07e29740cf0398b4f34457b53d54890b4aa843
2020-04-27 23:00:39 +00:00

66 lines
2.8 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')
should contain_nova_config('cinder/os_region_name').with_value('<SERVICE DEFAULT>')
should contain_nova_config('cinder/catalog_info').with_value('<SERVICE 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',
:os_region_name => 'RegionOne',
:catalog_info => 'volumev3:cinderv3:publicURL',
}
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')
should contain_nova_config('cinder/os_region_name').with_value('RegionOne')
should contain_nova_config('cinder/catalog_info').with_value('volumev3:cinderv3:publicURL')
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