systemd tests
This commit is contained in:
parent
0c7c338d6d
commit
7455b7fe3e
4 changed files with 30 additions and 15 deletions
|
|
@ -61,17 +61,23 @@ context "basic tests" do
|
||||||
end
|
end
|
||||||
|
|
||||||
#test we started on the correct port was used
|
#test we started on the correct port was used
|
||||||
describe command('curl "localhost:9201" | grep status') do
|
describe command('curl -s "localhost:9201" | grep status') do
|
||||||
#TODO: This is returning an empty string
|
#TODO: This is returning an empty string
|
||||||
#its(:stdout) { should match /\"status\" : 200/ }
|
#its(:stdout) { should match /\"status\" : 200/ }
|
||||||
its(:exit_status) { should eq 0 }
|
its(:exit_status) { should eq 0 }
|
||||||
end
|
end
|
||||||
|
|
||||||
#test to make sure mlock was applied
|
#test to make sure mlock was applied
|
||||||
describe command('curl "localhost:9201/_nodes/process?pretty" | grep mlockall') do
|
describe command('curl -s "localhost:9201/_nodes/process?pretty" | grep mlockall') do
|
||||||
its(:stdout) { should match /\"mlockall\" : true/ }
|
its(:stdout) { should match /true/ }
|
||||||
its(:exit_status) { should eq 0 }
|
its(:exit_status) { should eq 0 }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe file('/usr/lib/systemd/system/node1_elasticsearch.service') do
|
||||||
|
it { should be_file }
|
||||||
|
it { should contain 'LimitMEMLOCK=infinity' }
|
||||||
|
it { should contain 'EnvironmentFile=-/etc/sysconfig/node1_elasticsearch' }
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,16 +18,9 @@ context "basic tests" do
|
||||||
it { should be_installed }
|
it { should be_installed }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe file('/etc/elasticsearch/node1/elasticsearch.yml') do
|
|
||||||
it { should be_file }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe file('/etc/elasticsearch/master/elasticsearch.yml') do
|
|
||||||
it { should be_file }
|
|
||||||
end
|
|
||||||
|
|
||||||
#test configuration parameters have been set - test all appropriately set in config file
|
#test configuration parameters have been set - test all appropriately set in config file
|
||||||
describe file('/etc/elasticsearch/node1/elasticsearch.yml') do
|
describe file('/etc/elasticsearch/node1/elasticsearch.yml') do
|
||||||
|
it { should be_file }
|
||||||
it { should contain 'http.port: 9201' }
|
it { should contain 'http.port: 9201' }
|
||||||
it { should contain 'transport.tcp.port: 9301' }
|
it { should contain 'transport.tcp.port: 9301' }
|
||||||
it { should contain 'node.data: true' }
|
it { should contain 'node.data: true' }
|
||||||
|
|
@ -44,6 +37,7 @@ context "basic tests" do
|
||||||
|
|
||||||
#test configuration parameters have been set for master - test all appropriately set in config file
|
#test configuration parameters have been set for master - test all appropriately set in config file
|
||||||
describe file('/etc/elasticsearch/master/elasticsearch.yml') do
|
describe file('/etc/elasticsearch/master/elasticsearch.yml') do
|
||||||
|
it { should be_file }
|
||||||
it { should contain 'http.port: 9200' }
|
it { should contain 'http.port: 9200' }
|
||||||
it { should contain 'transport.tcp.port: 9300' }
|
it { should contain 'transport.tcp.port: 9300' }
|
||||||
it { should contain 'node.data: false' }
|
it { should contain 'node.data: false' }
|
||||||
|
|
@ -150,15 +144,30 @@ context "basic tests" do
|
||||||
end
|
end
|
||||||
|
|
||||||
#test to make sure mlock was applied
|
#test to make sure mlock was applied
|
||||||
describe command('curl "localhost:9200/_nodes/localhost-master/process?pretty" | grep mlockall') do
|
describe command('curl -s "localhost:9200/_nodes/localhost-master/process?pretty=true" | grep mlockall') do
|
||||||
its(:stdout) { should match /true/ }
|
its(:stdout) { should match /true/ }
|
||||||
its(:exit_status) { should eq 0 }
|
its(:exit_status) { should eq 0 }
|
||||||
end
|
end
|
||||||
|
|
||||||
#test to make sure mlock was not applied
|
#test to make sure mlock was not applied
|
||||||
describe command('curl "localhost:9201/_nodes/localhost-node1/process?pretty" | grep mlockall') do
|
describe command('curl -s "localhost:9201/_nodes/localhost-node1/process?pretty=true" | grep mlockall') do
|
||||||
its(:stdout) { should match /false/ }
|
its(:stdout) { should match /false/ }
|
||||||
its(:exit_status) { should eq 0 }
|
its(:exit_status) { should eq 0 }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
#Test server spec file has been created and modified
|
||||||
|
describe file('/usr/lib/systemd/system/master_elasticsearch.service') do
|
||||||
|
it { should be_file }
|
||||||
|
it { should contain 'LimitMEMLOCK=infinity' }
|
||||||
|
it { should contain 'EnvironmentFile=-/etc/sysconfig/master_elasticsearch' }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe file('/usr/lib/systemd/system/node1_elasticsearch.service') do
|
||||||
|
it { should be_file }
|
||||||
|
it { should_not contain 'LimitMEMLOCK=infinity' }
|
||||||
|
it { should contain 'EnvironmentFile=-/etc/sysconfig/node1_elasticsearch' }
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ context "basic tests" do
|
||||||
|
|
||||||
describe 'Template Installed' do
|
describe 'Template Installed' do
|
||||||
it 'should be reported as being installed', :retry => 3, :retry_wait => 10 do
|
it 'should be reported as being installed', :retry => 3, :retry_wait => 10 do
|
||||||
command = command('curl localhost:9200/_template/basic')
|
command = command('curl -s "localhost:9200/_template/basic"')
|
||||||
expect(command.stdout).to match(/basic/)
|
expect(command.stdout).to match(/basic/)
|
||||||
expect(command.exit_status).to eq(0)
|
expect(command.exit_status).to eq(0)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ context "basic tests" do
|
||||||
|
|
||||||
describe 'plugin' do
|
describe 'plugin' do
|
||||||
it 'should be reported as existing', :retry => 3, :retry_wait => 10 do
|
it 'should be reported as existing', :retry => 3, :retry_wait => 10 do
|
||||||
command = command('curl localhost:9200/_nodes/?plugin | grep kopf')
|
command = command('curl -s localhost:9200/_nodes/?plugin | grep kopf')
|
||||||
expect(command.stdout).to match(/kopf/)
|
expect(command.stdout).to match(/kopf/)
|
||||||
expect(command.exit_status).to eq(0)
|
expect(command.exit_status).to eq(0)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue