puppet-cinder/spec/classes/cinder_volume_spec.rb
Yanis Guenane 384145d163 Add tag to package and service resources
In order to be able to take an action after all the packages of the
module have been installed/updated or all the services have been
started/restarted, we set a 'cinder-package' and 'cinder-service' tag
for each package and service of this module.

At the moment, there is a generic openstack tag that is not specific
enough if one wants to take action upon a single module change.

Use case :

If an action needs to be taken after all the packages have been
installed or updated : Package <| tag == 'cinder-package' |> -> X

Change-Id: Ifa40d902263afa019395e1f12c3063ff3a11bff0
2015-07-22 20:37:16 +02:00

28 lines
688 B
Ruby

require 'spec_helper'
describe 'cinder::volume' do
let :pre_condition do
'class { "cinder": rabbit_password => "fpp", database_connection => "mysql://a:b@c/d" }'
end
let :facts do
{:osfamily => 'Debian'}
end
it { is_expected.to contain_package('cinder-volume').with_ensure('present') }
it { is_expected.to contain_service('cinder-volume').with(
'hasstatus' => true,
'tag' => 'cinder-service',
)}
describe 'with manage_service false' do
let :params do
{ 'manage_service' => false }
end
it 'should not change the state of the service' do
is_expected.to contain_service('cinder-volume').without_ensure
end
end
end