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>
This commit is contained in:
Gael Chamoulaud 2015-03-10 12:29:50 +01:00 committed by Sebastien Badia
parent 0d8dc6f095
commit d60db0c73e
23 changed files with 180 additions and 210 deletions

View File

@ -2,8 +2,7 @@ source 'https://rubygems.org'
group :development, :test do group :development, :test do
gem 'puppetlabs_spec_helper', :require => false gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet', '~> 1.0.1' gem 'rspec-puppet', '~> 2.0.0', :require => false
gem 'rake', '10.1.1'
gem 'puppet-lint', '~> 1.1' gem 'puppet-lint', '~> 1.1'
gem 'metadata-json-lint' gem 'metadata-json-lint'

View File

@ -14,55 +14,30 @@ describe 'manila::api' do
req_params req_params
end end
it { should contain_service('manila-api').with( it { is_expected.to contain_service('manila-api').with(
'hasstatus' => true, 'hasstatus' => true,
'ensure' => 'running' 'ensure' => 'running'
)} )}
it 'should configure manila api correctly' do it 'should configure manila api correctly' do
should contain_manila_config('DEFAULT/auth_strategy').with( is_expected.to contain_manila_config('DEFAULT/auth_strategy').with(:value => 'keystone')
:value => 'keystone' is_expected.to contain_manila_config('DEFAULT/osapi_share_listen').with(:value => '0.0.0.0')
) is_expected.to contain_manila_api_paste_ini('filter:authtoken/service_protocol').with(:value => 'http')
should contain_manila_config('DEFAULT/osapi_share_listen').with( is_expected.to contain_manila_api_paste_ini('filter:authtoken/service_host').with(:value => 'localhost')
:value => '0.0.0.0' is_expected.to contain_manila_api_paste_ini('filter:authtoken/service_port').with(:value => '5000')
) is_expected.to contain_manila_api_paste_ini('filter:authtoken/auth_protocol').with(:value => 'http')
should contain_manila_api_paste_ini('filter:authtoken/service_protocol').with( is_expected.to contain_manila_api_paste_ini('filter:authtoken/auth_host').with(:value => 'localhost')
:value => 'http' is_expected.to contain_manila_api_paste_ini('filter:authtoken/auth_port').with(:value => '35357')
) is_expected.to contain_manila_api_paste_ini('filter:authtoken/auth_admin_prefix').with(:ensure => 'absent')
should contain_manila_api_paste_ini('filter:authtoken/service_host').with( is_expected.to contain_manila_api_paste_ini('filter:authtoken/admin_tenant_name').with(:value => 'services')
:value => 'localhost' is_expected.to contain_manila_api_paste_ini('filter:authtoken/admin_user').with(:value => 'manila')
) is_expected.to contain_manila_api_paste_ini('filter:authtoken/admin_password').with(
should contain_manila_api_paste_ini('filter:authtoken/service_port').with(
:value => '5000'
)
should contain_manila_api_paste_ini('filter:authtoken/auth_protocol').with(
:value => 'http'
)
should contain_manila_api_paste_ini('filter:authtoken/auth_host').with(
:value => 'localhost'
)
should contain_manila_api_paste_ini('filter:authtoken/auth_port').with(
:value => '35357'
)
should contain_manila_api_paste_ini('filter:authtoken/auth_admin_prefix').with(
:ensure => 'absent'
)
should contain_manila_api_paste_ini('filter:authtoken/admin_tenant_name').with(
:value => 'services'
)
should contain_manila_api_paste_ini('filter:authtoken/admin_user').with(
:value => 'manila'
)
should contain_manila_api_paste_ini('filter:authtoken/admin_password').with(
:value => 'foo', :value => 'foo',
:secret => true :secret => true
) )
is_expected.to contain_manila_api_paste_ini('filter:authtoken/auth_uri').with(:value => 'http://localhost:5000/')
should contain_manila_api_paste_ini('filter:authtoken/auth_uri').with( is_expected.to_not contain_manila_config('DEFAULT/os_region_name')
:value => 'http://localhost:5000/'
)
should_not contain_manila_config('DEFAULT/os_region_name')
end end
end end
@ -71,7 +46,7 @@ describe 'manila::api' do
req_params.merge({'os_region_name' => 'MyRegion'}) req_params.merge({'os_region_name' => 'MyRegion'})
end end
it 'should configure the region for nova' do it 'should configure the region for nova' do
should contain_manila_config('DEFAULT/os_region_name').with( is_expected.to contain_manila_config('DEFAULT/os_region_name').with(
:value => 'MyRegion' :value => 'MyRegion'
) )
end end
@ -82,7 +57,7 @@ describe 'manila::api' do
req_params.merge({'keystone_auth_uri' => 'http://foo.bar:8080/v2.0/'}) req_params.merge({'keystone_auth_uri' => 'http://foo.bar:8080/v2.0/'})
end end
it 'should configure manila auth_uri correctly' do it 'should configure manila auth_uri correctly' do
should contain_manila_api_paste_ini('filter:authtoken/auth_uri').with( is_expected.to contain_manila_api_paste_ini('filter:authtoken/auth_uri').with(
:value => 'http://foo.bar:8080/v2.0/' :value => 'http://foo.bar:8080/v2.0/'
) )
end end
@ -93,14 +68,14 @@ describe 'manila::api' do
req_params.merge({'bind_host' => '192.168.1.3'}) req_params.merge({'bind_host' => '192.168.1.3'})
end end
it 'should configure manila api correctly' do it 'should configure manila api correctly' do
should contain_manila_config('DEFAULT/osapi_share_listen').with( is_expected.to contain_manila_config('DEFAULT/osapi_share_listen').with(
:value => '192.168.1.3' :value => '192.168.1.3'
) )
end end
end end
[ '/keystone', '/keystone/admin', '' ].each do |keystone_auth_admin_prefix| [ '/keystone', '/keystone/admin' ].each do |keystone_auth_admin_prefix|
describe "with keystone_auth_admin_prefix containing incorrect value #{keystone_auth_admin_prefix}" do describe "with keystone_auth_admin_prefix containing correct value #{keystone_auth_admin_prefix}" do
let :params do let :params do
{ {
:keystone_auth_admin_prefix => keystone_auth_admin_prefix, :keystone_auth_admin_prefix => keystone_auth_admin_prefix,
@ -108,7 +83,7 @@ describe 'manila::api' do
} }
end end
it { should contain_manila_api_paste_ini('filter:authtoken/auth_admin_prefix').with( it { is_expected.to contain_manila_api_paste_ini('filter:authtoken/auth_admin_prefix').with(
:value => keystone_auth_admin_prefix :value => keystone_auth_admin_prefix
)} )}
end end
@ -130,7 +105,7 @@ describe 'manila::api' do
} }
end end
it { expect { should contain_manila_api_paste_ini('filter:authtoken/auth_admin_prefix') }.to \ it { expect { is_expected.to contain_manila_api_paste_ini('filter:authtoken/auth_admin_prefix') }.to \
raise_error(Puppet::Error, /validate_re\(\): "#{keystone_auth_admin_prefix}" does not match/) } raise_error(Puppet::Error, /validate_re\(\): "#{keystone_auth_admin_prefix}" does not match/) }
end end
end end
@ -140,10 +115,10 @@ describe 'manila::api' do
req_params.merge({'enabled' => false}) req_params.merge({'enabled' => false})
end end
it 'should stop the service' do it 'should stop the service' do
should contain_service('manila-api').with_ensure('stopped') is_expected.to contain_service('manila-api').with_ensure('stopped')
end end
it 'should contain db_sync exec' do it 'should contain db_sync exec' do
should_not contain_exec('manila-manage db_sync') is_expected.to_not contain_exec('manila-manage db_sync')
end end
end end
@ -152,7 +127,7 @@ describe 'manila::api' do
req_params.merge({'manage_service' => false}) req_params.merge({'manage_service' => false})
end end
it 'should not change the state of the service' do it 'should not change the state of the service' do
should contain_service('manila-api').without_ensure is_expected.to contain_service('manila-api').without_ensure
end end
end end
@ -161,7 +136,7 @@ describe 'manila::api' do
req_params.merge({ :ratelimits => '(GET, "*", .*, 100, MINUTE);(POST, "*", .*, 200, MINUTE)' }) req_params.merge({ :ratelimits => '(GET, "*", .*, 100, MINUTE);(POST, "*", .*, 200, MINUTE)' })
end end
it { should contain_manila_api_paste_ini('filter:ratelimit/limits').with( it { is_expected.to contain_manila_api_paste_ini('filter:ratelimit/limits').with(
:value => '(GET, "*", .*, 100, MINUTE);(POST, "*", .*, 200, MINUTE)' :value => '(GET, "*", .*, 100, MINUTE);(POST, "*", .*, 200, MINUTE)'
)} )}
end end

