puppet-glance/spec/classes/glance_spec.rb
Benedikt von St. Vieth 7128d96dde solve duplicate declaration issue for python-openstackclient
when having a controller node with several modules that use puppet-openstacklib
the package python-openstackclient is already declared. because openstacklib
adds the tag 'openstack' to the resource, we have to do it here to. otherwise
ensure_resource does not recognize it and we have a duplicate declaration
for the package.

Change-Id: Icf341ea92764f2ddb60b0e7ace09a56febe59545
Closes-Bug: #1483663
2015-08-13 19:03:37 +02:00

62 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'glance' do
let :facts do
{
:osfamily => 'Debian'
}
end
let :default_params do
{}
end
[
{},
{}
].each do |param_set|
describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
let :param_hash do
param_set == {} ? default_params : params
end
let :params do param_set end
it { is_expected.to contain_file('/etc/glance/').with(
'ensure' => 'directory',
'owner' => 'glance',
'mode' => '0770'
)}
it { is_expected.to contain_package('python-openstackclient').with(
:tag => 'openstack'
)}
end
end
describe 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
let(:params) { default_params }
it { is_expected.to_not contain_package('glance') }
end
describe 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
let(:params) { default_params }
it { is_expected.to contain_package('openstack-glance').with(
:tag => ['openstack', 'glance-package'],
)}
end
end