Debian OS does not use upstart

This commit is contained in:
François Charlier 2012-04-11 16:57:13 +02:00
parent f7ca79ac29
commit c5f7d6aab2
2 changed files with 58 additions and 8 deletions

View File

@ -54,8 +54,16 @@ class nova::params {
$volume_service_name = 'nova-volume'
$libvirt_package_name = 'libvirt-bin'
$libvirt_service_name = 'libvirt-bin'
# some of the services need to be started form the special upstart provider
$special_service_provider = 'upstart'
case $::operatingsystem {
'Debian': {
# Use default provider on Debian
$special_service_provider = undef
}
default: {
# some of the services need to be started form the special upstart provider
$special_service_provider = 'upstart'
}
}
$tgt_service_name = 'tgt'
# debian specific nova config
$root_helper = 'sudo nova-rootwrap'

View File

@ -20,15 +20,38 @@ describe 'nova::volume' do
'ensure' => 'present',
'notify' => 'Service[nova-volume]'
)}
it { should contain_service('tgtd').with(
'name' => 'tgt',
'provider' => 'upstart',
# FIXME(fc): rspec complains this value is 'nil' in the catalog
#'ensure' => 'stopped',
'enable' => false
)}
it { should contain_package('tgt').with_name('tgt') }
describe 'with enabled as true' do
let :params do
{:enabled => true}
end
it { should contain_service('nova-volume').with(
'name' => 'nova-volume',
'ensure' => 'running',
'enable' => true
'name' => 'nova-volume',
'ensure' => 'running',
'enable' => true
)}
it { should contain_service('tgtd').with(
'name' => 'tgt',
'provider' => 'upstart',
# FIXME(fc): rspec complains this value is 'nil' in the catalog
#'ensure' => 'running',
'enable' => 'true'
)}
describe 'and more specifically on debian os' do
let :facts do
{ :osfamily => 'Debian', :operatingsystem => 'Debian' }
end
it { should contain_service('tgtd').with(
'provider' => nil
)}
end
end
end
describe 'on rhel' do
@ -36,10 +59,29 @@ describe 'nova::volume' do
{ :osfamily => 'RedHat' }
end
it { should contain_service('nova-volume').with(
'name' => 'openstack-nova-volume',
'ensure' => 'stopped',
'enable' => false
'name' => 'openstack-nova-volume',
'ensure' => 'stopped',
'enable' => false
)}
it { should contain_service('tgtd').with(
'name' => 'tgtd',
# FIXME(fc): rspec complains this value is 'nil' in the catalog
#'ensure' => 'stopped',
'enable' => false
)}
it { should_not contain_package('nova-volume') }
it { should contain_package('tgt').with_name('scsi-target-utils')}
describe 'with enabled' do
let :params do
{:enabled => true}
end
it { should contain_service('tgtd').with(
'name' => 'tgtd',
'provider' => 'init',
# FIXME(fc): rspec complains this value is 'nil' in the catalog
#'ensure' => 'running',
'enable' => 'true'
)}
end
end
end