| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'nova::generic_service' do |
| 4 |
shared_examples 'nova::generic_service' do |
| 5 |
describe 'package should come before service' do |
| 6 |
let :pre_condition do |
| 7 |
"include nova" |
| 8 |
end |
| 9 |
|
| 10 |
let :params do |
| 11 |
{ |
| 12 |
:package_name => 'foo', |
| 13 |
:service_name => 'food' |
| 14 |
} |
| 15 |
end |
| 16 |
|
| 17 |
let :title do |
| 18 |
'foo' |
| 19 |
end |
| 20 |
|
| 21 |
it { should contain_service('nova-foo').with( |
| 22 |
:name => 'food', |
| 23 |
:ensure => 'running', |
| 24 |
:enable => true |
| 25 |
)} |
| 26 |
|
| 27 |
it { should contain_service('nova-foo').that_subscribes_to( |
| 28 |
'Anchor[nova::service::begin]', |
| 29 |
)} |
| 30 |
|
| 31 |
it { should contain_service('nova-foo').that_notifies( |
| 32 |
'Anchor[nova::service::end]', |
| 33 |
)} |
| 34 |
end |
| 35 |
end |
| 36 |
|
| 37 |
on_supported_os({ |
| 38 |
:supported_os => OSDefaults.get_supported_os |
| 39 |
}).each do |os,facts| |
| 40 |
context "on #{os}" do |
| 41 |
let (:facts) do |
| 42 |
facts.merge!(OSDefaults.get_facts()) |
| 43 |
end |
| 44 |
|
| 45 |
it_behaves_like 'nova::generic_service' |
| 46 |
end |
| 47 |
end |
| 48 |
end |