View File

@ -44,7 +44,7 @@ describe 'manila::backends' do
end end
it 'configures manila.conf with default params' do it 'configures manila.conf with default params' do
should contain_manila_config('DEFAULT/enabled_share_backends').with_value(p[:enabled_share_backends].join(',')) is_expected.to contain_manila_config('DEFAULT/enabled_share_backends').with_value(p[:enabled_share_backends].join(','))
end end
end end

View File

@ -1,7 +1,7 @@
require 'spec_helper' require 'spec_helper'
describe 'manila::client' do describe 'manila::client' do
it { should contain_package('python-manilaclient').with_ensure('present') } it { is_expected.to contain_package('python-manilaclient').with_ensure('present') }
let :facts do let :facts do
{:osfamily => 'Debian'} {:osfamily => 'Debian'}
end end
@ -9,6 +9,6 @@ describe 'manila::client' do
let :params do let :params do
{:package_ensure => 'latest'} {:package_ensure => 'latest'}
end end
it { should contain_package('python-manilaclient').with_ensure('latest') } it { is_expected.to contain_package('python-manilaclient').with_ensure('latest') }
end end
end end

View File

@ -19,7 +19,7 @@ describe 'manila::db::mysql' do
let :params do let :params do
req_params req_params
end end
it { should contain_openstacklib__db__mysql('manila').with( it { is_expected.to contain_openstacklib__db__mysql('manila').with(
:user => 'manila', :user => 'manila',
:password_hash => '*D821809F681A40A6E379B50D0463EFAE20BDD122', :password_hash => '*D821809F681A40A6E379B50D0463EFAE20BDD122',
:host => '127.0.0.1', :host => '127.0.0.1',

View File

@ -24,7 +24,7 @@ describe 'manila::db::postgresql' do
req_params req_params
end end
it { should contain_postgresql__server__db('manila').with( it { is_expected.to contain_postgresql__server__db('manila').with(
:user => 'manila', :user => 'manila',
:password => 'md5b15a47e3dd847f86827b328466426faf' :password => 'md5b15a47e3dd847f86827b328466426faf'
)} )}
@ -47,7 +47,7 @@ describe 'manila::db::postgresql' do
req_params req_params
end end
it { should contain_postgresql__server__db('manila').with( it { is_expected.to contain_postgresql__server__db('manila').with(
:user => 'manila', :user => 'manila',
:password => 'md5b15a47e3dd847f86827b328466426faf' :password => 'md5b15a47e3dd847f86827b328466426faf'
)} )}

View File

@ -5,7 +5,7 @@ describe 'manila::db::sync' do
let :facts do let :facts do
{:osfamily => 'Debian'} {:osfamily => 'Debian'}
end end
it { should contain_exec('manila-manage db_sync').with( it { is_expected.to contain_exec('manila-manage db_sync').with(
:command => 'manila-manage db sync', :command => 'manila-manage db sync',
:path => '/usr/bin', :path => '/usr/bin',
:user => 'manila', :user => 'manila',

View File

@ -14,24 +14,24 @@ describe 'manila::keystone::auth' do
it 'should contain auth info' do it 'should contain auth info' do
should 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',
:tenant => 'services' :tenant => 'services'
) )
should 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'
) )
should contain_keystone_service('manila').with( is_expected.to contain_keystone_service('manila').with(
:ensure => 'present', :ensure => 'present',
:type => 'share', :type => 'share',
:description => 'Manila Service' :description => 'Manila Service'
) )
end end
it { should contain_keystone_endpoint('RegionOne/manila').with( it { is_expected.to contain_keystone_endpoint('RegionOne/manila').with(
:ensure => 'present', :ensure => 'present',
:public_url => 'http://127.0.0.1:8786/v1/%(tenant_id)s', :public_url => 'http://127.0.0.1:8786/v1/%(tenant_id)s',
:admin_url => 'http://127.0.0.1:8786/v1/%(tenant_id)s', :admin_url => 'http://127.0.0.1:8786/v1/%(tenant_id)s',
@ -55,7 +55,7 @@ describe 'manila::keystone::auth' do
) )
end end
it { should contain_keystone_endpoint('RegionThree/manila').with( it { is_expected.to contain_keystone_endpoint('RegionThree/manila').with(
:ensure => 'present', :ensure => 'present',
:public_url => 'https://10.0.42.1:4242/v42/%(tenant_id)s', :public_url => 'https://10.0.42.1:4242/v42/%(tenant_id)s',
:admin_url => 'https://10.0.42.2:4242/v42/%(tenant_id)s', :admin_url => 'https://10.0.42.2:4242/v42/%(tenant_id)s',
@ -71,7 +71,7 @@ describe 'manila::keystone::auth' do
:configure_endpoint => false :configure_endpoint => false
) )
end end
it { should_not contain_keystone_endpoint('RegionOne/manila') } it { is_expected.to_not contain_keystone_endpoint('RegionOne/manila') }
end end
end end

View File

@ -11,7 +11,7 @@ describe 'manila::qpid' do
it 'should contain all of the default resources' do it 'should contain all of the default resources' do
should contain_class('qpid::server').with( is_expected.to contain_class('qpid::server').with(
:service_ensure => 'running', :service_ensure => 'running',
:port => '5672' :port => '5672'
) )
@ -20,7 +20,7 @@ describe 'manila::qpid' do
it 'should contain user' do it 'should contain user' do
should contain_qpid_user('guest').with( is_expected.to contain_qpid_user('guest').with(
:password => 'guest', :password => 'guest',
:file => '/var/lib/qpidd/qpidd.sasldb', :file => '/var/lib/qpidd/qpidd.sasldb',
:realm => 'OPENSTACK', :realm => 'OPENSTACK',
@ -40,8 +40,8 @@ describe 'manila::qpid' do
it 'should be disabled' do it 'should be disabled' do
should_not contain_qpid_user('guest') is_expected.to_not contain_qpid_user('guest')
should contain_class('qpid::server').with( is_expected.to contain_class('qpid::server').with(
:service_ensure => 'stopped' :service_ensure => 'stopped'
) )

View File

@ -4,13 +4,13 @@ describe 'manila::quota' do
describe 'with default parameters' do describe 'with default parameters' do
it 'contains default values' do it 'contains default values' do
should contain_manila_config('DEFAULT/quota_shares').with( is_expected.to contain_manila_config('DEFAULT/quota_shares').with(
:value => 10) :value => 10)
should contain_manila_config('DEFAULT/quota_snapshots').with( is_expected.to contain_manila_config('DEFAULT/quota_snapshots').with(
:value => 10) :value => 10)
should contain_manila_config('DEFAULT/quota_gigabytes').with( is_expected.to contain_manila_config('DEFAULT/quota_gigabytes').with(
:value => 1000) :value => 1000)
should contain_manila_config('DEFAULT/quota_driver').with( is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
:value => 'manila.quota.DbQuotaDriver') :value => 'manila.quota.DbQuotaDriver')
end end
end end
@ -22,13 +22,13 @@ describe 'manila::quota' do
:quota_gigabytes => 100000 } :quota_gigabytes => 100000 }
end end
it 'contains overrided values' do it 'contains overrided values' do
should contain_manila_config('DEFAULT/quota_shares').with( is_expected.to contain_manila_config('DEFAULT/quota_shares').with(
:value => 1000) :value => 1000)
should contain_manila_config('DEFAULT/quota_snapshots').with( is_expected.to contain_manila_config('DEFAULT/quota_snapshots').with(
:value => 1000) :value => 1000)
should contain_manila_config('DEFAULT/quota_gigabytes').with( is_expected.to contain_manila_config('DEFAULT/quota_gigabytes').with(
:value => 100000) :value => 100000)
should contain_manila_config('DEFAULT/quota_driver').with( is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
:value => 'manila.quota.DbQuotaDriver') :value => 'manila.quota.DbQuotaDriver')
end end
end end

View File

@ -12,13 +12,13 @@ describe 'manila::rabbitmq' do
it 'should contain all of the default resources' do it 'should contain all of the default resources' do
should contain_class('rabbitmq::server').with( is_expected.to contain_class('rabbitmq::server').with(
:service_ensure => 'running', :service_ensure => 'running',
:port => '5672', :port => '5672',
:delete_guest_user => false :delete_guest_user => false
) )
should contain_rabbitmq_vhost('/').with( is_expected.to contain_rabbitmq_vhost('/').with(
:provider => 'rabbitmqctl' :provider => 'rabbitmqctl'
) )
end end
@ -36,13 +36,13 @@ describe 'manila::rabbitmq' do
it 'should contain user and permissions' do it 'should contain user and permissions' do
should contain_rabbitmq_user('dan').with( is_expected.to contain_rabbitmq_user('dan').with(
:admin => true, :admin => true,
:password => 'pass', :password => 'pass',
:provider => 'rabbitmqctl' :provider => 'rabbitmqctl'
) )
should contain_rabbitmq_user_permissions('dan@/').with( is_expected.to contain_rabbitmq_user_permissions('dan@/').with(
:configure_permission => '.*', :configure_permission => '.*',
:write_permission => '.*', :write_permission => '.*',
:read_permission => '.*', :read_permission => '.*',
@ -64,15 +64,15 @@ describe 'manila::rabbitmq' do
it 'should be disabled' do it 'should be disabled' do
should_not contain_rabbitmq_user('dan') is_expected.to_not contain_rabbitmq_user('dan')
should_not contain_rabbitmq_user_permissions('dan@/') is_expected.to_not contain_rabbitmq_user_permissions('dan@/')
should contain_class('rabbitmq::server').with( is_expected.to contain_class('rabbitmq::server').with(
:service_ensure => 'stopped', :service_ensure => 'stopped',
:port => '5672', :port => '5672',
:delete_guest_user => false :delete_guest_user => false
) )
should_not contain_rabbitmq_vhost('/') is_expected.to_not contain_rabbitmq_vhost('/')
end end
end end

View File

@ -10,15 +10,15 @@ describe 'manila::scheduler' do
describe 'with default parameters' do describe 'with default parameters' do
it { should contain_class('manila::params') } it { is_expected.to contain_class('manila::params') }
it { should contain_package('manila-scheduler').with( it { is_expected.to contain_package('manila-scheduler').with(
:name => 'manila-scheduler', :name => 'manila-scheduler',
:ensure => 'present', :ensure => 'present',
:before => 'Service[manila-scheduler]' :before => 'Service[manila-scheduler]'
) } ) }
it { should contain_service('manila-scheduler').with( it { is_expected.to contain_service('manila-scheduler').with(
:name => 'manila-scheduler', :name => 'manila-scheduler',
:enable => true, :enable => true,
:ensure => 'running', :ensure => 'running',
@ -35,8 +35,8 @@ describe 'manila::scheduler' do
} }
end end
it { should 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') }
it { should 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 describe 'with manage_service false' do
@ -45,7 +45,7 @@ describe 'manila::scheduler' do
} }
end end
it 'should not change the state of the service' do it 'should not change the state of the service' do
should contain_service('manila-scheduler').without_ensure is_expected.to contain_service('manila-scheduler').without_ensure
end end
end end
end end
@ -59,9 +59,9 @@ describe 'manila::scheduler' do
describe 'with default parameters' do describe 'with default parameters' do
it { should contain_class('manila::params') } it { is_expected.to contain_class('manila::params') }
it { should contain_service('manila-scheduler').with( it { is_expected.to contain_service('manila-scheduler').with(
:name => 'openstack-manila-scheduler', :name => 'openstack-manila-scheduler',
:enable => true, :enable => true,
:ensure => 'running', :ensure => 'running',
@ -75,7 +75,7 @@ describe 'manila::scheduler' do
{ :scheduler_driver => 'manila.scheduler.filter_scheduler.FilterScheduler' } { :scheduler_driver => 'manila.scheduler.filter_scheduler.FilterScheduler' }
end end
it { should 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
end end

View File

@ -17,13 +17,13 @@ describe 'manila::share::generic' do
describe 'generic share driver' do describe 'generic share driver' do
it 'configures generic share driver' do it 'configures generic share driver' do
should contain_manila_config('DEFAULT/share_driver').with_value( is_expected.to contain_manila_config('DEFAULT/share_driver').with_value(
'manila.share.drivers.generic.GenericShareDriver') 'manila.share.drivers.generic.GenericShareDriver')
should contain_manila_config('DEFAULT/share_helpers').with_value( is_expected.to contain_manila_config('DEFAULT/share_helpers').with_value(
'CIFS=manila.share.drivers.generic.CIFSHelper,'\ 'CIFS=manila.share.drivers.generic.CIFSHelper,'\
'NFS=manila.share.drivers.generic.NFSHelper') 'NFS=manila.share.drivers.generic.NFSHelper')
params.each_pair do |config,value| params.each_pair do |config,value|
should contain_manila_config("DEFAULT/#{config}").with_value( value ) is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value )
end end
end end
end end

View File

@ -11,11 +11,11 @@ describe 'manila::share::glusterfs' do
end end
it 'configures glusterfs share driver' do it 'configures glusterfs share driver' do
should contain_manila_config('DEFAULT/share_driver').with_value( is_expected.to contain_manila_config('DEFAULT/share_driver').with_value(
'manila.share.drivers.glusterfs.GlusterfsShareDriver') 'manila.share.drivers.glusterfs.GlusterfsShareDriver')
should contain_manila_config('DEFAULT/glusterfs_volumes_config').with_value( is_expected.to contain_manila_config('DEFAULT/glusterfs_volumes_config').with_value(
'/etc/manila/glusterfs_volumes') '/etc/manila/glusterfs_volumes')
should contain_manila_config('DEFAULT/glusterfs_mount_point_base').with_value( is_expected.to contain_manila_config('DEFAULT/glusterfs_mount_point_base').with_value(
'$state_path/mnt') '$state_path/mnt')
end end

View File

@ -29,15 +29,15 @@ describe 'manila::share::netapp' do
end end
it 'configures netapp share driver' do it 'configures netapp share driver' do
should contain_manila_config('DEFAULT/share_driver').with_value( is_expected.to contain_manila_config('DEFAULT/share_driver').with_value(
'manila.share.drivers.netapp.cluster_mode.NetAppClusteredShareDriver') 'manila.share.drivers.netapp.cluster_mode.NetAppClusteredShareDriver')
params_hash.each_pair do |config,value| params_hash.each_pair do |config,value|
should contain_manila_config("DEFAULT/#{config}").with_value( value ) is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value )
end end
end end
it 'marks netapp_password as secret' do it 'marks netapp_password as secret' do
should contain_manila_config('DEFAULT/netapp_nas_password').with_secret( true ) is_expected.to contain_manila_config('DEFAULT/netapp_nas_password').with_secret( true )
end end
end end

View File

@ -7,11 +7,11 @@ describe 'manila::share' do
'class { "manila": rabbit_password => "fpp", sql_connection => "mysql://a:b@c/d" }' 'class { "manila": rabbit_password => "fpp", sql_connection => "mysql://a:b@c/d" }'
end end
it { should contain_package('manila-share').with( it { is_expected.to contain_package('manila-share').with(
:name => platform_params[:package_name], :name => platform_params[:package_name],
:ensure => 'present' :ensure => 'present'
) } ) }
it { should contain_service('manila-share').with( it { is_expected.to contain_service('manila-share').with(
'hasstatus' => true 'hasstatus' => true
)} )}
@ -20,7 +20,7 @@ describe 'manila::share' do
{ 'manage_service' => false } { 'manage_service' => false }
end end
it 'should not change the state of the service' do it 'should not change the state of the service' do
should contain_service('manila-share').without_ensure is_expected.to contain_service('manila-share').without_ensure
end end
end end
end end

View File

@ -13,71 +13,71 @@ describe 'manila' do
req_params req_params
end end
it { should contain_class('manila::params') } it { is_expected.to contain_class('manila::params') }
it { should contain_class('mysql::bindings::python') } it { is_expected.to contain_class('mysql::bindings::python') }
it 'should contain default config' do it 'should contain default config' do
should contain_manila_config('DEFAULT/sql_idle_timeout').with( is_expected.to contain_manila_config('DEFAULT/sql_idle_timeout').with(
:value => '3600' :value => '3600'
) )
should contain_manila_config('DEFAULT/rpc_backend').with( is_expected.to contain_manila_config('DEFAULT/rpc_backend').with(
:value => 'manila.openstack.common.rpc.impl_kombu' :value => 'manila.openstack.common.rpc.impl_kombu'
) )
should contain_manila_config('DEFAULT/control_exchange').with( is_expected.to contain_manila_config('DEFAULT/control_exchange').with(
:value => 'openstack' :value => 'openstack'
) )
should contain_manila_config('DEFAULT/rabbit_password').with( is_expected.to contain_manila_config('DEFAULT/rabbit_password').with(
:value => 'guest', :value => 'guest',
:secret => true :secret => true
) )
should contain_manila_config('DEFAULT/rabbit_host').with( is_expected.to contain_manila_config('DEFAULT/rabbit_host').with(
:value => '127.0.0.1' :value => '127.0.0.1'
) )
should contain_manila_config('DEFAULT/rabbit_port').with( is_expected.to contain_manila_config('DEFAULT/rabbit_port').with(
:value => '5672' :value => '5672'
) )
should contain_manila_config('DEFAULT/rabbit_hosts').with( is_expected.to contain_manila_config('DEFAULT/rabbit_hosts').with(
:value => '127.0.0.1:5672' :value => '127.0.0.1:5672'
) )
should contain_manila_config('DEFAULT/rabbit_ha_queues').with( is_expected.to contain_manila_config('DEFAULT/rabbit_ha_queues').with(
:value => false :value => false
) )
should contain_manila_config('DEFAULT/rabbit_virtual_host').with( is_expected.to contain_manila_config('DEFAULT/rabbit_virtual_host').with(
:value => '/' :value => '/'
) )
should contain_manila_config('DEFAULT/rabbit_userid').with( is_expected.to contain_manila_config('DEFAULT/rabbit_userid').with(
:value => 'guest' :value => 'guest'
) )
should contain_manila_config('DEFAULT/sql_connection').with( is_expected.to contain_manila_config('DEFAULT/sql_connection').with(
:value => 'mysql://user:password@host/database', :value => 'mysql://user:password@host/database',
:secret => true :secret => true
) )
should contain_manila_config('DEFAULT/verbose').with( is_expected.to contain_manila_config('DEFAULT/verbose').with(
:value => false :value => false
) )
should contain_manila_config('DEFAULT/debug').with( is_expected.to contain_manila_config('DEFAULT/debug').with(
:value => false :value => false
) )
should contain_manila_config('DEFAULT/storage_availability_zone').with( is_expected.to contain_manila_config('DEFAULT/storage_availability_zone').with(
:value => 'nova' :value => 'nova'
) )
should contain_manila_config('DEFAULT/api_paste_config').with( is_expected.to contain_manila_config('DEFAULT/api_paste_config').with(
:value => '/etc/manila/api-paste.ini' :value => '/etc/manila/api-paste.ini'
) )
should contain_manila_config('DEFAULT/rootwrap_config').with( is_expected.to contain_manila_config('DEFAULT/rootwrap_config').with(
:value => '/etc/manila/rootwrap.conf' :value => '/etc/manila/rootwrap.conf'
) )
should contain_manila_config('DEFAULT/log_dir').with(:value => '/var/log/manila') is_expected.to contain_manila_config('DEFAULT/log_dir').with(:value => '/var/log/manila')
end end
it { should contain_file('/etc/manila/manila.conf').with( it { is_expected.to contain_file('/etc/manila/manila.conf').with(
:owner => 'manila', :owner => 'manila',
:group => 'manila', :group => 'manila',
:mode => '0600', :mode => '0600',
:require => 'Package[manila]' :require => 'Package[manila]'
) } ) }
it { should contain_file('/etc/manila/api-paste.ini').with( it { is_expected.to contain_file('/etc/manila/api-paste.ini').with(
:owner => 'manila', :owner => 'manila',
:group => 'manila', :group => 'manila',
:mode => '0600', :mode => '0600',
@ -91,12 +91,12 @@ describe 'manila' do
end end
it 'should contain many' do it 'should contain many' do
should_not contain_manila_config('DEFAULT/rabbit_host') is_expected.to_not contain_manila_config('DEFAULT/rabbit_host')
should_not contain_manila_config('DEFAULT/rabbit_port') is_expected.to_not contain_manila_config('DEFAULT/rabbit_port')
should contain_manila_config('DEFAULT/rabbit_hosts').with( is_expected.to contain_manila_config('DEFAULT/rabbit_hosts').with(
:value => 'rabbit1:5672,rabbit2:5672' :value => 'rabbit1:5672,rabbit2:5672'
) )
should contain_manila_config('DEFAULT/rabbit_ha_queues').with( is_expected.to contain_manila_config('DEFAULT/rabbit_ha_queues').with(
:value => true :value => true
) )
end end
@ -108,12 +108,12 @@ describe 'manila' do
end end
it 'should contain many' do it 'should contain many' do
should_not contain_manila_config('DEFAULT/rabbit_host') is_expected.to_not contain_manila_config('DEFAULT/rabbit_host')
should_not contain_manila_config('DEFAULT/rabbit_port') is_expected.to_not contain_manila_config('DEFAULT/rabbit_port')
should contain_manila_config('DEFAULT/rabbit_hosts').with( is_expected.to contain_manila_config('DEFAULT/rabbit_hosts').with(
:value => 'rabbit1:5672' :value => 'rabbit1:5672'
) )
should contain_manila_config('DEFAULT/rabbit_ha_queues').with( is_expected.to contain_manila_config('DEFAULT/rabbit_ha_queues').with(
:value => true :value => true
) )
end end
@ -129,21 +129,21 @@ describe 'manila' do
} }
end end
it { should contain_manila_config('DEFAULT/sql_connection').with_value('mysql://user:password@host/database') } it { is_expected.to contain_manila_config('DEFAULT/sql_connection').with_value('mysql://user:password@host/database') }
it { should contain_manila_config('DEFAULT/rpc_backend').with_value('manila.openstack.common.rpc.impl_qpid') } it { is_expected.to contain_manila_config('DEFAULT/rpc_backend').with_value('manila.openstack.common.rpc.impl_qpid') }
it { should contain_manila_config('DEFAULT/qpid_hostname').with_value('localhost') } it { is_expected.to contain_manila_config('DEFAULT/qpid_hostname').with_value('localhost') }
it { should contain_manila_config('DEFAULT/qpid_port').with_value('5672') } it { is_expected.to contain_manila_config('DEFAULT/qpid_port').with_value('5672') }
it { should contain_manila_config('DEFAULT/qpid_username').with_value('guest') } it { is_expected.to contain_manila_config('DEFAULT/qpid_username').with_value('guest') }
it { should contain_manila_config('DEFAULT/qpid_password').with_value('guest').with_secret(true) } it { is_expected.to contain_manila_config('DEFAULT/qpid_password').with_value('guest').with_secret(true) }
it { should contain_manila_config('DEFAULT/qpid_reconnect').with_value(true) } it { is_expected.to contain_manila_config('DEFAULT/qpid_reconnect').with_value(true) }
it { should contain_manila_config('DEFAULT/qpid_reconnect_timeout').with_value('0') } it { is_expected.to contain_manila_config('DEFAULT/qpid_reconnect_timeout').with_value('0') }
it { should contain_manila_config('DEFAULT/qpid_reconnect_limit').with_value('0') } it { is_expected.to contain_manila_config('DEFAULT/qpid_reconnect_limit').with_value('0') }
it { should contain_manila_config('DEFAULT/qpid_reconnect_interval_min').with_value('0') } it { is_expected.to contain_manila_config('DEFAULT/qpid_reconnect_interval_min').with_value('0') }
it { should contain_manila_config('DEFAULT/qpid_reconnect_interval_max').with_value('0') } it { is_expected.to contain_manila_config('DEFAULT/qpid_reconnect_interval_max').with_value('0') }
it { should contain_manila_config('DEFAULT/qpid_reconnect_interval').with_value('0') } it { is_expected.to contain_manila_config('DEFAULT/qpid_reconnect_interval').with_value('0') }
it { should contain_manila_config('DEFAULT/qpid_heartbeat').with_value('60') } it { is_expected.to contain_manila_config('DEFAULT/qpid_heartbeat').with_value('60') }
it { should contain_manila_config('DEFAULT/qpid_protocol').with_value('tcp') } it { is_expected.to contain_manila_config('DEFAULT/qpid_protocol').with_value('tcp') }
it { should contain_manila_config('DEFAULT/qpid_tcp_nodelay').with_value(true) } it { is_expected.to contain_manila_config('DEFAULT/qpid_tcp_nodelay').with_value(true) }
end end
describe 'with qpid rpc and no qpid_sasl_mechanisms' do describe 'with qpid rpc and no qpid_sasl_mechanisms' do
@ -155,7 +155,7 @@ describe 'manila' do
} }
end end
it { should contain_manila_config('DEFAULT/qpid_sasl_mechanisms').with_ensure('absent') } it { is_expected.to contain_manila_config('DEFAULT/qpid_sasl_mechanisms').with_ensure('absent') }
end end
describe 'with qpid rpc and qpid_sasl_mechanisms string' do describe 'with qpid rpc and qpid_sasl_mechanisms string' do
@ -168,7 +168,7 @@ describe 'manila' do
} }
end end
it { should contain_manila_config('DEFAULT/qpid_sasl_mechanisms').with_value('PLAIN') } it { is_expected.to contain_manila_config('DEFAULT/qpid_sasl_mechanisms').with_value('PLAIN') }
end end
describe 'with qpid rpc and qpid_sasl_mechanisms array' do describe 'with qpid rpc and qpid_sasl_mechanisms array' do
@ -181,7 +181,7 @@ describe 'manila' do
} }
end end
it { should contain_manila_config('DEFAULT/qpid_sasl_mechanisms').with_value('DIGEST-MD5 GSSAPI PLAIN') } it { is_expected.to contain_manila_config('DEFAULT/qpid_sasl_mechanisms').with_value('DIGEST-MD5 GSSAPI PLAIN') }
end end
describe 'with SSL enabled' do describe 'with SSL enabled' do
@ -196,11 +196,11 @@ describe 'manila' do
end end
it do it do
should contain_manila_config('DEFAULT/rabbit_use_ssl').with_value(true) is_expected.to contain_manila_config('DEFAULT/rabbit_use_ssl').with_value(true)
should contain_manila_config('DEFAULT/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs')
should contain_manila_config('DEFAULT/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file')
should contain_manila_config('DEFAULT/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile')
should contain_manila_config('DEFAULT/kombu_ssl_version').with_value('TLSv1') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
end end
end end
@ -212,11 +212,11 @@ describe 'manila' do
end end
it do it do
should contain_manila_config('DEFAULT/rabbit_use_ssl').with_value(true) is_expected.to contain_manila_config('DEFAULT/rabbit_use_ssl').with_value(true)
should contain_manila_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
should contain_manila_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
should contain_manila_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
should contain_manila_config('DEFAULT/kombu_ssl_version').with_value('TLSv1') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
end end
end end
@ -229,11 +229,11 @@ describe 'manila' do
end end
it do it do
should contain_manila_config('DEFAULT/rabbit_use_ssl').with_value(false) is_expected.to contain_manila_config('DEFAULT/rabbit_use_ssl').with_value(false)
should contain_manila_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
should contain_manila_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
should contain_manila_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
should contain_manila_config('DEFAULT/kombu_ssl_version').with_ensure('absent') is_expected.to contain_manila_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
end end
end end
@ -242,7 +242,7 @@ describe 'manila' do
req_params req_params
end end
it { should contain_manila_config('DEFAULT/use_syslog').with_value(false) } it { is_expected.to contain_manila_config('DEFAULT/use_syslog').with_value(false) }
end end
describe 'with syslog enabled' do describe 'with syslog enabled' do
@ -252,8 +252,8 @@ describe 'manila' do
}) })
end end
it { should contain_manila_config('DEFAULT/use_syslog').with_value(true) } it { is_expected.to contain_manila_config('DEFAULT/use_syslog').with_value(true) }
it { should contain_manila_config('DEFAULT/syslog_log_facility').with_value('LOG_USER') } it { is_expected.to contain_manila_config('DEFAULT/syslog_log_facility').with_value('LOG_USER') }
end end
describe 'with syslog enabled and custom settings' do describe 'with syslog enabled and custom settings' do
@ -264,13 +264,13 @@ describe 'manila' do
}) })
end end
it { should contain_manila_config('DEFAULT/use_syslog').with_value(true) } it { is_expected.to contain_manila_config('DEFAULT/use_syslog').with_value(true) }
it { should contain_manila_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0') } it { is_expected.to contain_manila_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0') }
end end
describe 'with log_dir disabled' do describe 'with log_dir disabled' do
let(:params) { req_params.merge!({:log_dir => false}) } let(:params) { req_params.merge!({:log_dir => false}) }
it { should contain_manila_config('DEFAULT/log_dir').with_ensure('absent') } it { is_expected.to contain_manila_config('DEFAULT/log_dir').with_ensure('absent') }
end end
describe 'with amqp_durable_queues disabled' do describe 'with amqp_durable_queues disabled' do
@ -278,7 +278,7 @@ describe 'manila' do
req_params req_params
end end
it { should contain_manila_config('DEFAULT/amqp_durable_queues').with_value(false) } it { is_expected.to contain_manila_config('DEFAULT/amqp_durable_queues').with_value(false) }
end end
describe 'with amqp_durable_queues enabled' do describe 'with amqp_durable_queues enabled' do
@ -288,7 +288,7 @@ describe 'manila' do
}) })
end end
it { should contain_manila_config('DEFAULT/amqp_durable_queues').with_value(true) } it { is_expected.to contain_manila_config('DEFAULT/amqp_durable_queues').with_value(true) }
end end
describe 'with sqlite' do describe 'with sqlite' do
@ -299,13 +299,13 @@ describe 'manila' do
} }
end end
it { should contain_manila_config('DEFAULT/sql_connection').with( it { is_expected.to contain_manila_config('DEFAULT/sql_connection').with(
:value => 'sqlite:////var/lib/manila/manila.sqlite', :value => 'sqlite:////var/lib/manila/manila.sqlite',
:secret => true :secret => true
) } ) }
it { should_not contain_class('mysql::python') } it { is_expected.to_not contain_class('mysql::python') }
it { should_not contain_class('mysql::bindings') } it { is_expected.to_not contain_class('mysql::bindings') }
it { should_not contain_class('mysql::bindings::python') } it { is_expected.to_not contain_class('mysql::bindings::python') }
end end
describe 'with SSL socket options set' do describe 'with SSL socket options set' do
@ -319,9 +319,9 @@ describe 'manila' do
} }
end end
it { should contain_manila_config('DEFAULT/ssl_ca_file').with_value('/path/to/ca') } it { is_expected.to contain_manila_config('DEFAULT/ssl_ca_file').with_value('/path/to/ca') }
it { should contain_manila_config('DEFAULT/ssl_cert_file').with_value('/path/to/cert') } it { is_expected.to contain_manila_config('DEFAULT/ssl_cert_file').with_value('/path/to/cert') }
it { should contain_manila_config('DEFAULT/ssl_key_file').with_value('/path/to/key') } it { is_expected.to contain_manila_config('DEFAULT/ssl_key_file').with_value('/path/to/key') }
end end
describe 'with SSL socket options set to false' do describe 'with SSL socket options set to false' do
@ -335,9 +335,9 @@ describe 'manila' do
} }
end end
it { should contain_manila_config('DEFAULT/ssl_ca_file').with_ensure('absent') } it { is_expected.to contain_manila_config('DEFAULT/ssl_ca_file').with_ensure('absent') }
it { should contain_manila_config('DEFAULT/ssl_cert_file').with_ensure('absent') } it { is_expected.to contain_manila_config('DEFAULT/ssl_cert_file').with_ensure('absent') }
it { should contain_manila_config('DEFAULT/ssl_key_file').with_ensure('absent') } it { is_expected.to contain_manila_config('DEFAULT/ssl_key_file').with_ensure('absent') }
end end
describe 'with SSL socket options set wrongly configured' do describe 'with SSL socket options set wrongly configured' do
@ -350,11 +350,7 @@ describe 'manila' do
} }
end end
it 'should raise an error' do it_raises 'a Puppet::Error', /The cert_file parameter is required when use_ssl is set to true/
expect {
should compile
}.to raise_error Puppet::Error, /The cert_file parameter is required when use_ssl is set to true/
end
end end
end end

