Multi node plugin tests
This commit is contained in:
parent
50f1c6f153
commit
54dd51b8a1
9 changed files with 62 additions and 11 deletions
11
.kitchen.yml
11
.kitchen.yml
|
|
@ -80,6 +80,12 @@ suites:
|
|||
- name: multi-2x
|
||||
run_list:
|
||||
attributes:
|
||||
extra_vars:
|
||||
es_plugins:
|
||||
- plugin: lmenezes/elasticsearch-kopf
|
||||
version: master
|
||||
- plugin: license
|
||||
- plugin: marvel-agent
|
||||
provisioner:
|
||||
playbook: test/integration/multi.yml
|
||||
- name: standard-1x
|
||||
|
|
@ -117,5 +123,10 @@ suites:
|
|||
extra_vars:
|
||||
es_major_version: 1.7
|
||||
es_version: 1.7.3
|
||||
es_plugins:
|
||||
- plugin: lmenezes/elasticsearch-kopf
|
||||
version: master
|
||||
- plugin: elasticsearch/marvel
|
||||
version: latest
|
||||
provisioner:
|
||||
playbook: test/integration/multi.yml
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# Check for mandatory parameters
|
||||
|
||||
- fail: msg="es_instance_name must be specified"
|
||||
when: es_instance_name is not defined
|
||||
- fail: msg="es_instance_name must be specified and cannot be blank"
|
||||
when: es_instance_name is not defined or es_instance_name == ''
|
||||
|
||||
- set_fact: multi_cast={{ (es_version | version_compare('2.0', '<') and es_config['discovery.zen.ping.multicast.enabled'] is not defined) or (es_config['discovery.zen.ping.multicast.enabled'] is defined and es_config['discovery.zen.ping.multicast.enabled'])}}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,4 +68,6 @@
|
|||
#Copy the logging.yml
|
||||
- name: Copy Logging.yml File for Instance
|
||||
template: src=logging.yml.j2 dest={{conf_dir}}/logging.yml owner={{ es_user }} group={{ es_group }} mode=0644 force=yes
|
||||
notify: restart elasticsearch
|
||||
notify: restart elasticsearch
|
||||
|
||||
#Clean up un-wanted package scripts to avoid confusion
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
shared_examples 'multi::init' do |es_version|
|
||||
shared_examples 'multi::init' do |es_version,plugins|
|
||||
|
||||
describe user('elasticsearch') do
|
||||
it { should exist }
|
||||
|
|
@ -171,8 +171,42 @@ shared_examples 'multi::init' do |es_version|
|
|||
end
|
||||
end
|
||||
|
||||
#Multi node plugin tests
|
||||
describe file('/opt/elasticsearch/plugins/node1') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
#Test server spec file has been created and modified
|
||||
describe file('/opt/elasticsearch/plugins/master') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
|
||||
for plugin in plugins
|
||||
describe file('/opt/elasticsearch/plugins/node1/'+plugin) do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe file('/opt/elasticsearch/plugins/master/'+plugin) do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe command('curl -s localhost:9200/_nodes/plugins?pretty=true | grep '+plugin) do
|
||||
its(:exit_status) { should eq 0 }
|
||||
end
|
||||
|
||||
describe command('curl -s localhost:9201/_nodes/plugins?pretty=true | grep '+plugin) do
|
||||
its(:exit_status) { should eq 0 }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
#Test server spec file has been created and modified - currently not possible as not copied for debian 8
|
||||
#describe file('/usr/lib/systemd/system/master_elasticsearch.service') do
|
||||
# it { should be_file }
|
||||
# it { should contain 'LimitMEMLOCK=infinity' }
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ shared_examples 'package::init' do |es_version,plugins|
|
|||
|
||||
describe file('/etc/elasticsearch/node1/elasticsearch.yml') do
|
||||
it { should be_file }
|
||||
it { should contain 'path.plugins: /usr/share/elasticsearch/plugins/node1' }
|
||||
it { should contain 'http.port: 9200' }
|
||||
it { should contain 'transport.tcp.port: 9300' }
|
||||
it { should contain 'discovery.zen.ping.unicast.hosts: localhost:9300' }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/node1/scripts') do
|
||||
|
|
@ -77,10 +81,7 @@ shared_examples 'package::init' do |es_version,plugins|
|
|||
describe command('curl -s localhost:9200/_nodes/plugins?pretty=true | grep '+plugin) do
|
||||
its(:exit_status) { should eq 0 }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
#path.plugins: /usr/share/elasticsearch/plugins/node1
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@ require 'multi_spec'
|
|||
|
||||
|
||||
describe 'Multi Tests v 1.x' do
|
||||
include_examples 'multi::init', "1.7.3"
|
||||
include_examples 'multi::init', "1.7.3", ["kopf","marvel"]
|
||||
end
|
||||
|
|
@ -2,7 +2,7 @@ require 'multi_spec'
|
|||
|
||||
|
||||
describe 'Multi Tests v 2.x' do
|
||||
include_examples 'multi::init', "2.1.0"
|
||||
include_examples 'multi::init', "2.1.0", ["kopf","license","marvel-agent"]
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,4 +7,6 @@
|
|||
- { role: elasticsearch, es_instance_name: "node1", es_config: { "discovery.zen.ping.multicast.enabled": false, discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9201, transport.tcp.port: 9301, node.data: true, node.master: false, discovery.zen.ping.multicast.enabled: false } }
|
||||
vars:
|
||||
es_scripts: true
|
||||
es_templates: true
|
||||
es_templates: true
|
||||
es_plugin_dir: "/opt/elasticsearch/plugins"
|
||||
#Plugins installed for this test are specified in .kitchen.yml under suite
|
||||
|
|
@ -6,3 +6,4 @@
|
|||
vars:
|
||||
es_scripts: true
|
||||
es_templates: true
|
||||
#Plugins installed for this test are specified in .kitchen.yml under suite
|
||||
Loading…
Add table
Add a link
Reference in a new issue