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
60 lines
1.8 KiB
Ruby
60 lines
1.8 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'cinder::backend::glusterfs' do
|
|
|
|
shared_examples_for 'glusterfs volume driver' do
|
|
let(:title) {'mygluster'}
|
|
|
|
let :params do
|
|
{
|
|
:glusterfs_shares => ['10.10.10.10:/volumes', '10.10.10.11:/volumes'],
|
|
:glusterfs_shares_config => '/etc/cinder/other_shares.conf',
|
|
:glusterfs_sparsed_volumes => true,
|
|
:glusterfs_mount_point_base => '/cinder_mount_point',
|
|
}
|
|
end
|
|
|
|
it 'configures glusterfs volume driver' do
|
|
is_expected.to contain_cinder_config('mygluster/volume_driver').with_value(
|
|
'cinder.volume.drivers.glusterfs.GlusterfsDriver')
|
|
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')
|
|
is_expected.to contain_file('/etc/cinder/other_shares.conf').with(
|
|
:content => "10.10.10.10:/volumes\n10.10.10.11:/volumes\n",
|
|
:require => 'Package[cinder]',
|
|
:notify => 'Service[cinder-volume]'
|
|
)
|
|
end
|
|
|
|
context "with an parameter which has been removed" do
|
|
before do
|
|
params.merge!({
|
|
:glusterfs_disk_util => 'foo',
|
|
})
|
|
end
|
|
it_raises 'a Puppet::Error', /glusterfs_disk_util is removed in Icehouse./
|
|
end
|
|
end
|
|
|
|
context 'on Debian platforms' do
|
|
let :facts do
|
|
{ :osfamily => 'Debian' }
|
|
end
|
|
|
|
it_configures 'glusterfs volume driver'
|
|
end
|
|
|
|
context 'on RedHat platforms' do
|
|
let :facts do
|
|
{ :osfamily => 'RedHat' }
|
|
end
|
|
|
|
it_configures 'glusterfs volume driver'
|
|
end
|
|
|
|
end
|