2015-07-09 16:29:06 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
|
|
context "basic tests" do
|
|
|
|
|
|
|
|
|
|
describe user('elasticsearch') do
|
|
|
|
|
it { should exist }
|
|
|
|
|
end
|
|
|
|
|
|
2015-11-25 15:28:09 +00:00
|
|
|
describe service('node1_elasticsearch') do
|
2015-07-09 16:29:06 +02:00
|
|
|
it { should be_running }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
describe package('elasticsearch') do
|
|
|
|
|
it { should be_installed }
|
|
|
|
|
end
|
|
|
|
|
|
2015-11-25 15:28:09 +00:00
|
|
|
describe file('/etc/elasticsearch/node1/elasticsearch.yml') do
|
2015-07-09 16:29:06 +02:00
|
|
|
it { should be_file }
|
2015-11-26 10:20:58 +00:00
|
|
|
it { should be_owned_by 'elasticsearch' }
|
2015-07-09 16:29:06 +02:00
|
|
|
end
|
|
|
|
|
|
2015-11-25 23:43:01 +00:00
|
|
|
describe file('/etc/elasticsearch/node1/logging.yml') do
|
|
|
|
|
it { should be_file }
|
2015-11-26 10:20:58 +00:00
|
|
|
it { should be_owned_by 'elasticsearch' }
|
2015-11-25 23:43:01 +00:00
|
|
|
end
|
|
|
|
|
|
2015-11-25 15:28:09 +00:00
|
|
|
describe file('/etc/elasticsearch/node1/elasticsearch.yml') do
|
|
|
|
|
it { should contain 'node.name: localhost-node1' }
|
2015-11-25 17:13:45 +00:00
|
|
|
it { should contain 'cluster.name: elasticsearch' }
|
2015-11-25 15:28:09 +00:00
|
|
|
it { should contain 'path.conf: /etc/elasticsearch/node1' }
|
|
|
|
|
it { should contain 'path.data: /var/lib/elasticsearch/localhost-node1' }
|
|
|
|
|
it { should contain 'path.work: /tmp/elasticsearch/localhost-node1' }
|
|
|
|
|
it { should contain 'path.logs: /var/log/elasticsearch/localhost-node1' }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
describe 'Node listening' do
|
|
|
|
|
it 'listening in port 9200' do
|
|
|
|
|
expect(port 9200).to be_listening
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2015-10-19 12:44:09 +02:00
|
|
|
describe 'plugin' do
|
|
|
|
|
it 'should be reported as existing', :retry => 3, :retry_wait => 10 do
|
2015-11-27 19:58:54 +00:00
|
|
|
command = command('curl -s localhost:9200/_nodes/?plugin | grep kopf')
|
2015-10-19 12:44:09 +02:00
|
|
|
expect(command.stdout).to match(/kopf/)
|
|
|
|
|
expect(command.exit_status).to eq(0)
|
|
|
|
|
end
|
2015-07-09 16:29:06 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|