Use rspec-puppet-facts
Convert the rest of the tests to leverage rspec-puppet-facts Change-Id: Ic2c20516f73214f790ac9ed9fd4a773ee9d5f6af
This commit is contained in:
parent
ae7183ff2f
commit
0e5843dc89
@ -11,136 +11,130 @@ describe 'manila::api' do
|
|||||||
{}
|
{}
|
||||||
end
|
end
|
||||||
|
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({
|
|
||||||
:osfamily => 'Debian',
|
|
||||||
:operatingsystem => 'Debian',
|
|
||||||
:operatingsystemrelease => 'jessie'
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with only required params' do
|
shared_examples_for 'manila::api' do
|
||||||
let :params do
|
context 'with only required params' do
|
||||||
req_params
|
let :params do
|
||||||
end
|
req_params
|
||||||
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_service('manila-api').with(
|
it { is_expected.to contain_service('manila-api').with(
|
||||||
'hasstatus' => true,
|
'hasstatus' => true,
|
||||||
'ensure' => 'running',
|
'ensure' => 'running',
|
||||||
'tag' => 'manila-service',
|
'tag' => 'manila-service',
|
||||||
)}
|
)}
|
||||||
it { is_expected.to contain_class('manila::policy') }
|
it { is_expected.to contain_class('manila::policy') }
|
||||||
|
|
||||||
|
|
||||||
it 'should configure manila api correctly' do
|
it 'should configure manila api correctly' do
|
||||||
is_expected.to contain_manila_config('DEFAULT/auth_strategy').with(:value => 'keystone')
|
is_expected.to contain_manila_config('DEFAULT/auth_strategy').with(:value => 'keystone')
|
||||||
is_expected.to contain_manila_config('DEFAULT/osapi_share_listen').with(:value => '0.0.0.0')
|
is_expected.to contain_manila_config('DEFAULT/osapi_share_listen').with(:value => '0.0.0.0')
|
||||||
is_expected.to contain_manila_config('DEFAULT/enabled_share_protocols').with(:value => '<SERVICE DEFAULT>')
|
is_expected.to contain_manila_config('DEFAULT/enabled_share_protocols').with(:value => '<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_oslo__middleware('manila_config').with(
|
is_expected.to contain_oslo__middleware('manila_config').with(
|
||||||
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
|
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
|
||||||
)
|
)
|
||||||
is_expected.to contain_manila_config('DEFAULT/default_share_type').with(:value => '<SERVICE DEFAULT>')
|
is_expected.to contain_manila_config('DEFAULT/default_share_type').with(:value => '<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_manila_config('DEFAULT/osapi_share_workers').with(:value => '2')
|
is_expected.to contain_manila_config('DEFAULT/osapi_share_workers').with(:value => '2')
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should run db sync' do
|
||||||
|
is_expected.to contain_class('manila::db::sync')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should run db sync' do
|
context 'with a default share type' do
|
||||||
is_expected.to contain_class('manila::db::sync')
|
let :params do
|
||||||
end
|
req_params.merge({'default_share_type' => 'default'})
|
||||||
end
|
end
|
||||||
|
it { is_expected.to contain_class('manila::policy') }
|
||||||
describe 'with a default share type' do
|
it 'should configure the default share type' do
|
||||||
let :params do
|
is_expected.to contain_manila_config('DEFAULT/default_share_type').with(
|
||||||
req_params.merge({'default_share_type' => 'default'})
|
:value => 'default'
|
||||||
end
|
)
|
||||||
it { is_expected.to contain_class('manila::policy') }
|
end
|
||||||
it 'should configure the default share type' do
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/default_share_type').with(
|
|
||||||
:value => 'default'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with service workers' do
|
|
||||||
let :params do
|
|
||||||
req_params.merge({'service_workers' => '4'})
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_class('manila::policy') }
|
|
||||||
it 'should configure the share workers' do
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/osapi_share_workers').with(
|
|
||||||
:value => '4'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with only required params' do
|
|
||||||
let :params do
|
|
||||||
req_params.merge({'bind_host' => '192.168.1.3'})
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_class('manila::policy') }
|
|
||||||
it 'should configure manila api correctly' do
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/osapi_share_listen').with(
|
|
||||||
:value => '192.168.1.3'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with only required params' do
|
|
||||||
let :params do
|
|
||||||
req_params.merge({'enable_proxy_headers_parsing' => true})
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_class('manila::policy') }
|
|
||||||
it 'should configure manila api correctly' do
|
|
||||||
is_expected.to contain_oslo__middleware('manila_config').with(
|
|
||||||
:enable_proxy_headers_parsing => true,
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with enabled false' do
|
|
||||||
let :params do
|
|
||||||
req_params.merge({'enabled' => false})
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_class('manila::policy') }
|
|
||||||
it 'should stop the service' do
|
|
||||||
is_expected.to contain_service('manila-api').with_ensure('stopped')
|
|
||||||
end
|
|
||||||
it 'includes manila::db::sync' do
|
|
||||||
is_expected.to contain_class('manila::db::sync')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with sync_db false' do
|
|
||||||
let :params do
|
|
||||||
req_params.merge({'sync_db' => false})
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_class('manila::policy') }
|
|
||||||
it 'should not include manila::db::sync' do
|
|
||||||
is_expected.to_not contain_class('manila::db::sync')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with manage_service false' do
|
|
||||||
let :params do
|
|
||||||
req_params.merge({'manage_service' => false})
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_class('manila::policy') }
|
|
||||||
it 'should not change the state of the service' do
|
|
||||||
is_expected.to contain_service('manila-api').without_ensure
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with ratelimits' do
|
|
||||||
let :params do
|
|
||||||
req_params.merge({ :ratelimits => '(GET, "*", .*, 100, MINUTE);(POST, "*", .*, 200, MINUTE)' })
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_class('manila::policy') }
|
context 'with service workers' do
|
||||||
it { is_expected.to contain_manila_api_paste_ini('filter:ratelimit/limits').with(
|
let :params do
|
||||||
:value => '(GET, "*", .*, 100, MINUTE);(POST, "*", .*, 200, MINUTE)'
|
req_params.merge({'service_workers' => '4'})
|
||||||
)}
|
end
|
||||||
end
|
it { is_expected.to contain_class('manila::policy') }
|
||||||
|
it 'should configure the share workers' do
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/osapi_share_workers').with(
|
||||||
|
:value => '4'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe 'when running manila-api in wsgi' do
|
context 'with only required params' do
|
||||||
|
let :params do
|
||||||
|
req_params.merge({'bind_host' => '192.168.1.3'})
|
||||||
|
end
|
||||||
|
it { is_expected.to contain_class('manila::policy') }
|
||||||
|
it 'should configure manila api correctly' do
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/osapi_share_listen').with(
|
||||||
|
:value => '192.168.1.3'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with only required params' do
|
||||||
|
let :params do
|
||||||
|
req_params.merge({'enable_proxy_headers_parsing' => true})
|
||||||
|
end
|
||||||
|
it { is_expected.to contain_class('manila::policy') }
|
||||||
|
it 'should configure manila api correctly' do
|
||||||
|
is_expected.to contain_oslo__middleware('manila_config').with(
|
||||||
|
:enable_proxy_headers_parsing => true,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with enabled false' do
|
||||||
|
let :params do
|
||||||
|
req_params.merge({'enabled' => false})
|
||||||
|
end
|
||||||
|
it { is_expected.to contain_class('manila::policy') }
|
||||||
|
it 'should stop the service' do
|
||||||
|
is_expected.to contain_service('manila-api').with_ensure('stopped')
|
||||||
|
end
|
||||||
|
it 'includes manila::db::sync' do
|
||||||
|
is_expected.to contain_class('manila::db::sync')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with sync_db false' do
|
||||||
|
let :params do
|
||||||
|
req_params.merge({'sync_db' => false})
|
||||||
|
end
|
||||||
|
it { is_expected.to contain_class('manila::policy') }
|
||||||
|
it 'should not include manila::db::sync' do
|
||||||
|
is_expected.to_not contain_class('manila::db::sync')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with manage_service false' do
|
||||||
|
let :params do
|
||||||
|
req_params.merge({'manage_service' => false})
|
||||||
|
end
|
||||||
|
it { is_expected.to contain_class('manila::policy') }
|
||||||
|
it 'should not change the state of the service' do
|
||||||
|
is_expected.to contain_service('manila-api').without_ensure
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with ratelimits' do
|
||||||
|
let :params do
|
||||||
|
req_params.merge({ :ratelimits => '(GET, "*", .*, 100, MINUTE);(POST, "*", .*, 200, MINUTE)' })
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_class('manila::policy') }
|
||||||
|
it { is_expected.to contain_manila_api_paste_ini('filter:ratelimit/limits').with(
|
||||||
|
:value => '(GET, "*", .*, 100, MINUTE);(POST, "*", .*, 200, MINUTE)'
|
||||||
|
)}
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when running manila-api in wsgi' do
|
||||||
let :params do
|
let :params do
|
||||||
req_params.merge!({ :service_name => 'httpd' })
|
req_params.merge!({ :service_name => 'httpd' })
|
||||||
end
|
end
|
||||||
@ -162,7 +156,7 @@ describe 'manila::api' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when service_name is not valid' do
|
context 'when service_name is not valid' do
|
||||||
let :params do
|
let :params do
|
||||||
req_params.merge!({ :service_name => 'foobar' })
|
req_params.merge!({ :service_name => 'foobar' })
|
||||||
end
|
end
|
||||||
@ -178,4 +172,17 @@ describe 'manila::api' do
|
|||||||
it_raises 'a Puppet::Error', /Invalid service_name/
|
it_raises 'a Puppet::Error', /Invalid service_name/
|
||||||
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({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it_behaves_like 'manila::api'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -50,20 +50,14 @@ describe 'manila::backends' do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
on_supported_os({
|
||||||
let :facts do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
@default_facts.merge({ :osfamily => 'Debian' })
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it_behaves_like 'manila backends'
|
||||||
end
|
end
|
||||||
|
|
||||||
it_configures 'manila backends'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on RedHat platforms' do
|
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures 'manila backends'
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -7,52 +7,61 @@ describe 'manila::db::mysql' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({:osfamily => 'Debian'})
|
|
||||||
end
|
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
'include mysql::server'
|
'include mysql::server'
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'with only required params' do
|
shared_examples_for 'manila::db::mysql' do
|
||||||
let :params do
|
context 'with only required params' do
|
||||||
req_params
|
let :params do
|
||||||
end
|
req_params
|
||||||
it { is_expected.to contain_openstacklib__db__mysql('manila').with(
|
end
|
||||||
:user => 'manila',
|
it { is_expected.to contain_openstacklib__db__mysql('manila').with(
|
||||||
:password_hash => '*D821809F681A40A6E379B50D0463EFAE20BDD122',
|
:user => 'manila',
|
||||||
:host => '127.0.0.1',
|
:password_hash => '*D821809F681A40A6E379B50D0463EFAE20BDD122',
|
||||||
:charset => 'utf8',
|
:host => '127.0.0.1',
|
||||||
:collate => 'utf8_general_ci',
|
:charset => 'utf8',
|
||||||
) }
|
:collate => 'utf8_general_ci',
|
||||||
end
|
) }
|
||||||
describe "overriding allowed_hosts param to array" do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:password => 'manilapass',
|
|
||||||
:allowed_hosts => ['127.0.0.1','%']
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
context "overriding allowed_hosts param to array" do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:password => 'manilapass',
|
||||||
|
:allowed_hosts => ['127.0.0.1','%']
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
end
|
|
||||||
describe "overriding allowed_hosts param to string" do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:password => 'manilapass2',
|
|
||||||
:allowed_hosts => '192.168.1.1'
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
context "overriding allowed_hosts param to string" do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:password => 'manilapass2',
|
||||||
|
:allowed_hosts => '192.168.1.1'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
context "overriding allowed_hosts param equals to host param " do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:password => 'manilapass2',
|
||||||
|
:allowed_hosts => '127.0.0.1'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "overriding allowed_hosts param equals to host param " do
|
on_supported_os({
|
||||||
let :params do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
{
|
}).each do |os,facts|
|
||||||
:password => 'manilapass2',
|
context "on #{os}" do
|
||||||
:allowed_hosts => '127.0.0.1'
|
let (:facts) do
|
||||||
}
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it_behaves_like 'manila::db::mysql'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -86,16 +86,7 @@ describe 'manila::db' do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
shared_examples_for 'manila::db on Debian' do
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({ :osfamily => 'Debian',
|
|
||||||
:operatingsystem => 'Debian',
|
|
||||||
:operatingsystemrelease => 'jessie',
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures 'manila::db'
|
|
||||||
|
|
||||||
context 'using pymysql driver' do
|
context 'using pymysql driver' do
|
||||||
let :params do
|
let :params do
|
||||||
{ :database_connection => 'mysql+pymysql://manila:manila@localhost/manila' }
|
{ :database_connection => 'mysql+pymysql://manila:manila@localhost/manila' }
|
||||||
@ -105,15 +96,7 @@ describe 'manila::db' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Redhat platforms' do
|
shared_examples_for 'manila::db on RedHat' do
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({ :osfamily => 'RedHat',
|
|
||||||
:operatingsystemrelease => '7.1',
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures 'manila::db'
|
|
||||||
|
|
||||||
context 'using pymysql driver' do
|
context 'using pymysql driver' do
|
||||||
let :params do
|
let :params do
|
||||||
{ :database_connection => 'mysql+pymysql://manila:manila@localhost/manila' }
|
{ :database_connection => 'mysql+pymysql://manila:manila@localhost/manila' }
|
||||||
@ -122,4 +105,16 @@ describe 'manila::db' do
|
|||||||
end
|
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({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it_behaves_like 'manila::db'
|
||||||
|
it_behaves_like "manila::db on #{facts[:osfamily]}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -19,17 +19,26 @@ describe 'manila::ganesha' do
|
|||||||
is_expected.to contain_manila_config("DEFAULT/#{config}").with_value(value)
|
is_expected.to contain_manila_config("DEFAULT/#{config}").with_value(value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
shared_examples_for 'manila::ganesha on RedHat' do
|
||||||
it { is_expected.to contain_package('nfs-ganesha').with(
|
it { is_expected.to contain_package('nfs-ganesha').with(
|
||||||
:name => 'nfs-ganesha',
|
:name => 'nfs-ganesha',
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
) }
|
) }
|
||||||
|
end
|
||||||
|
|
||||||
context 'on Red Hat platforms' do
|
on_supported_os({
|
||||||
let :facts do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
@default_facts.merge({:osfamily => 'RedHat'})
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
||||||
end
|
end
|
||||||
it_configures 'manila NFS Ganesha options for share drivers'
|
it_configures 'manila NFS Ganesha options for share drivers'
|
||||||
|
if facts[:osfamily] == 'RedHat'
|
||||||
|
it_configures 'manila::ganesha on RedHat'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -7,251 +7,259 @@ describe 'manila' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
let :facts do
|
shared_examples_for 'manila' do
|
||||||
@default_facts.merge({:osfamily => 'Debian'})
|
context 'with only required params' do
|
||||||
end
|
let :params do
|
||||||
|
req_params
|
||||||
|
end
|
||||||
|
|
||||||
describe 'with only required params' do
|
it { is_expected.to contain_class('manila::logging') }
|
||||||
let :params do
|
it { is_expected.to contain_class('manila::params') }
|
||||||
req_params
|
|
||||||
|
it 'passes purge to resource' do
|
||||||
|
is_expected.to contain_resources('manila_config').with({
|
||||||
|
:purge => false
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should contain default config' do
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/transport_url').with(
|
||||||
|
:value => '<SERVICE DEFAULT>'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/rpc_response_timeout').with(
|
||||||
|
:value => '<SERVICE DEFAULT>'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('oslo_messaging_notifications/transport_url').with(
|
||||||
|
:value => '<SERVICE DEFAULT>'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('oslo_messaging_notifications/topics').with(
|
||||||
|
:value => '<SERVICE DEFAULT>'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('oslo_messaging_notifications/driver').with(
|
||||||
|
:value => 'messaging'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/control_exchange').with(
|
||||||
|
:value => 'openstack'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('oslo_messaging_rabbit/amqp_durable_queues').with(
|
||||||
|
:value => '<SERVICE DEFAULT>'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('oslo_messaging_rabbit/rabbit_ha_queues').with(
|
||||||
|
:value => '<SERVICE DEFAULT>'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('oslo_messaging_rabbit/kombu_failover_strategy').with(
|
||||||
|
:value => '<SERVICE DEFAULT>'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/debug').with(
|
||||||
|
:value => '<SERVICE DEFAULT>'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/storage_availability_zone').with(
|
||||||
|
:value => 'nova'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/api_paste_config').with(
|
||||||
|
:value => '/etc/manila/api-paste.ini'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/rootwrap_config').with(
|
||||||
|
:value => '/etc/manila/rootwrap.conf'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/state_path').with(
|
||||||
|
:value => '/var/lib/manila'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/host').with(
|
||||||
|
:value => '<SERVICE DEFAULT>'
|
||||||
|
)
|
||||||
|
is_expected.to contain_manila_config('oslo_concurrency/lock_path').with(
|
||||||
|
:value => '/tmp/manila/manila_locks'
|
||||||
|
)
|
||||||
|
is_expected.to contain_oslo__messaging__rabbit('manila_config').with(
|
||||||
|
:rabbit_use_ssl => '<SERVICE DEFAULT>',
|
||||||
|
)
|
||||||
|
is_expected.to contain_oslo__log('manila_config').with(:log_dir => '/var/log/manila')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_class('manila::logging') }
|
context 'with enable ha queues' do
|
||||||
it { is_expected.to contain_class('manila::params') }
|
let :params do
|
||||||
|
req_params.merge({'rabbit_ha_queues' => true})
|
||||||
|
end
|
||||||
|
|
||||||
it 'passes purge to resource' do
|
it 'should contain rabbit_ha_queues' do
|
||||||
is_expected.to contain_resources('manila_config').with({
|
is_expected.to contain_manila_config('oslo_messaging_rabbit/rabbit_ha_queues').with(
|
||||||
:purge => false
|
:value => true
|
||||||
})
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should contain default config' do
|
context 'with SSL enabled' do
|
||||||
is_expected.to contain_manila_config('DEFAULT/transport_url').with(
|
let :params do
|
||||||
:value => '<SERVICE DEFAULT>'
|
req_params.merge!({
|
||||||
)
|
:rabbit_use_ssl => true,
|
||||||
is_expected.to contain_manila_config('DEFAULT/rpc_response_timeout').with(
|
:kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
|
||||||
:value => '<SERVICE DEFAULT>'
|
:kombu_ssl_certfile => '/path/to/ssl/cert/file',
|
||||||
)
|
:kombu_ssl_keyfile => '/path/to/ssl/keyfile',
|
||||||
is_expected.to contain_manila_config('oslo_messaging_notifications/transport_url').with(
|
:kombu_ssl_version => 'TLSv1'
|
||||||
:value => '<SERVICE DEFAULT>'
|
})
|
||||||
)
|
end
|
||||||
is_expected.to contain_manila_config('oslo_messaging_notifications/topics').with(
|
|
||||||
:value => '<SERVICE DEFAULT>'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('oslo_messaging_notifications/driver').with(
|
|
||||||
:value => 'messaging'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/control_exchange').with(
|
|
||||||
:value => 'openstack'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('oslo_messaging_rabbit/amqp_durable_queues').with(
|
|
||||||
:value => '<SERVICE DEFAULT>'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('oslo_messaging_rabbit/rabbit_ha_queues').with(
|
|
||||||
:value => '<SERVICE DEFAULT>'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('oslo_messaging_rabbit/kombu_failover_strategy').with(
|
|
||||||
:value => '<SERVICE DEFAULT>'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/debug').with(
|
|
||||||
:value => '<SERVICE DEFAULT>'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/storage_availability_zone').with(
|
|
||||||
:value => 'nova'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/api_paste_config').with(
|
|
||||||
:value => '/etc/manila/api-paste.ini'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/rootwrap_config').with(
|
|
||||||
:value => '/etc/manila/rootwrap.conf'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/state_path').with(
|
|
||||||
:value => '/var/lib/manila'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/host').with(
|
|
||||||
:value => '<SERVICE DEFAULT>'
|
|
||||||
)
|
|
||||||
is_expected.to contain_manila_config('oslo_concurrency/lock_path').with(
|
|
||||||
:value => '/tmp/manila/manila_locks'
|
|
||||||
)
|
|
||||||
is_expected.to contain_oslo__messaging__rabbit('manila_config').with(
|
|
||||||
:rabbit_use_ssl => '<SERVICE DEFAULT>',
|
|
||||||
)
|
|
||||||
is_expected.to contain_oslo__log('manila_config').with(:log_dir => '/var/log/manila')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with enable ha queues' do
|
it { is_expected.to contain_oslo__messaging__rabbit('manila_config').with(
|
||||||
let :params do
|
|
||||||
req_params.merge({'rabbit_ha_queues' => true})
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should contain rabbit_ha_queues' do
|
|
||||||
is_expected.to contain_manila_config('oslo_messaging_rabbit/rabbit_ha_queues').with(
|
|
||||||
:value => true
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with SSL enabled' do
|
|
||||||
let :params do
|
|
||||||
req_params.merge!({
|
|
||||||
:rabbit_use_ssl => true,
|
:rabbit_use_ssl => true,
|
||||||
:kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
|
:kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
|
||||||
:kombu_ssl_certfile => '/path/to/ssl/cert/file',
|
:kombu_ssl_certfile => '/path/to/ssl/cert/file',
|
||||||
:kombu_ssl_keyfile => '/path/to/ssl/keyfile',
|
:kombu_ssl_keyfile => '/path/to/ssl/keyfile',
|
||||||
:kombu_ssl_version => 'TLSv1'
|
:kombu_ssl_version => 'TLSv1'
|
||||||
})
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_oslo__messaging__rabbit('manila_config').with(
|
context 'with SSL enabled without kombu' do
|
||||||
:rabbit_use_ssl => true,
|
let :params do
|
||||||
:kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
|
req_params.merge!({
|
||||||
:kombu_ssl_certfile => '/path/to/ssl/cert/file',
|
:rabbit_use_ssl => true,
|
||||||
:kombu_ssl_keyfile => '/path/to/ssl/keyfile',
|
})
|
||||||
:kombu_ssl_version => 'TLSv1'
|
end
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with SSL enabled without kombu' do
|
it { is_expected.to contain_oslo__messaging__rabbit('manila_config').with(
|
||||||
let :params do
|
|
||||||
req_params.merge!({
|
|
||||||
:rabbit_use_ssl => true,
|
:rabbit_use_ssl => true,
|
||||||
})
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_oslo__messaging__rabbit('manila_config').with(
|
context 'with SSL disabled' do
|
||||||
:rabbit_use_ssl => true,
|
let :params do
|
||||||
)}
|
req_params.merge!({
|
||||||
end
|
:rabbit_use_ssl => false,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
describe 'with SSL disabled' do
|
it { is_expected.to contain_oslo__messaging__rabbit('manila_config').with(
|
||||||
let :params do
|
|
||||||
req_params.merge!({
|
|
||||||
:rabbit_use_ssl => false,
|
:rabbit_use_ssl => false,
|
||||||
})
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_oslo__messaging__rabbit('manila_config').with(
|
context 'with amqp_durable_queues disabled' do
|
||||||
:rabbit_use_ssl => false,
|
let :params do
|
||||||
)}
|
req_params.merge({
|
||||||
end
|
:amqp_durable_queues => false,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
describe 'with amqp_durable_queues disabled' do
|
it { is_expected.to contain_manila_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false) }
|
||||||
let :params do
|
|
||||||
req_params.merge({
|
|
||||||
:amqp_durable_queues => false,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false) }
|
context 'with amqp_durable_queues enabled' do
|
||||||
end
|
let :params do
|
||||||
|
req_params.merge({
|
||||||
|
:amqp_durable_queues => true,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
describe 'with amqp_durable_queues enabled' do
|
it { is_expected.to contain_manila_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(true) }
|
||||||
let :params do
|
|
||||||
req_params.merge({
|
|
||||||
:amqp_durable_queues => true,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(true) }
|
context 'with sqlite' do
|
||||||
end
|
let :params do
|
||||||
|
{
|
||||||
|
:sql_connection => 'sqlite:////var/lib/manila/manila.sqlite',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
describe 'with sqlite' do
|
it { is_expected.to_not contain_class('mysql::python') }
|
||||||
let :params do
|
it { is_expected.to_not contain_class('mysql::bindings') }
|
||||||
{
|
it { is_expected.to_not contain_class('mysql::bindings::python') }
|
||||||
:sql_connection => 'sqlite:////var/lib/manila/manila.sqlite',
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to_not contain_class('mysql::python') }
|
context 'with SSL socket options set' do
|
||||||
it { is_expected.to_not contain_class('mysql::bindings') }
|
let :params do
|
||||||
it { is_expected.to_not contain_class('mysql::bindings::python') }
|
{
|
||||||
end
|
:use_ssl => true,
|
||||||
|
:cert_file => '/path/to/cert',
|
||||||
|
:ca_file => '/path/to/ca',
|
||||||
|
:key_file => '/path/to/key',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
describe 'with SSL socket options set' do
|
it { is_expected.to contain_manila_config('DEFAULT/ssl_ca_file').with_value('/path/to/ca') }
|
||||||
let :params do
|
it { is_expected.to contain_manila_config('DEFAULT/ssl_cert_file').with_value('/path/to/cert') }
|
||||||
{
|
it { is_expected.to contain_manila_config('DEFAULT/ssl_key_file').with_value('/path/to/key') }
|
||||||
:use_ssl => true,
|
|
||||||
:cert_file => '/path/to/cert',
|
|
||||||
:ca_file => '/path/to/ca',
|
|
||||||
:key_file => '/path/to/key',
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_manila_config('DEFAULT/ssl_ca_file').with_value('/path/to/ca') }
|
context 'with SSL socket options set to false' do
|
||||||
it { is_expected.to contain_manila_config('DEFAULT/ssl_cert_file').with_value('/path/to/cert') }
|
let :params do
|
||||||
it { is_expected.to contain_manila_config('DEFAULT/ssl_key_file').with_value('/path/to/key') }
|
{
|
||||||
end
|
:use_ssl => false,
|
||||||
|
:cert_file => false,
|
||||||
|
:ca_file => false,
|
||||||
|
:key_file => false,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
describe 'with SSL socket options set to false' do
|
it { is_expected.to contain_manila_config('DEFAULT/ssl_ca_file').with_ensure('absent') }
|
||||||
let :params do
|
it { is_expected.to contain_manila_config('DEFAULT/ssl_cert_file').with_ensure('absent') }
|
||||||
{
|
it { is_expected.to contain_manila_config('DEFAULT/ssl_key_file').with_ensure('absent') }
|
||||||
:use_ssl => false,
|
|
||||||
:cert_file => false,
|
|
||||||
:ca_file => false,
|
|
||||||
:key_file => false,
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_manila_config('DEFAULT/ssl_ca_file').with_ensure('absent') }
|
context 'with SSL socket options set wrongly configured' do
|
||||||
it { is_expected.to contain_manila_config('DEFAULT/ssl_cert_file').with_ensure('absent') }
|
let :params do
|
||||||
it { is_expected.to contain_manila_config('DEFAULT/ssl_key_file').with_ensure('absent') }
|
{
|
||||||
end
|
:use_ssl => true,
|
||||||
|
:ca_file => '/path/to/ca',
|
||||||
|
:key_file => '/path/to/key',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
describe 'with SSL socket options set wrongly configured' do
|
it_raises 'a Puppet::Error', /The cert_file parameter is required when use_ssl is set to true/
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:use_ssl => true,
|
|
||||||
:ca_file => '/path/to/ca',
|
|
||||||
:key_file => '/path/to/key',
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it_raises 'a Puppet::Error', /The cert_file parameter is required when use_ssl is set to true/
|
context 'with transport_url entries' do
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with transport_url entries' do
|
let :params do
|
||||||
|
{
|
||||||
|
:default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
|
||||||
|
:rpc_response_timeout => '120',
|
||||||
|
:control_exchange => 'manila',
|
||||||
|
:notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
let :params do
|
it { is_expected.to contain_manila_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') }
|
||||||
{
|
it { is_expected.to contain_manila_config('DEFAULT/rpc_response_timeout').with_value('120') }
|
||||||
:default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
|
it { is_expected.to contain_manila_config('DEFAULT/control_exchange').with_value('manila') }
|
||||||
:rpc_response_timeout => '120',
|
it { is_expected.to contain_manila_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') }
|
||||||
:control_exchange => 'manila',
|
|
||||||
:notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_manila_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') }
|
context 'with amqp rpc supplied' do
|
||||||
it { is_expected.to contain_manila_config('DEFAULT/rpc_response_timeout').with_value('120') }
|
|
||||||
it { is_expected.to contain_manila_config('DEFAULT/control_exchange').with_value('manila') }
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with amqp rpc supplied' do
|
let :params do
|
||||||
|
{
|
||||||
|
:sql_connection => 'mysql+pymysql://user:password@host/database',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
let :params do
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/server_request_prefix').with_value('exclusive') }
|
||||||
{
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/broadcast_prefix').with_value('broadcast') }
|
||||||
:sql_connection => 'mysql+pymysql://user:password@host/database',
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/group_request_prefix').with_value('unicast') }
|
||||||
}
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/container_name').with_value('guest') }
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/idle_timeout').with_value('0') }
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/trace').with_value(false) }
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/allow_insecure_clients').with_value(false) }
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/ssl_key_password').with_value('<SERVICE DEFAULT>')}
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/ssl_ca_file').with_value('<SERVICE DEFAULT>')}
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/ssl_cert_file').with_value('<SERVICE DEFAULT>')}
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/ssl_key_file').with_value('<SERVICE DEFAULT>')}
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/sasl_mechanisms').with_value('<SERVICE DEFAULT>')}
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/sasl_config_dir').with_value('<SERVICE DEFAULT>')}
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/sasl_config_name').with_value('<SERVICE DEFAULT>')}
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/username').with_value('<SERVICE DEFAULT>')}
|
||||||
|
it { is_expected.to contain_manila_config('oslo_messaging_amqp/password').with_value('<SERVICE DEFAULT>')}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/server_request_prefix').with_value('exclusive') }
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/broadcast_prefix').with_value('broadcast') }
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/group_request_prefix').with_value('unicast') }
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/container_name').with_value('guest') }
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/idle_timeout').with_value('0') }
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/trace').with_value(false) }
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/allow_insecure_clients').with_value(false) }
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/ssl_key_password').with_value('<SERVICE DEFAULT>')}
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/ssl_ca_file').with_value('<SERVICE DEFAULT>')}
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/ssl_cert_file').with_value('<SERVICE DEFAULT>')}
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/ssl_key_file').with_value('<SERVICE DEFAULT>')}
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/sasl_mechanisms').with_value('<SERVICE DEFAULT>')}
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/sasl_config_dir').with_value('<SERVICE DEFAULT>')}
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/sasl_config_name').with_value('<SERVICE DEFAULT>')}
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/username').with_value('<SERVICE DEFAULT>')}
|
|
||||||
it { is_expected.to contain_manila_config('oslo_messaging_amqp/password').with_value('<SERVICE DEFAULT>')}
|
|
||||||
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({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it_behaves_like 'manila'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -7,107 +7,120 @@ describe 'manila::keystone::auth' do
|
|||||||
:password_v2 => 'pw2'}
|
:password_v2 => 'pw2'}
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'with only required params' do
|
shared_examples_for 'manila::keystone::auth' do
|
||||||
|
context 'with only required params' do
|
||||||
|
|
||||||
it 'should contain auth info' do
|
it 'should contain auth info' do
|
||||||
|
|
||||||
is_expected.to contain_keystone_user('manila').with(
|
is_expected.to contain_keystone_user('manila').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:password => 'pw',
|
:password => 'pw',
|
||||||
:email => 'manila@localhost',
|
:email => 'manila@localhost',
|
||||||
)
|
)
|
||||||
is_expected.to contain_keystone_user_role('manila@services').with(
|
is_expected.to contain_keystone_user_role('manila@services').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:roles => ['admin']
|
:roles => ['admin']
|
||||||
)
|
)
|
||||||
is_expected.to contain_keystone_service('manila::share').with(
|
is_expected.to contain_keystone_service('manila::share').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:description => 'Manila Service'
|
:description => 'Manila Service'
|
||||||
)
|
)
|
||||||
|
|
||||||
is_expected.to contain_keystone_user('manilav2').with(
|
is_expected.to contain_keystone_user('manilav2').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:password => 'pw2',
|
:password => 'pw2',
|
||||||
:email => 'manilav2@localhost',
|
:email => 'manilav2@localhost',
|
||||||
)
|
)
|
||||||
is_expected.to contain_keystone_user_role('manilav2@services').with(
|
is_expected.to contain_keystone_user_role('manilav2@services').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:roles => ['admin']
|
:roles => ['admin']
|
||||||
)
|
)
|
||||||
is_expected.to contain_keystone_service('manilav2::sharev2').with(
|
is_expected.to contain_keystone_service('manilav2::sharev2').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:description => 'Manila Service v2'
|
:description => 'Manila Service v2'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
end
|
||||||
|
it { is_expected.to contain_keystone_endpoint('RegionOne/manila::share').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:public_url => 'http://127.0.0.1:8786/v1/%(tenant_id)s',
|
||||||
|
:admin_url => 'http://127.0.0.1:8786/v1/%(tenant_id)s',
|
||||||
|
:internal_url => 'http://127.0.0.1:8786/v1/%(tenant_id)s'
|
||||||
|
) }
|
||||||
|
it { is_expected.to contain_keystone_endpoint('RegionOne/manilav2::sharev2').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:public_url => 'http://127.0.0.1:8786/v2/%(tenant_id)s',
|
||||||
|
:admin_url => 'http://127.0.0.1:8786/v2/%(tenant_id)s',
|
||||||
|
:internal_url => 'http://127.0.0.1:8786/v2/%(tenant_id)s'
|
||||||
|
) }
|
||||||
|
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/manila::share').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:public_url => 'http://127.0.0.1:8786/v1/%(tenant_id)s',
|
|
||||||
:admin_url => 'http://127.0.0.1:8786/v1/%(tenant_id)s',
|
|
||||||
:internal_url => 'http://127.0.0.1:8786/v1/%(tenant_id)s'
|
|
||||||
) }
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/manilav2::sharev2').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:public_url => 'http://127.0.0.1:8786/v2/%(tenant_id)s',
|
|
||||||
:admin_url => 'http://127.0.0.1:8786/v2/%(tenant_id)s',
|
|
||||||
:internal_url => 'http://127.0.0.1:8786/v2/%(tenant_id)s'
|
|
||||||
) }
|
|
||||||
|
|
||||||
end
|
context 'when overriding endpoint parameters' do
|
||||||
|
before do
|
||||||
|
params.merge!(
|
||||||
|
:region => 'RegionThree',
|
||||||
|
:public_url => 'https://10.0.42.1:4242/v42/%(tenant_id)s',
|
||||||
|
:admin_url => 'https://10.0.42.2:4242/v42/%(tenant_id)s',
|
||||||
|
:internal_url => 'https://10.0.42.3:4242/v42/%(tenant_id)s',
|
||||||
|
:public_url_v2 => 'https://10.0.42.1:4242/v43/%(tenant_id)s',
|
||||||
|
:admin_url_v2 => 'https://10.0.42.2:4242/v43/%(tenant_id)s',
|
||||||
|
:internal_url_v2 => 'https://10.0.42.3:4242/v43/%(tenant_id)s'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
context 'when overriding endpoint parameters' do
|
it { is_expected.to contain_keystone_endpoint('RegionThree/manila::share').with(
|
||||||
before do
|
:ensure => 'present',
|
||||||
params.merge!(
|
:public_url => 'https://10.0.42.1:4242/v42/%(tenant_id)s',
|
||||||
:region => 'RegionThree',
|
:admin_url => 'https://10.0.42.2:4242/v42/%(tenant_id)s',
|
||||||
:public_url => 'https://10.0.42.1:4242/v42/%(tenant_id)s',
|
:internal_url => 'https://10.0.42.3:4242/v42/%(tenant_id)s'
|
||||||
:admin_url => 'https://10.0.42.2:4242/v42/%(tenant_id)s',
|
)}
|
||||||
:internal_url => 'https://10.0.42.3:4242/v42/%(tenant_id)s',
|
it { is_expected.to contain_keystone_endpoint('RegionThree/manilav2::sharev2').with(
|
||||||
:public_url_v2 => 'https://10.0.42.1:4242/v43/%(tenant_id)s',
|
:ensure => 'present',
|
||||||
:admin_url_v2 => 'https://10.0.42.2:4242/v43/%(tenant_id)s',
|
:public_url => 'https://10.0.42.1:4242/v43/%(tenant_id)s',
|
||||||
:internal_url_v2 => 'https://10.0.42.3:4242/v43/%(tenant_id)s'
|
:admin_url => 'https://10.0.42.2:4242/v43/%(tenant_id)s',
|
||||||
)
|
:internal_url => 'https://10.0.42.3:4242/v43/%(tenant_id)s'
|
||||||
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionThree/manila::share').with(
|
context 'when endpoint should not be configured' do
|
||||||
:ensure => 'present',
|
before do
|
||||||
:public_url => 'https://10.0.42.1:4242/v42/%(tenant_id)s',
|
params.merge!(
|
||||||
:admin_url => 'https://10.0.42.2:4242/v42/%(tenant_id)s',
|
:configure_endpoint => false,
|
||||||
:internal_url => 'https://10.0.42.3:4242/v42/%(tenant_id)s'
|
:configure_endpoint_v2 => false
|
||||||
)}
|
)
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionThree/manilav2::sharev2').with(
|
end
|
||||||
:ensure => 'present',
|
it { is_expected.to_not contain_keystone_endpoint('RegionOne/manila::share') }
|
||||||
:public_url => 'https://10.0.42.1:4242/v43/%(tenant_id)s',
|
it { is_expected.to_not contain_keystone_endpoint('RegionOne/manilav2::sharev2') }
|
||||||
:admin_url => 'https://10.0.42.2:4242/v43/%(tenant_id)s',
|
|
||||||
:internal_url => 'https://10.0.42.3:4242/v43/%(tenant_id)s'
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when endpoint should not be configured' do
|
|
||||||
before do
|
|
||||||
params.merge!(
|
|
||||||
:configure_endpoint => false,
|
|
||||||
:configure_endpoint_v2 => false
|
|
||||||
)
|
|
||||||
end
|
|
||||||
it { is_expected.to_not contain_keystone_endpoint('RegionOne/manila::share') }
|
|
||||||
it { is_expected.to_not contain_keystone_endpoint('RegionOne/manilav2::sharev2') }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when overriding service names' do
|
|
||||||
|
|
||||||
before do
|
|
||||||
params.merge!(
|
|
||||||
:service_name => 'manila_service',
|
|
||||||
:service_name_v2 => 'manila_service_v2',
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user('manila') }
|
context 'when overriding service names' do
|
||||||
it { is_expected.to contain_keystone_user_role('manila@services') }
|
|
||||||
it { is_expected.to contain_keystone_service('manila_service::share') }
|
|
||||||
it { is_expected.to contain_keystone_service('manila_service_v2::sharev2') }
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/manila_service::share') }
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/manila_service_v2::sharev2') }
|
|
||||||
|
|
||||||
|
before do
|
||||||
|
params.merge!(
|
||||||
|
:service_name => 'manila_service',
|
||||||
|
:service_name_v2 => 'manila_service_v2',
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_keystone_user('manila') }
|
||||||
|
it { is_expected.to contain_keystone_user_role('manila@services') }
|
||||||
|
it { is_expected.to contain_keystone_service('manila_service::share') }
|
||||||
|
it { is_expected.to contain_keystone_service('manila_service_v2::sharev2') }
|
||||||
|
it { is_expected.to contain_keystone_endpoint('RegionOne/manila_service::share') }
|
||||||
|
it { is_expected.to contain_keystone_endpoint('RegionOne/manila_service_v2::sharev2') }
|
||||||
|
|
||||||
|
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({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it_behaves_like 'manila::keystone::auth'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -25,10 +25,6 @@ describe 'manila::network::neutron' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
let :facts do
|
|
||||||
OSDefaults.get_facts({})
|
|
||||||
end
|
|
||||||
|
|
||||||
shared_examples_for 'neutron network plugin' do
|
shared_examples_for 'neutron network plugin' do
|
||||||
let :params_hash do
|
let :params_hash do
|
||||||
default_params.merge(params)
|
default_params.merge(params)
|
||||||
@ -46,15 +42,25 @@ describe 'manila::network::neutron' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
context 'with default parameters' do
|
|
||||||
before do
|
on_supported_os({
|
||||||
params = {}
|
:supported_os => OSDefaults.get_supported_os
|
||||||
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
context 'with default parameters' do
|
||||||
|
before do
|
||||||
|
params = {}
|
||||||
|
end
|
||||||
|
it_configures 'neutron network plugin'
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with provided parameters' do
|
||||||
|
it_configures 'neutron network plugin'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it_configures 'neutron network plugin'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with provided parameters' do
|
|
||||||
it_configures 'neutron network plugin'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -2,11 +2,17 @@ require 'spec_helper'
|
|||||||
|
|
||||||
describe 'manila::params' do
|
describe 'manila::params' do
|
||||||
|
|
||||||
let :facts do
|
on_supported_os({
|
||||||
@default_facts.merge({:osfamily => 'Debian'})
|
:supported_os => OSDefaults.get_supported_os
|
||||||
end
|
}).each do |os,facts|
|
||||||
it 'should compile' do
|
context "on #{os}" do
|
||||||
subject
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it 'should compile' do
|
||||||
|
subject
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -2,59 +2,73 @@ require 'spec_helper'
|
|||||||
|
|
||||||
describe 'manila::quota' do
|
describe 'manila::quota' do
|
||||||
|
|
||||||
describe 'with default parameters' do
|
shared_examples_for 'manila::quota' do
|
||||||
it 'contains default values' do
|
context 'with default parameters' do
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_shares').with(
|
it 'contains default values' do
|
||||||
:value => 10)
|
is_expected.to contain_manila_config('DEFAULT/quota_shares').with(
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_snapshots').with(
|
:value => 10)
|
||||||
:value => 10)
|
is_expected.to contain_manila_config('DEFAULT/quota_snapshots').with(
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_gigabytes').with(
|
:value => 10)
|
||||||
:value => 1000)
|
is_expected.to contain_manila_config('DEFAULT/quota_gigabytes').with(
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
|
:value => 1000)
|
||||||
:value => 'manila.quota.DbQuotaDriver')
|
is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_snapshot_gigabytes').with(
|
:value => 'manila.quota.DbQuotaDriver')
|
||||||
:value => 1000)
|
is_expected.to contain_manila_config('DEFAULT/quota_snapshot_gigabytes').with(
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_share_networks').with(
|
:value => 1000)
|
||||||
:value => 10)
|
is_expected.to contain_manila_config('DEFAULT/quota_share_networks').with(
|
||||||
is_expected.to contain_manila_config('DEFAULT/reservation_expire').with(
|
:value => 10)
|
||||||
:value => 86400)
|
is_expected.to contain_manila_config('DEFAULT/reservation_expire').with(
|
||||||
is_expected.to contain_manila_config('DEFAULT/until_refresh').with(
|
:value => 86400)
|
||||||
:value => 0)
|
is_expected.to contain_manila_config('DEFAULT/until_refresh').with(
|
||||||
is_expected.to contain_manila_config('DEFAULT/max_age').with(
|
:value => 0)
|
||||||
:value => 0)
|
is_expected.to contain_manila_config('DEFAULT/max_age').with(
|
||||||
|
:value => 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with overridden parameters' do
|
||||||
|
let :params do
|
||||||
|
{ :quota_shares => 1000,
|
||||||
|
:quota_snapshots => 1000,
|
||||||
|
:quota_gigabytes => 100000,
|
||||||
|
:quota_snapshot_gigabytes => 10000,
|
||||||
|
:quota_share_networks => 100,
|
||||||
|
:reservation_expire => 864000,
|
||||||
|
:until_refresh => 10,
|
||||||
|
:max_age => 10,}
|
||||||
|
end
|
||||||
|
it 'contains overrided values' do
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/quota_shares').with(
|
||||||
|
:value => 1000)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/quota_snapshots').with(
|
||||||
|
:value => 1000)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/quota_gigabytes').with(
|
||||||
|
:value => 100000)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
|
||||||
|
:value => 'manila.quota.DbQuotaDriver')
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/quota_snapshot_gigabytes').with(
|
||||||
|
:value => 10000)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/quota_share_networks').with(
|
||||||
|
:value => 100)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/reservation_expire').with(
|
||||||
|
:value => 864000)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/until_refresh').with(
|
||||||
|
:value => 10)
|
||||||
|
is_expected.to contain_manila_config('DEFAULT/max_age').with(
|
||||||
|
:value => 10)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'with overridden parameters' do
|
on_supported_os({
|
||||||
let :params do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
{ :quota_shares => 1000,
|
}).each do |os,facts|
|
||||||
:quota_snapshots => 1000,
|
context "on #{os}" do
|
||||||
:quota_gigabytes => 100000,
|
let (:facts) do
|
||||||
:quota_snapshot_gigabytes => 10000,
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
||||||
:quota_share_networks => 100,
|
end
|
||||||
:reservation_expire => 864000,
|
it_behaves_like 'manila::quota'
|
||||||
:until_refresh => 10,
|
|
||||||
:max_age => 10,}
|
|
||||||
end
|
|
||||||
it 'contains overrided values' do
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_shares').with(
|
|
||||||
:value => 1000)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_snapshots').with(
|
|
||||||
:value => 1000)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_gigabytes').with(
|
|
||||||
:value => 100000)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
|
|
||||||
:value => 'manila.quota.DbQuotaDriver')
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_snapshot_gigabytes').with(
|
|
||||||
:value => 10000)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_share_networks').with(
|
|
||||||
:value => 100)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/reservation_expire').with(
|
|
||||||
:value => 864000)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/until_refresh').with(
|
|
||||||
:value => 10)
|
|
||||||
is_expected.to contain_manila_config('DEFAULT/max_age').with(
|
|
||||||
:value => 10)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -2,68 +2,74 @@ require 'spec_helper'
|
|||||||
|
|
||||||
describe 'manila::rabbitmq' do
|
describe 'manila::rabbitmq' do
|
||||||
|
|
||||||
let :facts do
|
shared_examples_for 'manila::rabbitmq' do
|
||||||
@default_facts.merge({ :puppetversion => '2.7',
|
context 'with defaults' do
|
||||||
:osfamily => 'Debian',
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with defaults' do
|
it 'should contain all of the default resources' do
|
||||||
|
|
||||||
it 'should contain all of the default resources' do
|
is_expected.to contain_rabbitmq_vhost('/').with(
|
||||||
|
:provider => 'rabbitmqctl'
|
||||||
is_expected.to contain_rabbitmq_vhost('/').with(
|
)
|
||||||
:provider => 'rabbitmqctl'
|
end
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when a rabbitmq user is specified' do
|
|
||||||
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:userid => 'dan',
|
|
||||||
:password => 'pass'
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should contain user and permissions' do
|
|
||||||
|
|
||||||
is_expected.to contain_rabbitmq_user('dan').with(
|
|
||||||
:admin => true,
|
|
||||||
:password => 'pass',
|
|
||||||
:provider => 'rabbitmqctl'
|
|
||||||
)
|
|
||||||
|
|
||||||
is_expected.to contain_rabbitmq_user_permissions('dan@/').with(
|
|
||||||
:configure_permission => '.*',
|
|
||||||
:write_permission => '.*',
|
|
||||||
:read_permission => '.*',
|
|
||||||
:provider => 'rabbitmqctl'
|
|
||||||
)
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
context 'when a rabbitmq user is specified' do
|
||||||
|
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:userid => 'dan',
|
||||||
|
:password => 'pass'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should contain user and permissions' do
|
||||||
|
|
||||||
|
is_expected.to contain_rabbitmq_user('dan').with(
|
||||||
|
:admin => true,
|
||||||
|
:password => 'pass',
|
||||||
|
:provider => 'rabbitmqctl'
|
||||||
|
)
|
||||||
|
|
||||||
|
is_expected.to contain_rabbitmq_user_permissions('dan@/').with(
|
||||||
|
:configure_permission => '.*',
|
||||||
|
:write_permission => '.*',
|
||||||
|
:read_permission => '.*',
|
||||||
|
:provider => 'rabbitmqctl'
|
||||||
|
)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
describe 'when disabled' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:userid => 'dan',
|
|
||||||
:password => 'pass',
|
|
||||||
:enabled => false
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should be disabled' do
|
context 'when disabled' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:userid => 'dan',
|
||||||
|
:password => 'pass',
|
||||||
|
:enabled => false
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
is_expected.to_not contain_rabbitmq_user('dan')
|
it 'should be disabled' do
|
||||||
is_expected.to_not contain_rabbitmq_user_permissions('dan@/')
|
|
||||||
is_expected.to_not contain_rabbitmq_vhost('/')
|
|
||||||
|
|
||||||
|
is_expected.to_not contain_rabbitmq_user('dan')
|
||||||
|
is_expected.to_not contain_rabbitmq_user_permissions('dan@/')
|
||||||
|
is_expected.to_not contain_rabbitmq_vhost('/')
|
||||||
|
|
||||||
|
end
|
||||||
end
|
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({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it_behaves_like 'manila::rabbitmq'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -2,13 +2,9 @@ require 'spec_helper'
|
|||||||
|
|
||||||
describe 'manila::scheduler' do
|
describe 'manila::scheduler' do
|
||||||
|
|
||||||
describe 'on debian platforms' do
|
shared_examples_for 'manila::scheduler on Debian' do
|
||||||
|
|
||||||
let :facts do
|
context 'with default parameters' do
|
||||||
@default_facts.merge({ :osfamily => 'Debian' })
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with default parameters' do
|
|
||||||
|
|
||||||
it { is_expected.to contain_class('manila::params') }
|
it { is_expected.to contain_class('manila::params') }
|
||||||
|
|
||||||
@ -27,7 +23,7 @@ describe 'manila::scheduler' do
|
|||||||
) }
|
) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'with parameters' do
|
context 'with parameters' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{ :scheduler_driver => 'manila.scheduler.filter_scheduler.FilterScheduler',
|
{ :scheduler_driver => 'manila.scheduler.filter_scheduler.FilterScheduler',
|
||||||
@ -39,7 +35,7 @@ describe 'manila::scheduler' do
|
|||||||
it { is_expected.to contain_package('manila-scheduler').with_ensure('present') }
|
it { is_expected.to contain_package('manila-scheduler').with_ensure('present') }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'with manage_service false' do
|
context 'with manage_service false' do
|
||||||
let :params do
|
let :params do
|
||||||
{ 'manage_service' => false
|
{ 'manage_service' => false
|
||||||
}
|
}
|
||||||
@ -51,13 +47,9 @@ describe 'manila::scheduler' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
describe 'on rhel platforms' do
|
shared_examples_for 'manila::scheduler on RedHat' do
|
||||||
|
|
||||||
let :facts do
|
context 'with default parameters' do
|
||||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with default parameters' do
|
|
||||||
|
|
||||||
it { is_expected.to contain_class('manila::params') }
|
it { is_expected.to contain_class('manila::params') }
|
||||||
|
|
||||||
@ -69,7 +61,7 @@ describe 'manila::scheduler' do
|
|||||||
) }
|
) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'with parameters' do
|
context 'with parameters' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{ :scheduler_driver => 'manila.scheduler.filter_scheduler.FilterScheduler' }
|
{ :scheduler_driver => 'manila.scheduler.filter_scheduler.FilterScheduler' }
|
||||||
@ -78,4 +70,16 @@ describe 'manila::scheduler' do
|
|||||||
it { is_expected.to contain_manila_config('DEFAULT/scheduler_driver').with_value('manila.scheduler.filter_scheduler.FilterScheduler') }
|
it { is_expected.to contain_manila_config('DEFAULT/scheduler_driver').with_value('manila.scheduler.filter_scheduler.FilterScheduler') }
|
||||||
end
|
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({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it_behaves_like "manila::scheduler on #{facts[:osfamily]}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -20,16 +20,30 @@ describe 'manila::share::generic' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'generic share driver' do
|
shared_examples_for 'manila::share::generic' do
|
||||||
it 'configures generic share driver' do
|
context 'generic share driver' do
|
||||||
is_expected.to contain_manila_config('DEFAULT/share_driver').with_value(
|
it 'configures generic share driver' do
|
||||||
'manila.share.drivers.generic.GenericShareDriver')
|
is_expected.to contain_manila_config('DEFAULT/share_driver').with_value(
|
||||||
is_expected.to contain_manila_config('DEFAULT/share_helpers').with_value(
|
'manila.share.drivers.generic.GenericShareDriver')
|
||||||
'CIFS=manila.share.drivers.helpers.CIFSHelperIPAccess,'\
|
is_expected.to contain_manila_config('DEFAULT/share_helpers').with_value(
|
||||||
'NFS=manila.share.drivers.helpers.NFSHelper')
|
'CIFS=manila.share.drivers.helpers.CIFSHelperIPAccess,'\
|
||||||
params.each_pair do |config,value|
|
'NFS=manila.share.drivers.helpers.NFSHelper')
|
||||||
is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value )
|
params.each_pair do |config,value|
|
||||||
|
is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
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({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it_behaves_like 'manila::share::generic'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -21,20 +21,14 @@ describe 'manila::share::glusterfs' do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
on_supported_os({
|
||||||
let :facts do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
@default_facts.merge({ :osfamily => 'Debian' })
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
it_behaves_like 'glusterfs share driver'
|
||||||
end
|
end
|
||||||
|
|
||||||
it_configures 'glusterfs share driver'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on RedHat platforms' do
|
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures 'glusterfs share driver'
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -48,16 +48,25 @@ describe 'manila::share::netapp' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
context 'with default parameters' do
|
on_supported_os({
|
||||||
before do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
params = {}
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
context 'with default parameters' do
|
||||||
|
before do
|
||||||
|
params = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
it_configures 'netapp share driver'
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with provided parameters' do
|
||||||
|
it_configures 'netapp share driver'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it_configures 'netapp share driver'
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with provided parameters' do
|
|
||||||
it_configures 'netapp share driver'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -27,28 +27,24 @@ describe 'manila::share' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
on_supported_os({
|
||||||
let :facts do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
@default_facts.merge({ :osfamily => 'Debian' })
|
}).each do |os,facts|
|
||||||
end
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
||||||
|
end
|
||||||
|
|
||||||
let :platform_params do
|
let :platform_params do
|
||||||
{ :package_name => 'manila-share' }
|
case facts[:osfamily]
|
||||||
end
|
when 'Debian'
|
||||||
|
{ :package_name => 'manila-share' }
|
||||||
|
when 'RedHat'
|
||||||
|
{ :package_name => 'openstack-manila-share' }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it_configures 'manila-share'
|
it_behaves_like 'manila-share'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on RedHat platforms' do
|
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
|
||||||
end
|
|
||||||
|
|
||||||
let :platform_params do
|
|
||||||
{ :package_name => 'openstack-manila-share' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures 'manila-share'
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user