View File

@ -20,15 +20,15 @@ describe 'manila::backend::generic' do
describe 'generic share driver' do describe 'generic share driver' do
it 'configures generic share driver' do it 'configures generic share driver' do
should contain_manila_config('hippo/share_backend_name').with( is_expected.to contain_manila_config('hippo/share_backend_name').with(
:value => 'hippo') :value => 'hippo')
should contain_manila_config('hippo/share_driver').with_value( is_expected.to contain_manila_config('hippo/share_driver').with_value(
'manila.share.drivers.generic.GenericShareDriver') 'manila.share.drivers.generic.GenericShareDriver')
should contain_manila_config('hippo/share_helpers').with_value( is_expected.to contain_manila_config('hippo/share_helpers').with_value(
'CIFS=manila.share.drivers.generic.CIFSHelper,'\ 'CIFS=manila.share.drivers.generic.CIFSHelper,'\
'NFS=manila.share.drivers.generic.NFSHelper') 'NFS=manila.share.drivers.generic.NFSHelper')
params.each_pair do |config,value| params.each_pair do |config,value|
should contain_manila_config("hippo/#{config}").with_value( value ) is_expected.to contain_manila_config("hippo/#{config}").with_value( value )
end end
end end
end end

View File

@ -13,13 +13,13 @@ describe 'manila::backend::glusterfs' do
end end
it 'configures glusterfs share driver' do it 'configures glusterfs share driver' do
should contain_manila_config('mygluster/share_backend_name').with_value( is_expected.to contain_manila_config('mygluster/share_backend_name').with_value(
'mygluster') 'mygluster')
should contain_manila_config('mygluster/share_driver').with_value( is_expected.to contain_manila_config('mygluster/share_driver').with_value(
'manila.share.drivers.glusterfs.GlusterfsShareDriver') 'manila.share.drivers.glusterfs.GlusterfsShareDriver')
should contain_manila_config('mygluster/glusterfs_volumes_config').with_value( is_expected.to contain_manila_config('mygluster/glusterfs_volumes_config').with_value(
'/etc/manila/glusterfs_volumes') '/etc/manila/glusterfs_volumes')
should contain_manila_config('mygluster/glusterfs_mount_point_base').with_value( is_expected.to contain_manila_config('mygluster/glusterfs_mount_point_base').with_value(
'$state_path/mnt') '$state_path/mnt')
end end
end end

