puppet-manila/spec/defines/manila_backend_generic_spec.rb
silvacarloss a0610b687e Add ability to configure backend availability zones
Add new "backend_availability_zone" parameter to every share
backend. The parameters are optional, and when set they override the
DEFAULT/storage_availability_zone for the corresponding backend.

Change-Id: Ie7af8408fe8cec9349593fd9b4cb5bc7deb565cd
2021-09-24 22:37:25 +09:00

53 lines
1.7 KiB
Ruby

require 'spec_helper'
describe 'manila::backend::generic' do
let(:title) {'hippo'}
let :params do
{
:driver_handles_share_servers => true,
:smb_template_config_path => '$state_path/smb.conf',
:volume_name_template => 'manila-share-%s',
:volume_snapshot_name_template => 'manila-snapshot-%s',
:share_mount_path => '/shares',
:max_time_to_create_volume => 180,
:max_time_to_attach => 120,
:service_instance_smb_config_path => '$share_mount_path/smb.conf',
:share_volume_fstype => 'ext4',
:cinder_volume_type => 'gold',
:backend_availability_zone => 'my_zone',
}
end
shared_examples 'manila::backend::generic' do
context 'generic share driver' do
it 'configures generic share driver' do
is_expected.to contain_manila_config('hippo/share_backend_name').with(
:value => 'hippo')
is_expected.to contain_manila_config('hippo/share_driver').with_value(
'manila.share.drivers.generic.GenericShareDriver')
is_expected.to contain_manila_config('hippo/share_helpers').with_value(
'CIFS=manila.share.drivers.helpers.CIFSHelperIPAccess,'\
'NFS=manila.share.drivers.helpers.NFSHelper')
params.each_pair do |config,value|
is_expected.to contain_manila_config("hippo/#{config}").with_value( value )
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())
end
it_behaves_like 'manila::backend::generic'
end
end
end