puppet-manila/spec/defines/manila_backend_netapp_spec.rb
Gael Chamoulaud d60db0c73e Spec: updates for rspec-puppet 2.x and rspec 3.x
This patch aim to update our specs test in order to work with the new
rspec-puppet release 2.0.0, in the mean time, we update rspec syntax
in order to be prepared for rspec 3.x move.

In details:

* Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
* Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
* Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper)

Change-Id: I062afe69fea8acb4785c537df7400d9c5d7034b4
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-15 17:24:02 +01:00

59 lines
1.5 KiB
Ruby

require 'spec_helper'
describe 'manila::backend::netapp' do
let(:title) {'mynetapp'}
let :params do
{
:netapp_nas_login => 'netapp',
:netapp_nas_password => 'password',
:netapp_nas_server_hostname => '127.0.0.2',
:netapp_root_volume_aggregate => 'aggr1',
}
end
let :default_params do
{
:netapp_nas_transport_type => 'http',
:netapp_nas_volume_name_template => 'share_%(share_id)s',
:netapp_vserver_name_template => 'os_%s',
:netapp_lif_name_template => 'os_%(net_allocation_id)s',
:netapp_aggregate_name_search_pattern => '(.*)',
:netapp_root_volume_name => 'root',
}
end
shared_examples_for 'netapp share driver' do
let :params_hash do
default_params.merge(params)
end
it 'configures netapp share driver' do
is_expected.to contain_manila_config("mynetapp/share_driver").with_value(
'manila.share.drivers.netapp.cluster_mode.NetAppClusteredShareDriver')
params_hash.each_pair do |config,value|
is_expected.to contain_manila_config("mynetapp/#{config}").with_value( value )
end
end
it 'marks netapp_password as secret' do
is_expected.to contain_manila_config("mynetapp/netapp_nas_password").with_secret( true )
end
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