View File

@ -30,15 +30,15 @@ describe 'manila::backend::netapp' do
end end
it 'configures netapp share driver' do it 'configures netapp share driver' do
should contain_manila_config("mynetapp/share_driver").with_value( is_expected.to contain_manila_config("mynetapp/share_driver").with_value(
'manila.share.drivers.netapp.cluster_mode.NetAppClusteredShareDriver') 'manila.share.drivers.netapp.cluster_mode.NetAppClusteredShareDriver')
params_hash.each_pair do |config,value| params_hash.each_pair do |config,value|
should contain_manila_config("mynetapp/#{config}").with_value( value ) is_expected.to contain_manila_config("mynetapp/#{config}").with_value( value )
end end
end end
it 'marks netapp_password as secret' do it 'marks netapp_password as secret' do
should contain_manila_config("mynetapp/netapp_nas_password").with_secret( true ) is_expected.to contain_manila_config("mynetapp/netapp_nas_password").with_secret( true )
end end
end end

View File

@ -27,7 +27,7 @@ describe 'manila::service_instance' do
it 'configures service instance' do it 'configures service instance' do
expect { expect {
params.each_pair do |config,value| params.each_pair do |config,value|
should contain_manila_config("DEFAULT/#{config}").with_value( value ) is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value )
end end
}.to raise_error(Puppet::Error, /Missing required parameter service_image_location/) }.to raise_error(Puppet::Error, /Missing required parameter service_image_location/)
end end
@ -40,7 +40,7 @@ describe 'manila::service_instance' do
}) } }) }
it 'creates Glance image' do it 'creates Glance image' do
should contain_glance_image(req_params[:service_image_name]).with( is_expected.to contain_glance_image(req_params[:service_image_name]).with(
:ensure => 'present', :ensure => 'present',
:is_public => 'yes', :is_public => 'yes',
:container_format => 'bare', :container_format => 'bare',

View File

@ -17,7 +17,7 @@ describe 'manila::type_set' do
end end
it 'should have its execs' do it 'should have its execs' do
should contain_exec('manila type-key sith set monchichi=hippo').with( is_expected.to contain_exec('manila type-key sith set monchichi=hippo').with(
:command => 'manila type-key sith set monchichi=hippo', :command => 'manila type-key sith set monchichi=hippo',
:environment => [ :environment => [
'OS_TENANT_NAME=admin', 'OS_TENANT_NAME=admin',

View File

@ -17,7 +17,7 @@ describe 'manila::type' do
end end
it 'should have its execs' do it 'should have its execs' do
should contain_exec('manila type-create hippo').with( is_expected.to contain_exec('manila type-create hippo').with(
:command => 'manila type-create hippo', :command => 'manila type-create hippo',
:environment => [ :environment => [
'OS_TENANT_NAME=admin', 'OS_TENANT_NAME=admin',
@ -26,7 +26,7 @@ describe 'manila::type' do
'OS_AUTH_URL=http://127.127.127.1:5000/v2.0/'], 'OS_AUTH_URL=http://127.127.127.1:5000/v2.0/'],
:unless => 'manila type-list | grep hippo', :unless => 'manila type-list | grep hippo',
:require => 'Package[python-manilaclient]') :require => 'Package[python-manilaclient]')
should contain_exec('manila type-key hippo set volume_backend_name=name1') is_expected.to contain_exec('manila type-key hippo set volume_backend_name=name1')
should contain_exec('manila type-key hippo set volume_backend_name=name2') is_expected.to contain_exec('manila type-key hippo set volume_backend_name=name2')
end end
end end