Fixes for evaluating systemd and init

This commit is contained in:
Dale McDiarmid 2016-03-21 14:34:43 +00:00
parent cea57cdd73
commit 870035b385

View file

@ -61,10 +61,6 @@ shared_examples 'config::init' do |es_version|
it { should be_owned_by 'elasticsearch' }
end
describe file('/etc/init.d/node1_elasticsearch') do
it { should be_file }
end
#test we started on the correct port was used
describe command('curl -s "localhost:9201"') do
#TODO: This is returning an empty string
@ -87,7 +83,6 @@ shared_examples 'config::init' do |es_version|
end
end
describe file('/etc/init.d/elasticsearch') do
it { should_not exist }
end
@ -108,11 +103,23 @@ shared_examples 'config::init' do |es_version|
it { should_not exist }
end
#Not copied on Debian 8
#describe file('/usr/lib/systemd/system/node1_elasticsearch.service') do
# it { should be_file }
# it { should contain 'LimitMEMLOCK=infinity' }
#end
#Init vs Systemd tests
#Ubuntu 15 and up
#Debian 8 and up
#Centos 7 and up
if ((os[:family] == 'centos' && os[:release].to_f >= 7.0) ||
(os[:family] == 'ubuntu' && os[:release].to_f >= 15.0) ||
(os[:family] == 'debian' && os[:release].to_f >= 8.0))
describe file('/usr/lib/systemd/system/node1_elasticsearch.service') do
it { should be_file }
it { should contain 'LimitMEMLOCK=infinity' }
end
else
describe file('/etc/init.d/node1_elasticsearch') do
it { should be_file }
end
end
end