3 describe 'cinder::volume::netapp' do
7 :netapp_login => 'netapp',
8 :netapp_password => 'password',
9 :netapp_server_hostname => '127.0.0.2',
13 let :default_params do
15 :netapp_server_port => '80',
16 :netapp_size_multiplier => '1.2',
17 :netapp_storage_family => 'ontap_cluster',
18 :netapp_storage_protocol => 'nfs',
19 :netapp_transport_type => 'http',
21 :netapp_volume_list => '',
22 :netapp_vserver => '',
23 :expiry_thres_minutes => '720',
24 :thres_avl_size_perc_start => '20',
25 :thres_avl_size_perc_stop => '60',
26 :nfs_shares_config => '/etc/cinder/shares.conf',
27 :netapp_copyoffload_tool_path => '',
28 :netapp_controller_ips => '',
29 :netapp_sa_password => '',
30 :netapp_storage_pools => '',
31 :nfs_mount_options => nil,
32 :netapp_webservice_path => '/devmgr/v2',
37 shared_examples_for 'netapp volume driver' do
39 default_params.merge(params)
42 it 'configures netapp volume driver' do
43 should contain_cinder_config('DEFAULT/volume_driver').with_value(
44 'cinder.volume.drivers.netapp.common.NetAppDriver')
45 params_hash.each_pair do |config,value|
46 should contain_cinder_config("DEFAULT/#{config}").with_value( value )
50 it 'marks netapp_password as secret' do
51 should contain_cinder_config('DEFAULT/netapp_password').with_secret( true )
54 it 'marks netapp_sa_password as secret' do
55 should contain_cinder_config('DEFAULT/netapp_sa_password').with_secret( true )
60 context 'with default parameters' do
65 it_configures 'netapp volume driver'
68 context 'with provided parameters' do
69 it_configures 'netapp volume driver'
72 context 'with NFS shares provided' do
73 let (:req_params) { params.merge!({
74 :nfs_shares => ['10.0.0.1:/test1', '10.0.0.2:/test2'],
75 :nfs_shares_config => '/etc/cinder/shares.conf',
78 it 'writes NFS shares to file' do
79 should contain_file("#{req_params[:nfs_shares_config]}")
80 .with_content("10.0.0.1:/test1\n10.0.0.2:/test2")