add tests for upstart on centos

...which are failing
This commit is contained in:
Stephan Renatus 2016-02-05 09:05:15 +01:00 committed by Christoph Hartmann
parent 489863a7ce
commit eecb295377
3 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,21 @@
# encoding: utf-8
# author: Stephan Renatus
file "/etc/init/upstart-running.conf" do
content "exec tail -f /dev/null"
end
file "/etc/init/upstart-enabled-not-running.conf" do
content "exec tail -f /dev/null\nstart on networking"
end
file "/etc/init/upstart-enabled-and-running.conf" do
content "exec tail -f /dev/null\nstart on networking"
end
%w{ enabled-and-running running }.each do |srv|
service "upstart-#{srv}" do
provider Chef::Provider::Service::Upstart
action :start
end
end

View file

@ -13,4 +13,5 @@ when 'ubuntu'
when 'centos'
# install runit for alternative service mgmt
include_recipe 'os_prepare::_runit_service_centos'
include_recipe 'os_prepare::_upstart_service_centos'
end

View file

@ -78,4 +78,28 @@ if os[:family] == 'centos'
it { should_not be_installed }
it { should_not be_running }
end
describe upstart_service('upstart-running') do
it { should_not be_enabled }
it { should be_installed }
it { should be_running }
end
describe upstart_service('upstart-enabled-and-running') do
it { should be_enabled }
it { should be_installed }
it { should be_running }
end
describe upstart_service('upstart-enabled-not-running') do
it { should be_enabled }
it { should be_installed }
it { should_not be_running }
end
describe upstart_service('unknown') do
it { should_not be_enabled }
it { should_not be_installed }
it { should_not be_running }
end
end