Fixes for evaluating systemd and init
This commit is contained in:
parent
cea57cdd73
commit
870035b385
1 changed files with 17 additions and 10 deletions
|
|
@ -61,10 +61,6 @@ shared_examples 'config::init' do |es_version|
|
||||||
it { should be_owned_by 'elasticsearch' }
|
it { should be_owned_by 'elasticsearch' }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe file('/etc/init.d/node1_elasticsearch') do
|
|
||||||
it { should be_file }
|
|
||||||
end
|
|
||||||
|
|
||||||
#test we started on the correct port was used
|
#test we started on the correct port was used
|
||||||
describe command('curl -s "localhost:9201"') do
|
describe command('curl -s "localhost:9201"') do
|
||||||
#TODO: This is returning an empty string
|
#TODO: This is returning an empty string
|
||||||
|
|
@ -87,7 +83,6 @@ shared_examples 'config::init' do |es_version|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
describe file('/etc/init.d/elasticsearch') do
|
describe file('/etc/init.d/elasticsearch') do
|
||||||
it { should_not exist }
|
it { should_not exist }
|
||||||
end
|
end
|
||||||
|
|
@ -108,11 +103,23 @@ shared_examples 'config::init' do |es_version|
|
||||||
it { should_not exist }
|
it { should_not exist }
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue