Convert specs to RSpec 3.8.0 syntax with Transpec
This conversion is done by Transpec 3.4.0
This patch complements c09a93456e
adding all files inside defines/ dir.
Partial-Bug: #1816857
Change-Id: Ic00f8b38c5b84ff19fc945512f4f13aa11221c8b
This commit is contained in:
parent
634b8da099
commit
ae0c571a52
@ -13,16 +13,16 @@ describe 'cinder::backend::bdd' do
|
||||
shared_examples 'cinder block device' do
|
||||
context 'with default parameters' do
|
||||
it {
|
||||
should contain_cinder_config('hippo/volume_backend_name').with_value('hippo')
|
||||
should contain_cinder_config('hippo/volume_driver').with_value('cinder.volume.drivers.block_device.BlockDeviceDriver')
|
||||
should contain_cinder_config('hippo/available_devices').with_value('/dev/sda')
|
||||
should contain_cinder_config('hippo/target_helper').with_value('tgtadm')
|
||||
should contain_cinder_config('hippo/volumes_dir').with_value('/var/lib/cinder/volumes')
|
||||
should contain_cinder_config('hippo/target_ip_address').with_value('127.0.0.2')
|
||||
should contain_cinder_config('hippo/volume_group').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('hippo/target_protocol').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('hippo/volume_clear').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('hippo/backend_availability_zone').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('hippo/volume_backend_name').with_value('hippo')
|
||||
is_expected.to contain_cinder_config('hippo/volume_driver').with_value('cinder.volume.drivers.block_device.BlockDeviceDriver')
|
||||
is_expected.to contain_cinder_config('hippo/available_devices').with_value('/dev/sda')
|
||||
is_expected.to contain_cinder_config('hippo/target_helper').with_value('tgtadm')
|
||||
is_expected.to contain_cinder_config('hippo/volumes_dir').with_value('/var/lib/cinder/volumes')
|
||||
is_expected.to contain_cinder_config('hippo/target_ip_address').with_value('127.0.0.2')
|
||||
is_expected.to contain_cinder_config('hippo/volume_group').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('hippo/target_protocol').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('hippo/volume_clear').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('<SERVICE DEFAULT>')
|
||||
}
|
||||
end
|
||||
|
||||
@ -41,16 +41,16 @@ describe 'cinder::backend::bdd' do
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_cinder_config('hippo/available_devices').with_value('/dev/sdb,/dev/sdc')
|
||||
should contain_cinder_config('hippo/volumes_dir').with_value('/var/lib/cinder/bdd-volumes')
|
||||
should contain_cinder_config('hippo/target_ip_address').with_value('10.20.0.2')
|
||||
should contain_cinder_config('hippo/target_helper').with_value('lioadm')
|
||||
should contain_cinder_config('hippo/volume_group').with_value('cinder')
|
||||
should contain_cinder_config('hippo/volume_clear').with_value('zero')
|
||||
should contain_cinder_config('hippo/backend_availability_zone').with_value('my_zone')
|
||||
is_expected.to contain_cinder_config('hippo/available_devices').with_value('/dev/sdb,/dev/sdc')
|
||||
is_expected.to contain_cinder_config('hippo/volumes_dir').with_value('/var/lib/cinder/bdd-volumes')
|
||||
is_expected.to contain_cinder_config('hippo/target_ip_address').with_value('10.20.0.2')
|
||||
is_expected.to contain_cinder_config('hippo/target_helper').with_value('lioadm')
|
||||
is_expected.to contain_cinder_config('hippo/volume_group').with_value('cinder')
|
||||
is_expected.to contain_cinder_config('hippo/volume_clear').with_value('zero')
|
||||
is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('my_zone')
|
||||
}
|
||||
|
||||
it { should contain_cinder_type('hippo').with(
|
||||
it { is_expected.to contain_cinder_type('hippo').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=hippo']
|
||||
)}
|
||||
@ -61,7 +61,7 @@ describe 'cinder::backend::bdd' do
|
||||
params.merge!( :extra_options => {'hippo/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('hippo/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('hippo/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'with deprecated iscsi_ip_address' do
|
||||
@ -72,7 +72,7 @@ describe 'cinder::backend::bdd' do
|
||||
})
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('hippo/target_ip_address').with_value('127.0.0.42') }
|
||||
it { is_expected.to contain_cinder_config('hippo/target_ip_address').with_value('127.0.0.42') }
|
||||
end
|
||||
|
||||
context 'with no target_ip_address or iscsi_ip_address' do
|
||||
@ -80,15 +80,15 @@ describe 'cinder::backend::bdd' do
|
||||
params.delete(:target_ip_address)
|
||||
end
|
||||
|
||||
it { should raise_error(Puppet::Error, /A target_ip_address or iscsi_ip_address must be specified./) }
|
||||
it { is_expected.to raise_error(Puppet::Error, /A target_ip_address or iscsi_ip_address must be specified./) }
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'check needed daemons' do
|
||||
context 'tgtadm helper' do
|
||||
it {
|
||||
should contain_package('tgt').with_ensure('present')
|
||||
should contain_service('tgtd').with_ensure('running')
|
||||
is_expected.to contain_package('tgt').with_ensure('present')
|
||||
is_expected.to contain_service('tgtd').with_ensure('running')
|
||||
}
|
||||
end
|
||||
|
||||
@ -98,8 +98,8 @@ describe 'cinder::backend::bdd' do
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_package('targetcli').with_ensure('present')
|
||||
should contain_service('target').with_ensure('running')
|
||||
is_expected.to contain_package('targetcli').with_ensure('present')
|
||||
is_expected.to contain_service('target').with_ensure('running')
|
||||
}
|
||||
end
|
||||
|
||||
@ -108,7 +108,7 @@ describe 'cinder::backend::bdd' do
|
||||
params.merge!( :target_helper => 'fake' )
|
||||
end
|
||||
|
||||
it { should raise_error(Puppet::Error, /Unsupported target helper: fake/) }
|
||||
it { is_expected.to raise_error(Puppet::Error, /Unsupported target helper: fake/) }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -35,14 +35,14 @@ describe 'cinder::backend::dellemc_unity' do
|
||||
default_params.merge(params)
|
||||
end
|
||||
|
||||
it { should contain_cinder__backend__dellemc_unity(config_group_name) }
|
||||
it { should contain_cinder_config("#{title}/volume_driver").with(
|
||||
it { is_expected.to contain_cinder__backend__dellemc_unity(config_group_name) }
|
||||
it { is_expected.to contain_cinder_config("#{title}/volume_driver").with(
|
||||
:value => 'cinder.volume.drivers.dell_emc.unity.Driver'
|
||||
)}
|
||||
|
||||
it {
|
||||
params_hash.each_pair do |config,value|
|
||||
should contain_cinder_config("#{config_group_name}/#{config}").with_value(value)
|
||||
is_expected.to contain_cinder_config("#{config_group_name}/#{config}").with_value(value)
|
||||
end
|
||||
}
|
||||
end
|
||||
@ -65,7 +65,7 @@ describe 'cinder::backend::dellemc_unity' do
|
||||
params.merge!( :extra_options => {'dellemc_unity/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('dellemc_unity/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('dellemc_unity/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'dellemc_unity backend with cinder type' do
|
||||
@ -73,7 +73,7 @@ describe 'cinder::backend::dellemc_unity' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('dellemc_unity').with(
|
||||
it { is_expected.to contain_cinder_type('dellemc_unity').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=dellemc_unity']
|
||||
)}
|
||||
|
@ -17,9 +17,9 @@ describe 'cinder::backend::dellemc_vmax_iscsi' do
|
||||
shared_examples 'cinder::backend::dellemc_vmax_iscsi' do
|
||||
context 'dell emc vmax iscsi volume driver' do
|
||||
it {
|
||||
should contain_package('pywbem').with(:ensure => :present)
|
||||
should contain_cinder_config('dellemc_vmax_iscsi/volume_driver').with_value('cinder.volume.drivers.dell_emc.vmax.iscsi.VMAXISCSIDriver')
|
||||
should contain_cinder_config('dellemc_vmax_iscsi/cinder_emc_config_file').with_value('/etc/cinder/cinder_emc_config_CONF_GROUP_ISCSI.xml')
|
||||
is_expected.to contain_package('pywbem').with(:ensure => :present)
|
||||
is_expected.to contain_cinder_config('dellemc_vmax_iscsi/volume_driver').with_value('cinder.volume.drivers.dell_emc.vmax.iscsi.VMAXISCSIDriver')
|
||||
is_expected.to contain_cinder_config('dellemc_vmax_iscsi/cinder_emc_config_file').with_value('/etc/cinder/cinder_emc_config_CONF_GROUP_ISCSI.xml')
|
||||
}
|
||||
end
|
||||
|
||||
@ -32,11 +32,11 @@ describe 'cinder::backend::dellemc_vmax_iscsi' do
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_cinder_config('dellemc_vmax_iscsi/cinder_emc_config_file').with_value('/etc/cinder/cinder_emc_config_CONF_GROUP_ISCSI.xml')
|
||||
should contain_cinder_config('dellemc_vmax_iscsi/backend_availability_zone').with_value('my_zone')
|
||||
is_expected.to contain_cinder_config('dellemc_vmax_iscsi/cinder_emc_config_file').with_value('/etc/cinder/cinder_emc_config_CONF_GROUP_ISCSI.xml')
|
||||
is_expected.to contain_cinder_config('dellemc_vmax_iscsi/backend_availability_zone').with_value('my_zone')
|
||||
}
|
||||
|
||||
it { should contain_cinder_type('dellemc_vmax_iscsi').with(
|
||||
it { is_expected.to contain_cinder_type('dellemc_vmax_iscsi').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=dellemc_vmax_iscsi']
|
||||
)}
|
||||
@ -47,7 +47,7 @@ describe 'cinder::backend::dellemc_vmax_iscsi' do
|
||||
params.merge!( :extra_options => {'dellemc_vmax_iscsi/param1' => {'value' => 'value1'}} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('dellemc_vmax_iscsi/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('dellemc_vmax_iscsi/param1').with_value('value1') }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -38,13 +38,13 @@ describe 'cinder::backend::dellemc_xtremio_iscsi' do
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_cinder__backend__dellemc_xtremio_iscsi(config_group_name)
|
||||
should contain_cinder_config("#{title}/volume_driver").with_value('cinder.volume.drivers.dell_emc.xtremio.XtremIOISCSIDriver')
|
||||
is_expected.to contain_cinder__backend__dellemc_xtremio_iscsi(config_group_name)
|
||||
is_expected.to contain_cinder_config("#{title}/volume_driver").with_value('cinder.volume.drivers.dell_emc.xtremio.XtremIOISCSIDriver')
|
||||
}
|
||||
|
||||
it {
|
||||
params_hash.each_pair do |config,value|
|
||||
should contain_cinder_config("#{config_group_name}/#{config}").with_value( value )
|
||||
is_expected.to contain_cinder_config("#{config_group_name}/#{config}").with_value( value )
|
||||
end
|
||||
}
|
||||
end
|
||||
@ -67,7 +67,7 @@ describe 'cinder::backend::dellemc_xtremio_iscsi' do
|
||||
params.merge!( :extra_options => {'dellemc_xtremio_iscsi/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('dellemc_xtremio_iscsi/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('dellemc_xtremio_iscsi/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'dellemc_xtremio_iscsi backend with cinder type' do
|
||||
@ -75,7 +75,7 @@ describe 'cinder::backend::dellemc_xtremio_iscsi' do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('dellemc_xtremio_iscsi').with(
|
||||
it { is_expected.to contain_cinder_type('dellemc_xtremio_iscsi').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=dellemc_xtremio_iscsi']
|
||||
)}
|
||||
|
@ -53,17 +53,17 @@ describe 'cinder::backend::dellsc_iscsi' do
|
||||
default_params.merge(params)
|
||||
end
|
||||
|
||||
it { should contain_cinder__backend__dellsc_iscsi(config_group_name) }
|
||||
it { is_expected.to contain_cinder__backend__dellsc_iscsi(config_group_name) }
|
||||
|
||||
it {
|
||||
params_hash.each_pair do |config,value|
|
||||
should contain_cinder_config("#{config_group_name}/#{config}").with_value( value )
|
||||
is_expected.to contain_cinder_config("#{config_group_name}/#{config}").with_value( value )
|
||||
end
|
||||
}
|
||||
|
||||
it {
|
||||
should contain_cinder_config("#{config_group_name}/volume_driver").with_value('cinder.volume.drivers.dell_emc.sc.storagecenter_iscsi.SCISCSIDriver')
|
||||
should contain_cinder_config("#{config_group_name}/use_multipath_for_image_xfer").with_value('true')
|
||||
is_expected.to contain_cinder_config("#{config_group_name}/volume_driver").with_value('cinder.volume.drivers.dell_emc.sc.storagecenter_iscsi.SCISCSIDriver')
|
||||
is_expected.to contain_cinder_config("#{config_group_name}/use_multipath_for_image_xfer").with_value('true')
|
||||
}
|
||||
end
|
||||
|
||||
@ -85,7 +85,7 @@ describe 'cinder::backend::dellsc_iscsi' do
|
||||
params.merge!({:extra_options => {'dellsc_iscsi/param1' => { 'value' => 'value1' }}})
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('dellsc_iscsi/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('dellsc_iscsi/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'dellsc_iscsi backend with cinder type' do
|
||||
@ -93,7 +93,7 @@ describe 'cinder::backend::dellsc_iscsi' do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('dellsc_iscsi').with(:ensure => :present, :properties => ['volume_backend_name=dellsc_iscsi']) }
|
||||
it { is_expected.to contain_cinder_type('dellsc_iscsi').with(:ensure => :present, :properties => ['volume_backend_name=dellsc_iscsi']) }
|
||||
end
|
||||
|
||||
context 'with deprecated iscsi_ip_address' do
|
||||
@ -104,7 +104,7 @@ describe 'cinder::backend::dellsc_iscsi' do
|
||||
})
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('dellsc_iscsi/target_ip_address').with_value('127.0.0.42') }
|
||||
it { is_expected.to contain_cinder_config('dellsc_iscsi/target_ip_address').with_value('127.0.0.42') }
|
||||
end
|
||||
|
||||
context 'with no target_ip_address or iscsi_ip_address' do
|
||||
@ -112,7 +112,7 @@ describe 'cinder::backend::dellsc_iscsi' do
|
||||
params.delete(:target_ip_address)
|
||||
end
|
||||
|
||||
it { should raise_error(Puppet::Error, /A target_ip_address or iscsi_ip_address must be specified./) }
|
||||
it { is_expected.to raise_error(Puppet::Error, /A target_ip_address or iscsi_ip_address must be specified./) }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -19,17 +19,17 @@ describe 'cinder::backend::emc_vnx' do
|
||||
shared_examples 'cinder::backend::emc_vnx' do
|
||||
context 'emc vnx volume driver' do
|
||||
it {
|
||||
should contain_cinder_config('emc/volume_driver').with_value('cinder.volume.drivers.dell_emc.vnx.driver.VNXDriver')
|
||||
should contain_cinder_config('emc/storage_protocol').with_value('iscsi')
|
||||
should contain_cinder_config('emc/san_ip').with_value('127.0.0.2')
|
||||
should contain_cinder_config('emc/san_login').with_value('emc')
|
||||
should contain_cinder_config('emc/san_password').with_value('password').with_secret(true)
|
||||
should contain_cinder_config('emc/storage_vnx_pool_names').with_value('emc-storage-pool')
|
||||
should contain_cinder_config('emc/initiator_auto_registration').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('emc/storage_vnx_authentication_type').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('emc/storage_vnx_security_file_dir').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('emc/naviseccli_path').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('emc/backend_availability_zone').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/volume_driver').with_value('cinder.volume.drivers.dell_emc.vnx.driver.VNXDriver')
|
||||
is_expected.to contain_cinder_config('emc/storage_protocol').with_value('iscsi')
|
||||
is_expected.to contain_cinder_config('emc/san_ip').with_value('127.0.0.2')
|
||||
is_expected.to contain_cinder_config('emc/san_login').with_value('emc')
|
||||
is_expected.to contain_cinder_config('emc/san_password').with_value('password').with_secret(true)
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_pool_names').with_value('emc-storage-pool')
|
||||
is_expected.to contain_cinder_config('emc/initiator_auto_registration').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_authentication_type').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_security_file_dir').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/naviseccli_path').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/backend_availability_zone').with_value('<SERVICE DEFAULT>')
|
||||
}
|
||||
end
|
||||
|
||||
@ -47,15 +47,15 @@ describe 'cinder::backend::emc_vnx' do
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_cinder_config('emc/initiator_auto_registration').with_value(params[:initiator_auto_registration])
|
||||
should contain_cinder_config('emc/storage_vnx_authentication_type').with_value(params[:storage_vnx_auth_type])
|
||||
should contain_cinder_config('emc/storage_vnx_security_file_dir').with_value(params[:storage_vnx_security_file_dir])
|
||||
should contain_cinder_config('emc/naviseccli_path').with_value(params[:naviseccli_path])
|
||||
should contain_cinder_config('emc/storage_protocol').with_value(params[:storage_protocol])
|
||||
should contain_cinder_config('emc/backend_availability_zone').with_value(params[:backend_availability_zone])
|
||||
is_expected.to contain_cinder_config('emc/initiator_auto_registration').with_value(params[:initiator_auto_registration])
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_authentication_type').with_value(params[:storage_vnx_auth_type])
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_security_file_dir').with_value(params[:storage_vnx_security_file_dir])
|
||||
is_expected.to contain_cinder_config('emc/naviseccli_path').with_value(params[:naviseccli_path])
|
||||
is_expected.to contain_cinder_config('emc/storage_protocol').with_value(params[:storage_protocol])
|
||||
is_expected.to contain_cinder_config('emc/backend_availability_zone').with_value(params[:backend_availability_zone])
|
||||
}
|
||||
|
||||
it { should contain_cinder_type('emc').with(
|
||||
it { is_expected.to contain_cinder_type('emc').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=emc']
|
||||
)}
|
||||
@ -66,7 +66,7 @@ describe 'cinder::backend::emc_vnx' do
|
||||
params.merge!( :extra_options => {'emc/param1' => {'value' => 'value1'}} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('emc/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('emc/param1').with_value('value1') }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -25,15 +25,15 @@ describe 'cinder::backend::eqlx' do
|
||||
end
|
||||
|
||||
shared_examples 'eqlx volume driver' do
|
||||
it { should contain_cinder__backend__eqlx(config_group_name) }
|
||||
it { is_expected.to contain_cinder__backend__eqlx(config_group_name) }
|
||||
|
||||
it { should contain_cinder_config("#{config_group_name}/volume_driver").with(
|
||||
it { is_expected.to contain_cinder_config("#{config_group_name}/volume_driver").with(
|
||||
:value => 'cinder.volume.drivers.dell_emc.ps.PSSeriesISCSIDriver'
|
||||
)}
|
||||
|
||||
it {
|
||||
params.each_pair do |config,value|
|
||||
should contain_cinder_config("#{config_group_name}/#{config}").with_value(value)
|
||||
is_expected.to contain_cinder_config("#{config_group_name}/#{config}").with_value(value)
|
||||
end
|
||||
}
|
||||
end
|
||||
@ -44,7 +44,7 @@ describe 'cinder::backend::eqlx' do
|
||||
params.merge!( :extra_options => {'eqlx-1/param1' => {'value' => 'value1'}} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('eqlx-1/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('eqlx-1/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'eqlx backend with cinder type' do
|
||||
@ -52,7 +52,7 @@ describe 'cinder::backend::eqlx' do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('eqlx-1').with(
|
||||
it { is_expected.to contain_cinder_type('eqlx-1').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=eqlx-1']
|
||||
)}
|
||||
@ -76,7 +76,7 @@ describe 'cinder::backend::eqlx' do
|
||||
params.merge!( :chap_username => '<SERVICE DEFAULT>' )
|
||||
end
|
||||
|
||||
it { should raise_error(Puppet::Error, /chap_username need to be set./) }
|
||||
it { is_expected.to raise_error(Puppet::Error, /chap_username need to be set./) }
|
||||
end
|
||||
|
||||
context 'with invalid chap_password' do
|
||||
@ -84,7 +84,7 @@ describe 'cinder::backend::eqlx' do
|
||||
params.merge!( :chap_password => '<SERVICE DEFAULT>' )
|
||||
end
|
||||
|
||||
it { should raise_error(Puppet::Error, /chap_password need to be set./) }
|
||||
it { is_expected.to raise_error(Puppet::Error, /chap_password need to be set./) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -14,20 +14,20 @@ describe 'cinder::backend::glusterfs' do
|
||||
end
|
||||
|
||||
shared_examples 'glusterfs volume driver' do
|
||||
it { should contain_cinder_config('mygluster/volume_driver').with(
|
||||
it { is_expected.to contain_cinder_config('mygluster/volume_driver').with(
|
||||
:value => 'cinder.volume.drivers.glusterfs.GlusterfsDriver'
|
||||
)}
|
||||
|
||||
it {
|
||||
should contain_cinder_config('mygluster/backend_availability_zone').with_value('my_zone')
|
||||
should contain_cinder_config('mygluster/glusterfs_backup_mount_point').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('mygluster/glusterfs_backup_share').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('mygluster/glusterfs_shares_config').with_value('/etc/cinder/other_shares.conf')
|
||||
should contain_cinder_config('mygluster/glusterfs_sparsed_volumes').with_value(true)
|
||||
should contain_cinder_config('mygluster/glusterfs_mount_point_base').with_value('/cinder_mount_point')
|
||||
is_expected.to contain_cinder_config('mygluster/backend_availability_zone').with_value('my_zone')
|
||||
is_expected.to contain_cinder_config('mygluster/glusterfs_backup_mount_point').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('mygluster/glusterfs_backup_share').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('mygluster/glusterfs_shares_config').with_value('/etc/cinder/other_shares.conf')
|
||||
is_expected.to contain_cinder_config('mygluster/glusterfs_sparsed_volumes').with_value(true)
|
||||
is_expected.to contain_cinder_config('mygluster/glusterfs_mount_point_base').with_value('/cinder_mount_point')
|
||||
}
|
||||
|
||||
it { should contain_file('/etc/cinder/other_shares.conf').with(
|
||||
it { is_expected.to contain_file('/etc/cinder/other_shares.conf').with(
|
||||
:content => "10.10.10.10:/volumes\n10.10.10.11:/volumes\n",
|
||||
:require => 'Anchor[cinder::install::end]',
|
||||
:notify => 'Anchor[cinder::service::begin]'
|
||||
@ -38,7 +38,7 @@ describe 'cinder::backend::glusterfs' do
|
||||
params.merge!( :extra_options => {'mygluster/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('mygluster/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('mygluster/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'glusterfs backend with cinder type' do
|
||||
@ -46,7 +46,7 @@ describe 'cinder::backend::glusterfs' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('mygluster').with(
|
||||
it { is_expected.to contain_cinder_type('mygluster').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=mygluster']
|
||||
)}
|
||||
|
@ -44,13 +44,13 @@ describe 'cinder::backend::gpfs' do
|
||||
default_params.merge(params)
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('gpfs/volume_driver').with(
|
||||
it { is_expected.to contain_cinder_config('gpfs/volume_driver').with(
|
||||
:value => 'cinder.volume.drivers.ibm.gpfs.GPFSDriver'
|
||||
)}
|
||||
|
||||
it {
|
||||
params_hash.each_pair do |config,value|
|
||||
should contain_cinder_config("gpfs/#{config}").with_value( value )
|
||||
is_expected.to contain_cinder_config("gpfs/#{config}").with_value( value )
|
||||
end
|
||||
}
|
||||
end
|
||||
@ -86,7 +86,7 @@ describe 'cinder::backend::gpfs' do
|
||||
})
|
||||
end
|
||||
|
||||
it { should raise_error(Puppet::Error, /gpfs_images_share_mode only in conjunction with gpfs_images_dir/) }
|
||||
it { is_expected.to raise_error(Puppet::Error, /gpfs_images_share_mode only in conjunction with gpfs_images_dir/) }
|
||||
end
|
||||
|
||||
context 'with wrong gpfs_images_share_mode' do
|
||||
@ -96,7 +96,7 @@ describe 'cinder::backend::gpfs' do
|
||||
})
|
||||
end
|
||||
|
||||
it { should raise_error(Puppet::Error, /gpfs_images_share_mode only support `copy` or `copy_on_write`/) }
|
||||
it { is_expected.to raise_error(Puppet::Error, /gpfs_images_share_mode only support `copy` or `copy_on_write`/) }
|
||||
end
|
||||
|
||||
context 'gpfs backend with cinder type' do
|
||||
@ -104,7 +104,7 @@ describe 'cinder::backend::gpfs' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('gpfs').with(
|
||||
it { is_expected.to contain_cinder_type('gpfs').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=gpfs']
|
||||
)}
|
||||
@ -115,7 +115,7 @@ describe 'cinder::backend::gpfs' do
|
||||
params.merge!( :extra_options => {'gpfs/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('gpfs/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('gpfs/param1').with_value('value1') }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -23,15 +23,15 @@ describe 'cinder::backend::hpe3par_iscsi' do
|
||||
shared_examples 'cinder::backend::hpe3par_iscsi' do
|
||||
context 'hpe3par_iscsi volume driver' do
|
||||
it {
|
||||
should contain_cinder_config('hpe3par_iscsi/volume_driver').with_value('cinder.volume.drivers.hpe.hpe_3par_iscsi.HPE3PARISCSIDriver')
|
||||
should contain_cinder_config('hpe3par_iscsi/backend_availability_zone').with_value('my_zone')
|
||||
should contain_cinder_config('hpe3par_iscsi/hpe3par_api_url').with_value('https://172.0.0.2:8080/api/v1')
|
||||
should contain_cinder_config('hpe3par_iscsi/hpe3par_username').with_value('3paradm')
|
||||
should contain_cinder_config('hpe3par_iscsi/hpe3par_password').with_value('password')
|
||||
should contain_cinder_config('hpe3par_iscsi/hpe3par_iscsi_ips').with_value('172.0.0.3')
|
||||
should contain_cinder_config('hpe3par_iscsi/san_ip').with_value('172.0.0.2')
|
||||
should contain_cinder_config('hpe3par_iscsi/san_login').with_value('3paradm')
|
||||
should contain_cinder_config('hpe3par_iscsi/san_password').with_value('password')
|
||||
is_expected.to contain_cinder_config('hpe3par_iscsi/volume_driver').with_value('cinder.volume.drivers.hpe.hpe_3par_iscsi.HPE3PARISCSIDriver')
|
||||
is_expected.to contain_cinder_config('hpe3par_iscsi/backend_availability_zone').with_value('my_zone')
|
||||
is_expected.to contain_cinder_config('hpe3par_iscsi/hpe3par_api_url').with_value('https://172.0.0.2:8080/api/v1')
|
||||
is_expected.to contain_cinder_config('hpe3par_iscsi/hpe3par_username').with_value('3paradm')
|
||||
is_expected.to contain_cinder_config('hpe3par_iscsi/hpe3par_password').with_value('password')
|
||||
is_expected.to contain_cinder_config('hpe3par_iscsi/hpe3par_iscsi_ips').with_value('172.0.0.3')
|
||||
is_expected.to contain_cinder_config('hpe3par_iscsi/san_ip').with_value('172.0.0.2')
|
||||
is_expected.to contain_cinder_config('hpe3par_iscsi/san_login').with_value('3paradm')
|
||||
is_expected.to contain_cinder_config('hpe3par_iscsi/san_password').with_value('password')
|
||||
}
|
||||
end
|
||||
|
||||
@ -40,7 +40,7 @@ describe 'cinder::backend::hpe3par_iscsi' do
|
||||
params.merge!( :extra_options => {'hpe3par_iscsi/param1' => {'value' => 'value1'}} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('hpe3par_iscsi/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('hpe3par_iscsi/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'hpe3par_iscsi backend with cinder type' do
|
||||
@ -48,7 +48,7 @@ describe 'cinder::backend::hpe3par_iscsi' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('hpe3par_iscsi').with(
|
||||
it { is_expected.to contain_cinder_type('hpe3par_iscsi').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=hpe3par_iscsi']
|
||||
)}
|
||||
|
@ -20,12 +20,12 @@ describe 'cinder::backend::hpelefthand_iscsi' do
|
||||
shared_examples 'cinder::backend::hpelefthand_iscsi' do
|
||||
context 'hpelefthand_iscsi volume driver' do
|
||||
it {
|
||||
should contain_cinder_config('hpelefthand_iscsi/volume_driver').with_value('cinder.volume.drivers.hpe.hpe_lefthand_iscsi.HPELeftHandISCSIDriver')
|
||||
should contain_cinder_config('hpelefthand_iscsi/backend_availability_zone').with_value('my_zone')
|
||||
should contain_cinder_config('hpelefthand_iscsi/hpelefthand_api_url').with_value('https://10.206.219.18:8081/lhos')
|
||||
should contain_cinder_config('hpelefthand_iscsi/hpelefthand_username').with_value('admin')
|
||||
should contain_cinder_config('hpelefthand_iscsi/hpelefthand_password').with_value('password')
|
||||
should contain_cinder_config('hpelefthand_iscsi/hpelefthand_clustername').with_value('nfvsys_clust_001')
|
||||
is_expected.to contain_cinder_config('hpelefthand_iscsi/volume_driver').with_value('cinder.volume.drivers.hpe.hpe_lefthand_iscsi.HPELeftHandISCSIDriver')
|
||||
is_expected.to contain_cinder_config('hpelefthand_iscsi/backend_availability_zone').with_value('my_zone')
|
||||
is_expected.to contain_cinder_config('hpelefthand_iscsi/hpelefthand_api_url').with_value('https://10.206.219.18:8081/lhos')
|
||||
is_expected.to contain_cinder_config('hpelefthand_iscsi/hpelefthand_username').with_value('admin')
|
||||
is_expected.to contain_cinder_config('hpelefthand_iscsi/hpelefthand_password').with_value('password')
|
||||
is_expected.to contain_cinder_config('hpelefthand_iscsi/hpelefthand_clustername').with_value('nfvsys_clust_001')
|
||||
}
|
||||
end
|
||||
|
||||
@ -34,7 +34,7 @@ describe 'cinder::backend::hpelefthand_iscsi' do
|
||||
params.merge!({:extra_options => {'hpelefthand_iscsi/param1' => {'value' => 'value1'}}})
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('hpelefthand_iscsi/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('hpelefthand_iscsi/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'hpelefthand_iscsi backend with cinder type' do
|
||||
@ -42,7 +42,7 @@ describe 'cinder::backend::hpelefthand_iscsi' do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('hpelefthand_iscsi').with(:ensure => :present, :properties => ['volume_backend_name=hpelefthand_iscsi']) }
|
||||
it { is_expected.to contain_cinder_type('hpelefthand_iscsi').with(:ensure => :present, :properties => ['volume_backend_name=hpelefthand_iscsi']) }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -29,14 +29,14 @@ describe 'cinder::backend::iscsi' do
|
||||
shared_examples 'cinder::backend::iscsi' do
|
||||
context 'with default params' do
|
||||
it {
|
||||
should contain_cinder_config('hippo/volume_backend_name').with_value('hippo')
|
||||
should contain_cinder_config('hippo/backend_availability_zone').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('hippo/volume_driver').with_value('cinder.volume.drivers.lvm.LVMVolumeDriver')
|
||||
should contain_cinder_config('hippo/target_ip_address').with_value('127.0.0.2')
|
||||
should contain_cinder_config('hippo/target_helper').with_value('tgtadm')
|
||||
should contain_cinder_config('hippo/volume_group').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('hippo/volumes_dir').with_value('/var/lib/cinder/volumes')
|
||||
should contain_cinder_config('hippo/target_protocol').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('hippo/volume_backend_name').with_value('hippo')
|
||||
is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('hippo/volume_driver').with_value('cinder.volume.drivers.lvm.LVMVolumeDriver')
|
||||
is_expected.to contain_cinder_config('hippo/target_ip_address').with_value('127.0.0.2')
|
||||
is_expected.to contain_cinder_config('hippo/target_helper').with_value('tgtadm')
|
||||
is_expected.to contain_cinder_config('hippo/volume_group').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('hippo/volumes_dir').with_value('/var/lib/cinder/volumes')
|
||||
is_expected.to contain_cinder_config('hippo/target_protocol').with_value('<SERVICE DEFAULT>')
|
||||
}
|
||||
end
|
||||
|
||||
@ -45,7 +45,7 @@ describe 'cinder::backend::iscsi' do
|
||||
params.merge!(iser_params)
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('hippo/target_protocol').with_value('iser') }
|
||||
it { is_expected.to contain_cinder_config('hippo/target_protocol').with_value('iser') }
|
||||
end
|
||||
|
||||
context 'with non-default volumes_dir' do
|
||||
@ -53,7 +53,7 @@ describe 'cinder::backend::iscsi' do
|
||||
params.merge!(volumes_dir_params)
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('hippo/volumes_dir').with_value('/etc/cinder/volumes') }
|
||||
it { is_expected.to contain_cinder_config('hippo/volumes_dir').with_value('/etc/cinder/volumes') }
|
||||
end
|
||||
|
||||
context 'iscsi backend with cinder type' do
|
||||
@ -61,7 +61,7 @@ describe 'cinder::backend::iscsi' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('hippo').with(
|
||||
it { is_expected.to contain_cinder_type('hippo').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=hippo']
|
||||
)}
|
||||
@ -72,7 +72,7 @@ describe 'cinder::backend::iscsi' do
|
||||
params.merge!( :extra_options => {'hippo/param1' => {'value' => 'value1'}} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('hippo/param1').with(
|
||||
it { is_expected.to contain_cinder_config('hippo/param1').with(
|
||||
:value => 'value1',
|
||||
)}
|
||||
end
|
||||
@ -85,7 +85,7 @@ describe 'cinder::backend::iscsi' do
|
||||
})
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('hippo/target_ip_address').with_value('127.0.0.42') }
|
||||
it { is_expected.to contain_cinder_config('hippo/target_ip_address').with_value('127.0.0.42') }
|
||||
end
|
||||
|
||||
context 'with no target_ip_address or iscsi_ip_address' do
|
||||
@ -93,12 +93,12 @@ describe 'cinder::backend::iscsi' do
|
||||
params.delete(:target_ip_address)
|
||||
end
|
||||
|
||||
it { should raise_error(Puppet::Error, /A target_ip_address or iscsi_ip_address must be specified./) }
|
||||
it { is_expected.to raise_error(Puppet::Error, /A target_ip_address or iscsi_ip_address must be specified./) }
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'cinder::backend::iscsi on RedHat' do
|
||||
it { should contain_file_line('cinder include').with(
|
||||
it { is_expected.to contain_file_line('cinder include').with(
|
||||
:line => 'include /var/lib/cinder/volumes/*',
|
||||
:path => '/etc/tgt/targets.conf'
|
||||
)}
|
||||
|
@ -43,17 +43,17 @@ describe 'cinder::backend::netapp' do
|
||||
default_params.merge(params)
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('netapp/volume_driver').with_value('cinder.volume.drivers.netapp.common.NetAppDriver') }
|
||||
it { is_expected.to contain_cinder_config('netapp/volume_driver').with_value('cinder.volume.drivers.netapp.common.NetAppDriver') }
|
||||
|
||||
it {
|
||||
params_hash.each_pair do |config,value|
|
||||
should contain_cinder_config("netapp/#{config}").with_value( value )
|
||||
is_expected.to contain_cinder_config("netapp/#{config}").with_value( value )
|
||||
end
|
||||
}
|
||||
|
||||
it {
|
||||
should contain_cinder_config('netapp/netapp_password').with_secret( true )
|
||||
should contain_cinder_config('netapp/netapp_sa_password').with_secret( true )
|
||||
is_expected.to contain_cinder_config('netapp/netapp_password').with_secret( true )
|
||||
is_expected.to contain_cinder_config('netapp/netapp_sa_password').with_secret( true )
|
||||
}
|
||||
end
|
||||
|
||||
@ -75,7 +75,7 @@ describe 'cinder::backend::netapp' do
|
||||
params.merge!( :netapp_storage_family => 'eseries' )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('netapp/use_multipath_for_image_xfer').with_value('true') }
|
||||
it { is_expected.to contain_cinder_config('netapp/use_multipath_for_image_xfer').with_value('true') }
|
||||
end
|
||||
|
||||
context 'with nfs_mount_options' do
|
||||
@ -83,7 +83,7 @@ describe 'cinder::backend::netapp' do
|
||||
params.merge!( :nfs_mount_options => 'rw,proto=tcp,sec=sys' )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('netapp/nfs_mount_options').with_value('rw,proto=tcp,sec=sys') }
|
||||
it { is_expected.to contain_cinder_config('netapp/nfs_mount_options').with_value('rw,proto=tcp,sec=sys') }
|
||||
end
|
||||
|
||||
context 'netapp backend with cinder type' do
|
||||
@ -91,7 +91,7 @@ describe 'cinder::backend::netapp' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('netapp').with(
|
||||
it { is_expected.to contain_cinder_type('netapp').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=netapp']
|
||||
)}
|
||||
@ -102,7 +102,7 @@ describe 'cinder::backend::netapp' do
|
||||
params.merge!( :extra_options => {'netapp/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('netapp/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('netapp/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'with NFS shares provided' do
|
||||
@ -111,7 +111,7 @@ describe 'cinder::backend::netapp' do
|
||||
:nfs_shares_config => '/etc/cinder/shares.conf' )
|
||||
end
|
||||
|
||||
it { should contain_file('/etc/cinder/shares.conf').with(
|
||||
it { is_expected.to contain_file('/etc/cinder/shares.conf').with(
|
||||
:content => "10.0.0.1:/test1\n10.0.0.2:/test2",
|
||||
)}
|
||||
end
|
||||
@ -124,7 +124,7 @@ describe 'cinder::backend::netapp' do
|
||||
})
|
||||
end
|
||||
|
||||
it { should raise_error(Puppet::Error) }
|
||||
it { is_expected.to raise_error(Puppet::Error) }
|
||||
end
|
||||
|
||||
context 'with name search pattern' do
|
||||
@ -132,7 +132,7 @@ describe 'cinder::backend::netapp' do
|
||||
params.merge!( :netapp_pool_name_search_pattern => '(something)' )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('netapp/netapp_pool_name_search_pattern').with_value('(something)') }
|
||||
it { is_expected.to contain_cinder_config('netapp/netapp_pool_name_search_pattern').with_value('(something)') }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -31,7 +31,7 @@ describe 'cinder::backend::nexenta_edge' do
|
||||
|
||||
it {
|
||||
params_hash.each_pair do |config, value|
|
||||
should contain_cinder_config("nexenta_edge/#{config}").with_value(value)
|
||||
is_expected.to contain_cinder_config("nexenta_edge/#{config}").with_value(value)
|
||||
end
|
||||
}
|
||||
end
|
||||
@ -41,7 +41,7 @@ describe 'cinder::backend::nexenta_edge' do
|
||||
params.merge!( :extra_options => {'nexenta_edge/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('nexenta_edge/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('nexenta_edge/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'nexenta edge backend with cinder type' do
|
||||
@ -49,7 +49,7 @@ describe 'cinder::backend::nexenta_edge' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('nexenta_edge').with(
|
||||
it { is_expected.to contain_cinder_type('nexenta_edge').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=nexenta_edge']
|
||||
)}
|
||||
|
@ -35,7 +35,7 @@ describe 'cinder::backend::nexenta' do
|
||||
|
||||
it {
|
||||
params_hash.each_pair do |config, value|
|
||||
should contain_cinder_config("nexenta/#{config}").with_value(value)
|
||||
is_expected.to contain_cinder_config("nexenta/#{config}").with_value(value)
|
||||
end
|
||||
}
|
||||
end
|
||||
@ -45,7 +45,7 @@ describe 'cinder::backend::nexenta' do
|
||||
params.merge!( :extra_options => {'nexenta/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('nexenta/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('nexenta/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'nexenta backend with cinder type' do
|
||||
@ -53,7 +53,7 @@ describe 'cinder::backend::nexenta' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('nexenta').with(
|
||||
it { is_expected.to contain_cinder_type('nexenta').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=nexenta']
|
||||
)}
|
||||
|
@ -25,24 +25,24 @@ describe 'cinder::backend::nfs' do
|
||||
shared_examples 'cinder::backend::nfs' do
|
||||
context 'nfs volume driver' do
|
||||
it {
|
||||
should contain_cinder_config('hippo/volume_backend_name').with_value('hippo')
|
||||
should contain_cinder_config('hippo/backend_availability_zone').with_value('my_zone')
|
||||
should contain_cinder_config('hippo/volume_driver').with_value('cinder.volume.drivers.nfs.NfsDriver')
|
||||
should contain_cinder_config('hippo/nfs_shares_config').with_value('/etc/cinder/other_shares.conf')
|
||||
should contain_cinder_config('hippo/nfs_mount_attempts').with_value('4')
|
||||
should contain_cinder_config('hippo/nfs_mount_options').with_value('vers=3')
|
||||
should contain_cinder_config('hippo/nfs_sparsed_volumes').with_value(true)
|
||||
should contain_cinder_config('hippo/nfs_mount_point_base').with_value('/cinder_mount_point')
|
||||
should contain_cinder_config('hippo/nfs_disk_util').with_value('du')
|
||||
should contain_cinder_config('hippo/nfs_used_ratio').with_value('0.7')
|
||||
should contain_cinder_config('hippo/nfs_oversub_ratio').with_value('0.9')
|
||||
should contain_cinder_config('hippo/nas_secure_file_operations').with_value('auto')
|
||||
should contain_cinder_config('hippo/nas_secure_file_permissions').with_value('false')
|
||||
should contain_cinder_config('hippo/nfs_snapshot_support').with_value('true')
|
||||
should contain_cinder_config('hippo/nfs_qcow2_volumes').with_value('true')
|
||||
is_expected.to contain_cinder_config('hippo/volume_backend_name').with_value('hippo')
|
||||
is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('my_zone')
|
||||
is_expected.to contain_cinder_config('hippo/volume_driver').with_value('cinder.volume.drivers.nfs.NfsDriver')
|
||||
is_expected.to contain_cinder_config('hippo/nfs_shares_config').with_value('/etc/cinder/other_shares.conf')
|
||||
is_expected.to contain_cinder_config('hippo/nfs_mount_attempts').with_value('4')
|
||||
is_expected.to contain_cinder_config('hippo/nfs_mount_options').with_value('vers=3')
|
||||
is_expected.to contain_cinder_config('hippo/nfs_sparsed_volumes').with_value(true)
|
||||
is_expected.to contain_cinder_config('hippo/nfs_mount_point_base').with_value('/cinder_mount_point')
|
||||
is_expected.to contain_cinder_config('hippo/nfs_disk_util').with_value('du')
|
||||
is_expected.to contain_cinder_config('hippo/nfs_used_ratio').with_value('0.7')
|
||||
is_expected.to contain_cinder_config('hippo/nfs_oversub_ratio').with_value('0.9')
|
||||
is_expected.to contain_cinder_config('hippo/nas_secure_file_operations').with_value('auto')
|
||||
is_expected.to contain_cinder_config('hippo/nas_secure_file_permissions').with_value('false')
|
||||
is_expected.to contain_cinder_config('hippo/nfs_snapshot_support').with_value('true')
|
||||
is_expected.to contain_cinder_config('hippo/nfs_qcow2_volumes').with_value('true')
|
||||
}
|
||||
|
||||
it { should contain_file('/etc/cinder/other_shares.conf').with(
|
||||
it { is_expected.to contain_file('/etc/cinder/other_shares.conf').with(
|
||||
:content => "10.10.10.10:/shares\n10.10.10.10:/shares2",
|
||||
:require => 'Anchor[cinder::install::end]',
|
||||
:notify => 'Anchor[cinder::service::begin]'
|
||||
@ -54,7 +54,7 @@ describe 'cinder::backend::nfs' do
|
||||
params.merge!( :extra_options => {'hippo/param1' => {'value' => 'value1'}} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('hippo/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('hippo/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'nfs backend with cinder type' do
|
||||
@ -62,7 +62,7 @@ describe 'cinder::backend::nfs' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('hippo').with(
|
||||
it { is_expected.to contain_cinder_type('hippo').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=hippo']
|
||||
)}
|
||||
|
@ -19,24 +19,24 @@ describe 'cinder::backend::nvmeof' do
|
||||
shared_examples 'cinder::backend::nvmeof' do
|
||||
context 'with default params' do
|
||||
it {
|
||||
should contain_cinder_config('nvme-backend/target_ip_address').with_value('127.0.0.2')
|
||||
should contain_cinder_config('nvme-backend/target_port').with_value('4420')
|
||||
should contain_cinder_config('nvme-backend/target_helper').with_value('nvmet')
|
||||
should contain_cinder_config('nvme-backend/target_protocol').with_value('nvmet_rdma')
|
||||
should contain_cinder_config('nvme-backend/nvmet_port_id').with_value('1')
|
||||
should contain_cinder_config('nvme-backend/nvmet_ns_id').with_value('10')
|
||||
should contain_cinder_config('nvme-backend/volume_backend_name').with_value('nvme-backend')
|
||||
should contain_cinder_config('nvme-backend/backend_availability_zone').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('nvme-backend/volume_driver').with_value('cinder.volume.drivers.lvm.LVMVolumeDriver')
|
||||
is_expected.to contain_cinder_config('nvme-backend/target_ip_address').with_value('127.0.0.2')
|
||||
is_expected.to contain_cinder_config('nvme-backend/target_port').with_value('4420')
|
||||
is_expected.to contain_cinder_config('nvme-backend/target_helper').with_value('nvmet')
|
||||
is_expected.to contain_cinder_config('nvme-backend/target_protocol').with_value('nvmet_rdma')
|
||||
is_expected.to contain_cinder_config('nvme-backend/nvmet_port_id').with_value('1')
|
||||
is_expected.to contain_cinder_config('nvme-backend/nvmet_ns_id').with_value('10')
|
||||
is_expected.to contain_cinder_config('nvme-backend/volume_backend_name').with_value('nvme-backend')
|
||||
is_expected.to contain_cinder_config('nvme-backend/backend_availability_zone').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('nvme-backend/volume_driver').with_value('cinder.volume.drivers.lvm.LVMVolumeDriver')
|
||||
}
|
||||
|
||||
it { should contain_package('nvmetcli').with(
|
||||
it { is_expected.to contain_package('nvmetcli').with(
|
||||
:name => 'nvmetcli',
|
||||
:ensure => 'present',
|
||||
:tag => 'cinder-support-package',
|
||||
)}
|
||||
|
||||
it { should contain_package('nvme-cli').with(
|
||||
it { is_expected.to contain_package('nvme-cli').with(
|
||||
:name => 'nvme-cli',
|
||||
:ensure => 'present',
|
||||
:tag => 'cinder-support-package',
|
||||
|
@ -17,11 +17,11 @@ describe 'cinder::backend::pure' do
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureISCSIDriver')
|
||||
should contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
|
||||
should contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
|
||||
should contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')
|
||||
should contain_cinder_config('pure/use_chap_auth').with_value('false')
|
||||
is_expected.to contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureISCSIDriver')
|
||||
is_expected.to contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
|
||||
is_expected.to contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
|
||||
is_expected.to contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')
|
||||
is_expected.to contain_cinder_config('pure/use_chap_auth').with_value('false')
|
||||
}
|
||||
end
|
||||
|
||||
@ -35,12 +35,12 @@ describe 'cinder::backend::pure' do
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureISCSIDriver')
|
||||
should contain_cinder_config('pure/backend_availability_zone').with_value('my_zone')
|
||||
should contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
|
||||
should contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
|
||||
should contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')
|
||||
should contain_cinder_config('pure/use_chap_auth').with_value('true')
|
||||
is_expected.to contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureISCSIDriver')
|
||||
is_expected.to contain_cinder_config('pure/backend_availability_zone').with_value('my_zone')
|
||||
is_expected.to contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
|
||||
is_expected.to contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
|
||||
is_expected.to contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')
|
||||
is_expected.to contain_cinder_config('pure/use_chap_auth').with_value('true')
|
||||
}
|
||||
end
|
||||
|
||||
@ -50,11 +50,11 @@ describe 'cinder::backend::pure' do
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureFCDriver')
|
||||
should contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
|
||||
should contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
|
||||
should contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')
|
||||
should contain_cinder_config('pure/use_chap_auth').with_value('false')
|
||||
is_expected.to contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureFCDriver')
|
||||
is_expected.to contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
|
||||
is_expected.to contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
|
||||
is_expected.to contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')
|
||||
is_expected.to contain_cinder_config('pure/use_chap_auth').with_value('false')
|
||||
}
|
||||
end
|
||||
|
||||
@ -63,7 +63,7 @@ describe 'cinder::backend::pure' do
|
||||
req_params.merge({:extra_options => {'pure_backend/param1' => {'value' => 'value1'}}})
|
||||
end
|
||||
|
||||
it { should contain_cinder__backend__pure('pure').with(
|
||||
it { is_expected.to contain_cinder__backend__pure('pure').with(
|
||||
:extra_options => {'pure_backend/param1' => {'value' => 'value1'}}
|
||||
)}
|
||||
end
|
||||
@ -73,7 +73,7 @@ describe 'cinder::backend::pure' do
|
||||
req_params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('pure').with(
|
||||
it { is_expected.to contain_cinder_type('pure').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=pure']
|
||||
)}
|
||||
|
@ -13,18 +13,18 @@ describe 'cinder::backend::quobyte' do
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('myquobyte/volume_driver').with(
|
||||
it { is_expected.to contain_cinder_config('myquobyte/volume_driver').with(
|
||||
:value => 'cinder.volume.drivers.quobyte.QuobyteDriver'
|
||||
)}
|
||||
|
||||
it { should contain_cinder_config('myquobyte/quobyte_volume_url').with(
|
||||
it { is_expected.to contain_cinder_config('myquobyte/quobyte_volume_url').with(
|
||||
:value => 'quobyte://quobyte.cluster.example.com/volume-name'
|
||||
)}
|
||||
|
||||
it {
|
||||
should contain_cinder_config('myquobyte/quobyte_qcow2_volumes').with_value(false)
|
||||
should contain_cinder_config('myquobyte/quobyte_sparsed_volumes').with_value(true)
|
||||
should contain_cinder_config('myquobyte/backend_availability_zone').with_value('my_zone')
|
||||
is_expected.to contain_cinder_config('myquobyte/quobyte_qcow2_volumes').with_value(false)
|
||||
is_expected.to contain_cinder_config('myquobyte/quobyte_sparsed_volumes').with_value(true)
|
||||
is_expected.to contain_cinder_config('myquobyte/backend_availability_zone').with_value('my_zone')
|
||||
}
|
||||
|
||||
context 'quobyte backend with cinder type' do
|
||||
@ -32,7 +32,7 @@ describe 'cinder::backend::quobyte' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('myquobyte').with(
|
||||
it { is_expected.to contain_cinder_type('myquobyte').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=myquobyte']
|
||||
)}
|
||||
|
@ -24,25 +24,25 @@ describe 'cinder::backend::rbd' do
|
||||
end
|
||||
|
||||
shared_examples 'cinder::backend::rbd' do
|
||||
it { should contain_class('cinder::params') }
|
||||
it { is_expected.to contain_class('cinder::params') }
|
||||
|
||||
context 'rbd backend volume driver' do
|
||||
it {
|
||||
should contain_package('ceph-common').with_ensure('present')
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/volume_backend_name").with_value(req_params[:volume_backend_name])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/volume_driver").with_value('cinder.volume.drivers.rbd.RBDDriver')
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_ceph_conf").with_value(req_params[:rbd_ceph_conf])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_flatten_volume_from_snapshot").with_value(req_params[:rbd_flatten_volume_from_snapshot])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_max_clone_depth").with_value(req_params[:rbd_max_clone_depth])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_pool").with_value(req_params[:rbd_pool])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_user").with_value(req_params[:rbd_user])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_secret_uuid").with_value(req_params[:rbd_secret_uuid])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/backend_host").with_value('rbd:'"#{req_params[:rbd_pool]}")
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connect_timeout").with_value(req_params[:rados_connect_timeout])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_interval").with_value(req_params[:rados_connection_interval])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_retries").with_value(req_params[:rados_connection_retries])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_store_chunk_size").with_value(req_params[:rbd_store_chunk_size])
|
||||
should contain_cinder_config("#{req_params[:volume_backend_name]}/report_discard_supported").with_value(true)
|
||||
is_expected.to contain_package('ceph-common').with_ensure('present')
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/volume_backend_name").with_value(req_params[:volume_backend_name])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/volume_driver").with_value('cinder.volume.drivers.rbd.RBDDriver')
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_ceph_conf").with_value(req_params[:rbd_ceph_conf])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_flatten_volume_from_snapshot").with_value(req_params[:rbd_flatten_volume_from_snapshot])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_max_clone_depth").with_value(req_params[:rbd_max_clone_depth])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_pool").with_value(req_params[:rbd_pool])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_user").with_value(req_params[:rbd_user])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_secret_uuid").with_value(req_params[:rbd_secret_uuid])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/backend_host").with_value('rbd:'"#{req_params[:rbd_pool]}")
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connect_timeout").with_value(req_params[:rados_connect_timeout])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_interval").with_value(req_params[:rados_connection_interval])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_retries").with_value(req_params[:rados_connection_retries])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_store_chunk_size").with_value(req_params[:rbd_store_chunk_size])
|
||||
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/report_discard_supported").with_value(true)
|
||||
}
|
||||
|
||||
context 'with another RBD backend' do
|
||||
@ -54,14 +54,14 @@ describe 'cinder::backend::rbd' do
|
||||
}"
|
||||
end
|
||||
|
||||
it { should contain_cinder_config("#{req_params[:volume_backend_name]}/volume_driver").with_value('cinder.volume.drivers.rbd.RBDDriver') }
|
||||
it { should contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_pool").with_value(req_params[:rbd_pool]) }
|
||||
it { should contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_user").with_value(req_params[:rbd_user]) }
|
||||
it { should contain_cinder_config("ceph2/volume_driver").with_value('cinder.volume.drivers.rbd.RBDDriver') }
|
||||
it { should contain_cinder_config("ceph2/rbd_cluster_name").with_value('ceph2') }
|
||||
it { should contain_cinder_config("ceph2/rbd_pool").with_value('volumes2') }
|
||||
it { should contain_cinder_config("ceph2/rbd_user").with_value('test2') }
|
||||
it { should contain_cinder_config("ceph2/report_discard_supported").with_value(true) }
|
||||
it { is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/volume_driver").with_value('cinder.volume.drivers.rbd.RBDDriver') }
|
||||
it { is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_pool").with_value(req_params[:rbd_pool]) }
|
||||
it { is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_user").with_value(req_params[:rbd_user]) }
|
||||
it { is_expected.to contain_cinder_config("ceph2/volume_driver").with_value('cinder.volume.drivers.rbd.RBDDriver') }
|
||||
it { is_expected.to contain_cinder_config("ceph2/rbd_cluster_name").with_value('ceph2') }
|
||||
it { is_expected.to contain_cinder_config("ceph2/rbd_pool").with_value('volumes2') }
|
||||
it { is_expected.to contain_cinder_config("ceph2/rbd_user").with_value('test2') }
|
||||
it { is_expected.to contain_cinder_config("ceph2/report_discard_supported").with_value(true) }
|
||||
end
|
||||
|
||||
context 'rbd backend with additional configuration' do
|
||||
@ -69,7 +69,7 @@ describe 'cinder::backend::rbd' do
|
||||
params.merge!( :extra_options => {'rbd-ssd/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('rbd-ssd/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('rbd-ssd/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'override backend_host and backend_availability_zone parameters' do
|
||||
@ -80,8 +80,8 @@ describe 'cinder::backend::rbd' do
|
||||
})
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('rbd-ssd/backend_host').with_value('test_host.fqdn.com') }
|
||||
it { should contain_cinder_config('rbd-ssd/backend_availability_zone').with_value('my_zone') }
|
||||
it { is_expected.to contain_cinder_config('rbd-ssd/backend_host').with_value('test_host.fqdn.com') }
|
||||
it { is_expected.to contain_cinder_config('rbd-ssd/backend_availability_zone').with_value('my_zone') }
|
||||
end
|
||||
|
||||
context 'rbd backend with cinder type' do
|
||||
@ -89,7 +89,7 @@ describe 'cinder::backend::rbd' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('rbd-ssd').with(
|
||||
it { is_expected.to contain_cinder_type('rbd-ssd').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=rbd-ssd']
|
||||
)}
|
||||
@ -98,11 +98,11 @@ describe 'cinder::backend::rbd' do
|
||||
end
|
||||
|
||||
shared_examples 'cinder::backend::rbd on Debian' do
|
||||
it { should contain_file('/etc/init/cinder-volume.override').with(
|
||||
it { is_expected.to contain_file('/etc/init/cinder-volume.override').with(
|
||||
:ensure => 'present'
|
||||
)}
|
||||
|
||||
it { should contain_file_line('set initscript env rbd-ssd').with(
|
||||
it { is_expected.to contain_file_line('set initscript env rbd-ssd').with(
|
||||
:line => /env CEPH_ARGS=\"--id test\"/,
|
||||
:path => '/etc/init/cinder-volume.override',
|
||||
:notify => 'Anchor[cinder::service::begin]'
|
||||
@ -110,11 +110,11 @@ describe 'cinder::backend::rbd' do
|
||||
end
|
||||
|
||||
shared_examples 'cinder::backend::rbd on RedHat' do
|
||||
it { should contain_file('/etc/sysconfig/openstack-cinder-volume').with(
|
||||
it { is_expected.to contain_file('/etc/sysconfig/openstack-cinder-volume').with(
|
||||
:ensure => 'present'
|
||||
)}
|
||||
|
||||
it { should contain_file_line('set initscript env rbd-ssd').with(
|
||||
it { is_expected.to contain_file_line('set initscript env rbd-ssd').with(
|
||||
:line => /export CEPH_ARGS=\"--id test\"/,
|
||||
:path => '/etc/sysconfig/openstack-cinder-volume',
|
||||
:notify => 'Anchor[cinder::service::begin]'
|
||||
|
@ -33,7 +33,7 @@ describe 'cinder::backend::san' do
|
||||
|
||||
it {
|
||||
params_hash.each_pair do |config,value|
|
||||
should contain_cinder_config("mysan/#{config}").with_value(value)
|
||||
is_expected.to contain_cinder_config("mysan/#{config}").with_value(value)
|
||||
end
|
||||
}
|
||||
end
|
||||
@ -48,7 +48,7 @@ describe 'cinder::backend::san' do
|
||||
params.merge!( :extra_options => {'mysan/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('mysan/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('mysan/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'san backend with cinder type' do
|
||||
@ -56,7 +56,7 @@ describe 'cinder::backend::san' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('mysan').with(
|
||||
it { is_expected.to contain_cinder_type('mysan').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=mysan']
|
||||
)}
|
||||
|
@ -36,24 +36,24 @@ describe 'cinder::backend::scaleio' do
|
||||
|
||||
shared_examples 'cinder::backend::scaleio' do
|
||||
context 'scaleio volume driver' do
|
||||
it { should contain_cinder_config("#{title}/volume_driver").with(
|
||||
it { is_expected.to contain_cinder_config("#{title}/volume_driver").with(
|
||||
:value => 'cinder.volume.drivers.dell_emc.scaleio.driver.ScaleIODriver'
|
||||
)}
|
||||
|
||||
it {
|
||||
should contain_cinder_config("#{title}/san_login").with_value('admin')
|
||||
should contain_cinder_config("#{title}/san_ip").with_value('scaleio.example.com')
|
||||
should contain_cinder_config("#{title}/san_thin_provision").with_value('false')
|
||||
should contain_cinder_config("#{title}/sio_rest_server_port").with_value('443')
|
||||
is_expected.to contain_cinder_config("#{title}/san_login").with_value('admin')
|
||||
is_expected.to contain_cinder_config("#{title}/san_ip").with_value('scaleio.example.com')
|
||||
is_expected.to contain_cinder_config("#{title}/san_thin_provision").with_value('false')
|
||||
is_expected.to contain_cinder_config("#{title}/sio_rest_server_port").with_value('443')
|
||||
}
|
||||
|
||||
it {
|
||||
params2.each_pair do |config,value|
|
||||
should contain_cinder_config("#{title}/#{config}").with_value(value)
|
||||
is_expected.to contain_cinder_config("#{title}/#{config}").with_value(value)
|
||||
end
|
||||
}
|
||||
|
||||
it { should contain_cinder_config("#{title}/san_password").with_secret(true) }
|
||||
it { is_expected.to contain_cinder_config("#{title}/san_password").with_secret(true) }
|
||||
end
|
||||
|
||||
context 'scaleio backend with additional configuration' do
|
||||
@ -61,7 +61,7 @@ describe 'cinder::backend::scaleio' do
|
||||
params.merge!( :extra_options => {"#{title}/param1" => {'value' => 'value1'}} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config("#{title}/param1").with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config("#{title}/param1").with_value('value1') }
|
||||
end
|
||||
|
||||
context 'scaleio backend with cinder type' do
|
||||
@ -69,7 +69,7 @@ describe 'cinder::backend::scaleio' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type("#{title}").with(
|
||||
it { is_expected.to contain_cinder_type("#{title}").with(
|
||||
:ensure => 'present',
|
||||
:properties => ["volume_backend_name=#{title}"]
|
||||
)}
|
||||
|
@ -35,19 +35,19 @@ describe 'cinder::backend::solidfire' do
|
||||
req_params
|
||||
end
|
||||
|
||||
it { should contain_cinder__backend__solidfire(config_group_name) }
|
||||
it { should contain_cinder_config("#{config_group_name}/volume_driver").with(
|
||||
it { is_expected.to contain_cinder__backend__solidfire(config_group_name) }
|
||||
it { is_expected.to contain_cinder_config("#{config_group_name}/volume_driver").with(
|
||||
:value => 'cinder.volume.drivers.solidfire.SolidFireDriver'
|
||||
)}
|
||||
|
||||
it {
|
||||
params.each_pair do |config,value|
|
||||
should contain_cinder_config(
|
||||
is_expected.to contain_cinder_config(
|
||||
"#{config_group_name}/#{config}").with_value(value)
|
||||
end
|
||||
}
|
||||
|
||||
it { should contain_cinder_config('solidfire/san_password').with_secret(true) }
|
||||
it { is_expected.to contain_cinder_config('solidfire/san_password').with_secret(true) }
|
||||
end
|
||||
|
||||
context 'SolidFire backend driver with all params' do
|
||||
@ -55,19 +55,19 @@ describe 'cinder::backend::solidfire' do
|
||||
req_params.merge(other_params)
|
||||
end
|
||||
|
||||
it { should contain_cinder__backend__solidfire(config_group_name) }
|
||||
it { should contain_cinder_config("#{config_group_name}/volume_driver").with(
|
||||
it { is_expected.to contain_cinder__backend__solidfire(config_group_name) }
|
||||
it { is_expected.to contain_cinder_config("#{config_group_name}/volume_driver").with(
|
||||
:value => 'cinder.volume.drivers.solidfire.SolidFireDriver'
|
||||
)}
|
||||
|
||||
it {
|
||||
params.each_pair do |config,value|
|
||||
should contain_cinder_config(
|
||||
is_expected.to contain_cinder_config(
|
||||
"#{config_group_name}/#{config}").with_value(value)
|
||||
end
|
||||
}
|
||||
|
||||
it { should contain_cinder_config('solidfire/san_password').with_secret(true) }
|
||||
it { is_expected.to contain_cinder_config('solidfire/san_password').with_secret(true) }
|
||||
end
|
||||
|
||||
context 'solidfire backend with additional configuration' do
|
||||
@ -79,7 +79,7 @@ describe 'cinder::backend::solidfire' do
|
||||
params.merge!( :extra_options => {'solidfire/param1' => {'value' => 'value1'}} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('solidfire/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('solidfire/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'solidfire backend with cinder type' do
|
||||
@ -91,7 +91,7 @@ describe 'cinder::backend::solidfire' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('solidfire').with(
|
||||
it { is_expected.to contain_cinder_type('solidfire').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=solidfire']
|
||||
)}
|
||||
|
@ -11,14 +11,14 @@ describe 'cinder::backend::veritas_hyperscale' do
|
||||
end
|
||||
|
||||
shared_examples 'cinder::backend::veritas_hyperscale' do
|
||||
it { should contain_cinder_config("#{title}/volume_driver").with(
|
||||
it { is_expected.to contain_cinder_config("#{title}/volume_driver").with(
|
||||
:value => 'cinder.volume.drivers.veritas.vrtshyperscale.HyperScaleDriver'
|
||||
)}
|
||||
|
||||
it {
|
||||
should contain_cinder_config("#{title}/volume_backend_name").with_value(title)
|
||||
should contain_cinder_config("#{title}/backend_availability_zone").with_value('my_zone')
|
||||
should contain_cinder_config("#{title}/image_volume_cache_enabled").with_value(true)
|
||||
is_expected.to contain_cinder_config("#{title}/volume_backend_name").with_value(title)
|
||||
is_expected.to contain_cinder_config("#{title}/backend_availability_zone").with_value('my_zone')
|
||||
is_expected.to contain_cinder_config("#{title}/image_volume_cache_enabled").with_value(true)
|
||||
}
|
||||
|
||||
context 'veritas_hyperscale backend with additional configuration' do
|
||||
@ -26,7 +26,7 @@ describe 'cinder::backend::veritas_hyperscale' do
|
||||
params.merge!( :extra_options => {"#{title}/param1" => {'value' => 'value1'}} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config("#{title}/param1").with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config("#{title}/param1").with_value('value1') }
|
||||
end
|
||||
|
||||
context 'veritas_hyperScale backend with cinder type' do
|
||||
@ -34,7 +34,7 @@ describe 'cinder::backend::veritas_hyperscale' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type(title).with(
|
||||
it { is_expected.to contain_cinder_type(title).with(
|
||||
:ensure => 'present',
|
||||
:properties => ["volume_backend_name=#{title}"]
|
||||
)}
|
||||
|
@ -28,21 +28,21 @@ describe 'cinder::backend::vmdk' do
|
||||
|
||||
shared_examples 'cinder::backend::vmdk' do
|
||||
it {
|
||||
should contain_cinder_config('hippo/volume_backend_name').with_value('hippo')
|
||||
should contain_cinder_config('hippo/volume_driver').with_value('cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver')
|
||||
should contain_cinder_config('hippo/vmware_host_ip').with_value(params[:host_ip])
|
||||
should contain_cinder_config('hippo/vmware_host_username').with_value(params[:host_username])
|
||||
should contain_cinder_config('hippo/vmware_host_password').with_value(params[:host_password]).with_secret(true)
|
||||
should contain_cinder_config('hippo/vmware_volume_folder').with_value('cinder-volumes')
|
||||
should contain_cinder_config('hippo/vmware_api_retry_count').with_value(params[:api_retry_count])
|
||||
should contain_cinder_config('hippo/vmware_max_object_retrieval').with_value(params[:max_object_retrieval])
|
||||
should contain_cinder_config('hippo/vmware_task_poll_interval').with_value(5)
|
||||
should contain_cinder_config('hippo/vmware_image_transfer_timeout_secs').with_value(params[:image_transfer_timeout_secs])
|
||||
should contain_cinder_config('hippo/vmware_wsdl_location').with_value('<SERVICE DEFAULT>')
|
||||
should contain_cinder_config('hippo/backend_availability_zone').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('hippo/volume_backend_name').with_value('hippo')
|
||||
is_expected.to contain_cinder_config('hippo/volume_driver').with_value('cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver')
|
||||
is_expected.to contain_cinder_config('hippo/vmware_host_ip').with_value(params[:host_ip])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_host_username').with_value(params[:host_username])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_host_password').with_value(params[:host_password]).with_secret(true)
|
||||
is_expected.to contain_cinder_config('hippo/vmware_volume_folder').with_value('cinder-volumes')
|
||||
is_expected.to contain_cinder_config('hippo/vmware_api_retry_count').with_value(params[:api_retry_count])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_max_object_retrieval').with_value(params[:max_object_retrieval])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_task_poll_interval').with_value(5)
|
||||
is_expected.to contain_cinder_config('hippo/vmware_image_transfer_timeout_secs').with_value(params[:image_transfer_timeout_secs])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_wsdl_location').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('<SERVICE DEFAULT>')
|
||||
}
|
||||
|
||||
it { should contain_package('python-suds').with_ensure('present') }
|
||||
it { is_expected.to contain_package('python-suds').with_ensure('present') }
|
||||
|
||||
context 'with optional parameters' do
|
||||
before :each do
|
||||
@ -50,15 +50,15 @@ describe 'cinder::backend::vmdk' do
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_cinder_config('hippo/backend_availability_zone').with_value(params[:backend_availability_zone])
|
||||
should contain_cinder_config('hippo/vmware_volume_folder').with_value(params[:volume_folder])
|
||||
should contain_cinder_config('hippo/vmware_api_retry_count').with_value(params[:api_retry_count])
|
||||
should contain_cinder_config('hippo/vmware_max_object_retrieval').with_value(params[:max_object_retrieval])
|
||||
should contain_cinder_config('hippo/vmware_task_poll_interval').with_value(params[:task_poll_interval])
|
||||
should contain_cinder_config('hippo/vmware_image_transfer_timeout_secs').with_value(params[:image_transfer_timeout_secs])
|
||||
should contain_cinder_config('hippo/vmware_wsdl_location').with_value(params[:wsdl_location])
|
||||
should contain_cinder_config('hippo/backend_availability_zone').with_value(params[:backend_availability_zone])
|
||||
should contain_cinder_config('hippo/host').with_value("vmdk:#{params[:host_ip]}-#{params[:volume_folder]}")
|
||||
is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value(params[:backend_availability_zone])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_volume_folder').with_value(params[:volume_folder])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_api_retry_count').with_value(params[:api_retry_count])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_max_object_retrieval').with_value(params[:max_object_retrieval])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_task_poll_interval').with_value(params[:task_poll_interval])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_image_transfer_timeout_secs').with_value(params[:image_transfer_timeout_secs])
|
||||
is_expected.to contain_cinder_config('hippo/vmware_wsdl_location').with_value(params[:wsdl_location])
|
||||
is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value(params[:backend_availability_zone])
|
||||
is_expected.to contain_cinder_config('hippo/host').with_value("vmdk:#{params[:host_ip]}-#{params[:volume_folder]}")
|
||||
}
|
||||
end
|
||||
|
||||
@ -67,7 +67,7 @@ describe 'cinder::backend::vmdk' do
|
||||
params.merge!( :extra_options => {'hippo/param1' => { 'value' => 'value1' }} )
|
||||
end
|
||||
|
||||
it { should contain_cinder_config('hippo/param1').with_value('value1') }
|
||||
it { is_expected.to contain_cinder_config('hippo/param1').with_value('value1') }
|
||||
end
|
||||
|
||||
context 'vmdk backend with cinder type' do
|
||||
@ -75,7 +75,7 @@ describe 'cinder::backend::vmdk' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('hippo').with(
|
||||
it { is_expected.to contain_cinder_type('hippo').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=hippo']
|
||||
)}
|
||||
|
@ -22,25 +22,25 @@ describe 'cinder::backend::vstorage' do
|
||||
|
||||
shared_examples 'cinder::backend::vstorage' do
|
||||
it {
|
||||
should contain_cinder_config('vstorage/volume_backend_name').with_value('vstorage')
|
||||
should contain_cinder_config('vstorage/backend_availability_zone').with_value('my_zone')
|
||||
should contain_cinder_config('vstorage/vzstorage_sparsed_volumes').with_value(true)
|
||||
should contain_cinder_config('vstorage/vzstorage_used_ratio').with_value('0.9')
|
||||
should contain_cinder_config('vstorage/vzstorage_mount_point_base').with_value('/vstorage')
|
||||
should contain_cinder_config('vstorage/vzstorage_default_volume_format').with_value('ploop')
|
||||
is_expected.to contain_cinder_config('vstorage/volume_backend_name').with_value('vstorage')
|
||||
is_expected.to contain_cinder_config('vstorage/backend_availability_zone').with_value('my_zone')
|
||||
is_expected.to contain_cinder_config('vstorage/vzstorage_sparsed_volumes').with_value(true)
|
||||
is_expected.to contain_cinder_config('vstorage/vzstorage_used_ratio').with_value('0.9')
|
||||
is_expected.to contain_cinder_config('vstorage/vzstorage_mount_point_base').with_value('/vstorage')
|
||||
is_expected.to contain_cinder_config('vstorage/vzstorage_default_volume_format').with_value('ploop')
|
||||
}
|
||||
|
||||
it { should contain_cinder_config('vstorage/vzstorage_shares_config').with(
|
||||
it { is_expected.to contain_cinder_config('vstorage/vzstorage_shares_config').with(
|
||||
:value => '/etc/cinder/vstorage_shares.conf'
|
||||
)}
|
||||
|
||||
it { should contain_cinder_config('vstorage/volume_driver').with(
|
||||
it { is_expected.to contain_cinder_config('vstorage/volume_driver').with(
|
||||
:value => 'cinder.volume.drivers.vzstorage.VZStorageDriver'
|
||||
)}
|
||||
|
||||
it { should contain_package('vstorage-client').with_ensure('present') }
|
||||
it { is_expected.to contain_package('vstorage-client').with_ensure('present') }
|
||||
|
||||
it { should contain_file('/etc/cinder/vstorage_shares.conf').with(
|
||||
it { is_expected.to contain_file('/etc/cinder/vstorage_shares.conf').with(
|
||||
:content => "stor1:passw0rd [\"-u\", \"cinder\", \"-g\", \"root\", \"-m\", \"0770\"]"
|
||||
)}
|
||||
|
||||
@ -49,12 +49,12 @@ describe 'cinder::backend::vstorage' do
|
||||
params.merge!( :manage_volume_type => true )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('vstorage').with(
|
||||
it { is_expected.to contain_cinder_type('vstorage').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['vz:volume_format=qcow2']
|
||||
)}
|
||||
|
||||
it { should contain_cinder_type('vstorage-ploop').with(
|
||||
it { is_expected.to contain_cinder_type('vstorage-ploop').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['vz:volume_format=ploop']
|
||||
)}
|
||||
|
@ -6,7 +6,7 @@ describe 'cinder::qos' do
|
||||
|
||||
shared_examples 'cinder::qos' do
|
||||
context 'with default parameters' do
|
||||
it { should contain_cinder_qos('tomato').with_ensure('present') }
|
||||
it { is_expected.to contain_cinder_qos('tomato').with_ensure('present') }
|
||||
end
|
||||
|
||||
context 'with specified parameters' do
|
||||
@ -18,7 +18,7 @@ describe 'cinder::qos' do
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_cinder_qos('tomato').with(
|
||||
it { is_expected.to contain_cinder_qos('tomato').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['var1=value1', 'var2=value2'],
|
||||
:associations => ['vol_type1', 'vol_type2'],
|
||||
|
@ -20,7 +20,7 @@ describe 'cinder::quota_set' do
|
||||
|
||||
shared_examples 'cinder::quota_set' do
|
||||
context 'with specified parameters' do
|
||||
it { should contain_exec('openstack quota set --class default').with(
|
||||
it { is_expected.to contain_exec('openstack quota set --class default').with(
|
||||
:command => "openstack quota set --class default --volumes 10 --snapshots 10 --gigabytes 1000 --volume-type 'hippo'",
|
||||
:environment => [
|
||||
'OS_TENANT_NAME=admin',
|
||||
@ -38,7 +38,7 @@ describe 'cinder::quota_set' do
|
||||
params.merge!( :os_region_name => 'test' )
|
||||
end
|
||||
|
||||
it { should contain_exec('openstack quota set --class default').with(
|
||||
it { is_expected.to contain_exec('openstack quota set --class default').with(
|
||||
:command => "openstack quota set --class default --volumes 10 --snapshots 10 --gigabytes 1000 --volume-type 'hippo'",
|
||||
:environment => [
|
||||
'OS_TENANT_NAME=admin',
|
||||
|
@ -18,7 +18,7 @@ describe 'cinder::type_set' do
|
||||
|
||||
shared_examples 'cinder::type_set' do
|
||||
context 'by default' do
|
||||
it { should contain_cinder_type('sith').with(
|
||||
it { is_expected.to contain_cinder_type('sith').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['monchichi=hippo']
|
||||
)}
|
||||
@ -29,7 +29,7 @@ describe 'cinder::type_set' do
|
||||
params.merge!( :value => 'hippi' )
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('sith').with(
|
||||
it { is_expected.to contain_cinder_type('sith').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['monchichi=hippi']
|
||||
)}
|
||||
|
@ -7,7 +7,7 @@ describe 'cinder::type' do
|
||||
|
||||
shared_examples 'cinder::type' do
|
||||
context 'default creation' do
|
||||
it { should contain_cinder_type('hippo').with_ensure('present') }
|
||||
it { is_expected.to contain_cinder_type('hippo').with_ensure('present') }
|
||||
end
|
||||
|
||||
context 'creation with properties' do
|
||||
@ -18,7 +18,7 @@ describe 'cinder::type' do
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_cinder_type('hippo').with(
|
||||
it { is_expected.to contain_cinder_type('hippo').with(
|
||||
:ensure => 'present',
|
||||
:properties => ['volume_backend_name=name1,name2']
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user