Files
puppet-cinder/spec/classes/cinder_volume_nfs_spec.rb
Sebastien Badia 4224fdd12e 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

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:

  * Use shared_examples "a Puppet::Error" for puppet::error tests
  * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
  * Fix spec tests for rspec-puppet 2.0.0
  * 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: Id5b428fb518f40cf92cd27078d36f19b6d60226b
Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
2015-03-11 17:58:49 +01:00

44 lines
1.6 KiB
Ruby

require 'spec_helper'
describe 'cinder::volume::nfs' do
let :params do
{
:nfs_servers => ['10.10.10.10:/shares', '10.10.10.10:/shares2'],
:nfs_mount_options => 'vers=3',
:nfs_shares_config => '/etc/cinder/other_shares.conf',
:nfs_disk_util => 'du',
:nfs_sparsed_volumes => true,
:nfs_mount_point_base => '/cinder_mount_point',
:nfs_used_ratio => '0.95',
:nfs_oversub_ratio => '1.0',
}
end
describe 'nfs volume driver' do
it 'configures nfs volume driver' do
is_expected.to contain_cinder_config('DEFAULT/volume_driver').with_value(
'cinder.volume.drivers.nfs.NfsDriver')
is_expected.to contain_cinder_config('DEFAULT/nfs_shares_config').with_value(
'/etc/cinder/other_shares.conf')
is_expected.to contain_cinder_config('DEFAULT/nfs_mount_options').with_value(
'vers=3')
is_expected.to contain_cinder_config('DEFAULT/nfs_sparsed_volumes').with_value(
true)
is_expected.to contain_cinder_config('DEFAULT/nfs_mount_point_base').with_value(
'/cinder_mount_point')
is_expected.to contain_cinder_config('DEFAULT/nfs_disk_util').with_value(
'du')
is_expected.to contain_cinder_config('DEFAULT/nfs_used_ratio').with_value(
'0.95')
is_expected.to contain_cinder_config('DEFAULT/nfs_oversub_ratio').with_value(
'1.0')
is_expected.to contain_file('/etc/cinder/other_shares.conf').with(
:content => "10.10.10.10:/shares\n10.10.10.10:/shares2",
:require => 'Package[cinder]',
:notify => 'Service[cinder-volume]'
)
end
end
end