Update tests to work with dynamic es_versions

This commit is contained in:
Michael Russell 2018-01-31 08:14:24 +01:00
parent 92244a7a71
commit 94b059080b
No known key found for this signature in database
GPG key ID: A90C1696496085FE
23 changed files with 127 additions and 65 deletions

View file

@ -2,6 +2,8 @@
#Test explicit setting of parameters and variables #Test explicit setting of parameters and variables
- name: Elasticsearch Config initial - name: Elasticsearch Config initial
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
roles: roles:
#expand to all available parameters #expand to all available parameters
- { role: elasticsearch, es_instance_name: "node1", es_data_dirs: ["/opt/elasticsearch/data-1","/opt/elasticsearch/data-2"], es_log_dir: "/opt/elasticsearch/logs", es_user_id: 333, es_group_id: 333, es_config: {node.name: "node1", cluster.name: "custom-cluster", discovery.zen.ping.unicast.hosts: "localhost:9301", http.port: 9201, transport.tcp.port: 9301, node.data: false, node.master: true, bootstrap.memory_lock: false } } - { role: elasticsearch, es_instance_name: "node1", es_data_dirs: ["/opt/elasticsearch/data-1","/opt/elasticsearch/data-2"], es_log_dir: "/opt/elasticsearch/logs", es_user_id: 333, es_group_id: 333, es_config: {node.name: "node1", cluster.name: "custom-cluster", discovery.zen.ping.unicast.hosts: "localhost:9301", http.port: 9201, transport.tcp.port: 9301, node.data: false, node.master: true, bootstrap.memory_lock: false } }
@ -17,6 +19,8 @@
#Modify the above configuration. Final test should evaluate this configuration. Also tests the plugins are added and removed. #Modify the above configuration. Final test should evaluate this configuration. Also tests the plugins are added and removed.
- name: Elasticsearch Config test modify - name: Elasticsearch Config test modify
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
roles: roles:
#expand to all available parameters #expand to all available parameters
- { role: elasticsearch, es_instance_name: "node1", es_data_dirs: ["/opt/elasticsearch/data-1","/opt/elasticsearch/data-2"], es_log_dir: "/opt/elasticsearch/logs", es_user_id: 333, es_group_id: 333, es_config: {node.name: "node1", cluster.name: "custom-cluster", discovery.zen.ping.unicast.hosts: "localhost:9501", http.port: 9401, transport.tcp.port: 9501, node.data: true, node.master: true, bootstrap.memory_lock: true } } - { role: elasticsearch, es_instance_name: "node1", es_data_dirs: ["/opt/elasticsearch/data-1","/opt/elasticsearch/data-2"], es_log_dir: "/opt/elasticsearch/logs", es_user_id: 333, es_group_id: 333, es_config: {node.name: "node1", cluster.name: "custom-cluster", discovery.zen.ping.unicast.hosts: "localhost:9501", http.port: 9401, transport.tcp.port: 9501, node.data: true, node.master: true, bootstrap.memory_lock: true } }

View file

@ -1,6 +1,8 @@
require 'config_spec' require 'config_spec'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
describe 'Config Tests v 5.x' do describe 'Config Tests' do
include_examples 'config::init', "5.5.1", ["ingest-attachment","ingest-user-agent"] include_examples 'config::init', vars
end end

View file

@ -0,0 +1,6 @@
---
- name: Dump all variables to a file
changed_when: False
copy:
content: '{{ vars | to_nice_json }} '
dest: '/tmp/vars.json'

View file

@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
shared_examples 'config::init' do |es_version,plugins| shared_examples 'config::init' do |vars|
describe user('elasticsearch') do describe user('elasticsearch') do
it { should exist } it { should exist }
@ -77,20 +77,21 @@ shared_examples 'config::init' do |es_version,plugins|
describe 'version check' do describe 'version check' do
it 'should be reported as version '+es_version do it 'should be reported as version '+vars['es_version'] do
command = command('curl -s localhost:9401 | grep number') command = command('curl -s localhost:9401 | grep number')
expect(command.stdout).to match(es_version) expect(command.stdout).to match(vars['es_version'])
expect(command.exit_status).to eq(0) expect(command.exit_status).to eq(0)
end end
end end
for plugin in plugins for plugin in vars['es_plugins']
plugin = plugin['plugin']
describe file('/usr/share/elasticsearch/plugins/'+plugin) do describe file('/usr/share/elasticsearch/plugins/'+plugin) do
it { should be_directory } it { should be_directory }
it { should be_owned_by 'elasticsearch' } it { should be_owned_by 'elasticsearch' }
end end
#confirm plugins are installed and the correct version #confirm plugins are installed and the correct version
describe command('curl -s localhost:9401/_nodes/plugins | grep \'"name":"'+plugin+'","version":"'+es_version+'"\'') do describe command('curl -s localhost:9401/_nodes/plugins | grep \'"name":"'+plugin+'","version":"'+vars['es_version']+'"\'') do
its(:exit_status) { should eq 0 } its(:exit_status) { should eq 0 }
end end
end end
@ -100,7 +101,7 @@ shared_examples 'config::init' do |es_version,plugins|
it { should_not exist } it { should_not exist }
end end
#confirm plugins are installed and the correct version #confirm plugins are installed and the correct version
describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"ingest-geoip","version":"'+es_version+'"\'') do describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"ingest-geoip","version":"'+vars['es_version']+'"\'') do
its(:exit_status) { should eq 1 } its(:exit_status) { should eq 1 }
end end

View file

@ -1,6 +1,8 @@
require 'spec_helper' require 'spec_helper'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
shared_examples 'issue_test::init' do |es_version,plugins| shared_examples 'issue_test::init' do |vars|
#Add custom tests here for the issue-test.yml test #Add custom tests here for the issue-test.yml test

View file

@ -1,6 +1,8 @@
require 'spec_helper' require 'spec_helper'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
shared_examples 'multi::init' do |es_version,plugins| shared_examples 'multi::init' do |vars|
describe user('elasticsearch') do describe user('elasticsearch') do
it { should exist } it { should exist }
@ -154,22 +156,23 @@ shared_examples 'multi::init' do |es_version,plugins|
end end
describe 'version check on master' do describe 'version check on master' do
it 'should be reported as version '+es_version do it 'should be reported as version '+vars['es_version'] do
command = command('curl -s localhost:9200 | grep number') command = command('curl -s localhost:9200 | grep number')
expect(command.stdout).to match(es_version) expect(command.stdout).to match(vars['es_version'])
expect(command.exit_status).to eq(0) expect(command.exit_status).to eq(0)
end end
end end
describe 'version check on data' do describe 'version check on data' do
it 'should be reported as version '+es_version do it 'should be reported as version '+vars['es_version'] do
command = command('curl -s localhost:9201 | grep number') command = command('curl -s localhost:9201 | grep number')
expect(command.stdout).to match(es_version) expect(command.stdout).to match(vars['es_version'])
expect(command.exit_status).to eq(0) expect(command.exit_status).to eq(0)
end end
end end
for plugin in plugins for plugin in vars['es_plugins']
plugin = plugin['plugin']
describe command('curl -s localhost:9200/_nodes/plugins?pretty=true | grep '+plugin) do describe command('curl -s localhost:9200/_nodes/plugins?pretty=true | grep '+plugin) do
its(:exit_status) { should eq 0 } its(:exit_status) { should eq 0 }

View file

@ -1,6 +1,8 @@
require 'spec_helper' require 'spec_helper'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
shared_examples 'package::init' do |es_version,plugins| shared_examples 'package::init' do |vars|
describe user('elasticsearch') do describe user('elasticsearch') do
it { should exist } it { should exist }
@ -56,9 +58,9 @@ shared_examples 'package::init' do |es_version,plugins|
end end
describe 'version check' do describe 'version check' do
it 'should be reported as version '+es_version do it 'should be reported as version '+vars['es_version'] do
command = command('curl -s localhost:9200 | grep number') command = command('curl -s localhost:9200 | grep number')
expect(command.stdout).to match(es_version) expect(command.stdout).to match(vars['es_version'])
expect(command.exit_status).to eq(0) expect(command.exit_status).to eq(0)
end end
end end
@ -69,13 +71,14 @@ shared_examples 'package::init' do |es_version,plugins|
end end
for plugin in plugins for plugin in vars['es_plugins']
plugin = plugin['plugin']
describe file('/usr/share/elasticsearch/plugins/'+plugin) do describe file('/usr/share/elasticsearch/plugins/'+plugin) do
it { should be_directory } it { should be_directory }
it { should be_owned_by 'elasticsearch' } it { should be_owned_by 'elasticsearch' }
end end
#confirm plugins are installed and the correct version #confirm plugins are installed and the correct version
describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"'+plugin+'","version":"'+es_version+'"\'') do describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"'+plugin+'","version":"'+vars['es_version']+'"\'') do
its(:exit_status) { should eq 0 } its(:exit_status) { should eq 0 }
end end
end end

View file

@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
shared_examples 'standard::init' do |es_version,plugins| shared_examples 'standard::init' do |vars|
describe user('elasticsearch') do describe user('elasticsearch') do
it { should exist } it { should exist }
@ -33,7 +33,11 @@ shared_examples 'standard::init' do |es_version,plugins|
describe file('/etc/elasticsearch/node1/elasticsearch.yml') do describe file('/etc/elasticsearch/node1/elasticsearch.yml') do
it { should contain 'node.name: localhost-node1' } it { should contain 'node.name: localhost-node1' }
it { should contain 'cluster.name: elasticsearch' } it { should contain 'cluster.name: elasticsearch' }
it { should contain 'path.conf: /etc/elasticsearch/node1' } if vars['es_major_version'] == '6.x'
it { should_not contain 'path.conf: /etc/elasticsearch/node1' }
else
it { should contain 'path.conf: /etc/elasticsearch/node1' }
end
it { should contain 'path.data: /var/lib/elasticsearch/localhost-node1' } it { should contain 'path.data: /var/lib/elasticsearch/localhost-node1' }
it { should contain 'path.logs: /var/log/elasticsearch/localhost-node1' } it { should contain 'path.logs: /var/log/elasticsearch/localhost-node1' }
end end
@ -45,9 +49,9 @@ shared_examples 'standard::init' do |es_version,plugins|
end end
describe 'version check' do describe 'version check' do
it 'should be reported as version '+es_version do it 'should be reported as version '+vars['es_version'] do
command = command('curl -s localhost:9200 | grep number') command = command('curl -s localhost:9200 | grep number')
expect(command.stdout).to match(es_version) expect(command.stdout).to match(vars['es_version'])
expect(command.exit_status).to eq(0) expect(command.exit_status).to eq(0)
end end
end end
@ -76,13 +80,15 @@ shared_examples 'standard::init' do |es_version,plugins|
it { should_not exist } it { should_not exist }
end end
for plugin in plugins for plugin in vars['es_plugins']
plugin = plugin['plugin']
describe file('/usr/share/elasticsearch/plugins/'+plugin) do describe file('/usr/share/elasticsearch/plugins/'+plugin) do
it { should be_directory } it { should be_directory }
it { should be_owned_by 'elasticsearch' } it { should be_owned_by 'elasticsearch' }
end end
#confirm plugins are installed and the correct version #confirm plugins are installed and the correct version
describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"'+plugin+'","version":"'+es_version+'"\'') do describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"'+plugin+'","version":"'+vars['es_version']+'"\'') do
its(:exit_status) { should eq 0 } its(:exit_status) { should eq 0 }
end end
end end

View file

@ -1,6 +1,8 @@
require 'spec_helper' require 'spec_helper'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
shared_examples 'xpack::init' do |es_version,plugins| shared_examples 'xpack::init' do |vars|
describe user('elasticsearch') do describe user('elasticsearch') do
it { should exist } it { should exist }
@ -39,9 +41,9 @@ shared_examples 'xpack::init' do |es_version,plugins|
end end
describe 'version check' do describe 'version check' do
it 'should be reported as version '+es_version do it 'should be reported as version '+vars['es_version'] do
command = command('curl -s localhost:9200 -u es_admin:changeMeAgain | grep number') command = command('curl -s localhost:9200 -u es_admin:changeMeAgain | grep number')
expect(command.stdout).to match(es_version) expect(command.stdout).to match(vars['es_version'])
expect(command.exit_status).to eq(0) expect(command.exit_status).to eq(0)
end end
end end
@ -104,13 +106,15 @@ shared_examples 'xpack::init' do |es_version,plugins|
it { should be_owned_by 'elasticsearch' } it { should be_owned_by 'elasticsearch' }
end end
for plugin in plugins for plugin in vars['es_plugins']
plugin = plugin['plugin']
describe file('/usr/share/elasticsearch/plugins/'+plugin) do describe file('/usr/share/elasticsearch/plugins/'+plugin) do
it { should be_directory } it { should be_directory }
it { should be_owned_by 'elasticsearch' } it { should be_owned_by 'elasticsearch' }
end end
describe command('curl -s localhost:9200/_nodes/plugins -u es_admin:changeMeAgain | grep \'"name":"'+plugin+'","version":"'+es_version+'"\'') do describe command('curl -s localhost:9200/_nodes/plugins -u es_admin:changeMeAgain | grep \'"name":"'+plugin+'","version":"'+vars['es_version']+'"\'') do
its(:exit_status) { should eq 0 } its(:exit_status) { should eq 0 }
end end
end end
@ -203,9 +207,9 @@ shared_examples 'xpack::init' do |es_version,plugins|
#check accounts are correct i.e. we can auth and they have the correct roles #check accounts are correct i.e. we can auth and they have the correct roles
describe 'kibana4_server access check' do describe 'kibana4_server access check' do
it 'should be reported as version '+es_version do it 'should be reported as version '+vars['es_version'] do
command = command('curl -s localhost:9200/ -u kibana4_server:changeMe | grep number') command = command('curl -s localhost:9200/ -u kibana4_server:changeMe | grep number')
expect(command.stdout).to match(es_version) expect(command.stdout).to match(vars['es_version'])
expect(command.exit_status).to eq(0) expect(command.exit_status).to eq(0)
end end
end end
@ -216,9 +220,9 @@ shared_examples 'xpack::init' do |es_version,plugins|
describe 'logstash_system access check' do describe 'logstash_system access check' do
it 'should be reported as version '+es_version do it 'should be reported as version '+vars['es_version'] do
command = command('curl -s localhost:9200/ -u logstash_system:aNewLogstashPassword | grep number') command = command('curl -s localhost:9200/ -u logstash_system:aNewLogstashPassword | grep number')
expect(command.stdout).to match(es_version) expect(command.stdout).to match(vars['es_version'])
expect(command.exit_status).to eq(0) expect(command.exit_status).to eq(0)
end end
end end
@ -228,9 +232,9 @@ shared_examples 'xpack::init' do |es_version,plugins|
end end
describe 'kibana access check' do describe 'kibana access check' do
it 'should be reported as version '+es_version do it 'should be reported as version '+vars['es_version'] do
command = command('curl -s localhost:9200/ -u kibana:changeme | grep number') command = command('curl -s localhost:9200/ -u kibana:changeme | grep number')
expect(command.stdout).to match(es_version) expect(command.stdout).to match(vars['es_version'])
expect(command.exit_status).to eq(0) expect(command.exit_status).to eq(0)
end end
end end

View file

@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
shared_examples 'xpack_standard::init' do |es_version,plugins| shared_examples 'xpack_standard::init' do |vars|
describe user('elasticsearch') do describe user('elasticsearch') do
it { should exist } it { should exist }
@ -42,9 +42,9 @@ shared_examples 'xpack_standard::init' do |es_version,plugins|
end end
describe 'version check' do describe 'version check' do
it 'should be reported as version '+es_version do it 'should be reported as version '+vars['es_version'] do
command = command('curl -s localhost:9200 | grep number') command = command('curl -s localhost:9200 | grep number')
expect(command.stdout).to match(es_version) expect(command.stdout).to match(vars['es_version'])
expect(command.exit_status).to eq(0) expect(command.exit_status).to eq(0)
end end
end end
@ -107,13 +107,15 @@ shared_examples 'xpack_standard::init' do |es_version,plugins|
it { should be_owned_by 'elasticsearch' } it { should be_owned_by 'elasticsearch' }
end end
for plugin in plugins for plugin in vars['es_plugins']
plugin = plugin['plugin']
describe file('/usr/share/elasticsearch/plugins/'+plugin) do describe file('/usr/share/elasticsearch/plugins/'+plugin) do
it { should be_directory } it { should be_directory }
it { should be_owned_by 'elasticsearch' } it { should be_owned_by 'elasticsearch' }
end end
describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"'+plugin+'","version":"'+es_version+'"\'') do describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"'+plugin+'","version":"'+vars['es_version']+'"\'') do
its(:exit_status) { should eq 0 } its(:exit_status) { should eq 0 }
end end
end end

View file

@ -5,6 +5,8 @@
- name: Simple Example - name: Simple Example
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
roles: roles:
- { - {
role: elasticsearch, role: elasticsearch,

View file

@ -1,6 +1,8 @@
require 'issue_test_spec' require 'issue_test_spec'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
describe 'Issue Test' do describe 'Issue Test' do
include_examples 'issue_test::init', "5.5.1", [] include_examples 'issue_test::init', vars
end end

View file

@ -2,6 +2,8 @@
#Test ability to deploy multiple instances to a machine #Test ability to deploy multiple instances to a machine
- name: Elasticsearch Multi test - master on 9200 - name: Elasticsearch Multi test - master on 9200
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
vars: vars:
es_scripts: true es_scripts: true
es_templates: true es_templates: true
@ -14,6 +16,8 @@
- name: Elasticsearch Multi test - data on 9201 - name: Elasticsearch Multi test - data on 9201
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
vars: vars:
es_scripts: true es_scripts: true
es_templates: true es_templates: true

View file

@ -1,8 +1,9 @@
require 'multi_spec' require 'multi_spec'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
describe 'Multi Tests' do
describe 'Multi Tests v 5.x' do include_examples 'multi::init', vars
include_examples 'multi::init', "5.5.1", ["ingest-geoip"]
end end

View file

@ -1,6 +1,8 @@
--- ---
- name: Elasticsearch Package test intial - name: Elasticsearch Package test intial
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
roles: roles:
- { role: elasticsearch, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "node1" } - { role: elasticsearch, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "node1" }
vars: vars:
@ -16,6 +18,8 @@
#Tests the plugins have been correctly removed and ES can be upgraded between minor versions. All plugins will be removed and re-installed. #Tests the plugins have been correctly removed and ES can be upgraded between minor versions. All plugins will be removed and re-installed.
- name: Elasticsearch Package test modify - name: Elasticsearch Package test modify
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
roles: roles:
- { role: elasticsearch, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "node1" } - { role: elasticsearch, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "node1" }
vars: vars:

View file

@ -1,6 +1,7 @@
require 'package_spec' require 'package_spec'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
describe 'Package Tests' do
describe 'Package Tests v 5.x' do include_examples 'package::init', vars
include_examples 'package::init', "5.5.1", ["ingest-attachment","ingest-geoip"]
end end

View file

@ -1,6 +1,8 @@
--- ---
- name: Standard test for single node setup. Tests idempotence. - name: Standard test for single node setup. Tests idempotence.
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
roles: roles:
- { role: elasticsearch, es_instance_name: "node1" } - { role: elasticsearch, es_instance_name: "node1" }
vars: vars:

View file

@ -1,8 +1,9 @@
require 'standard_spec' require 'standard_spec'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
describe 'Standard Tests' do
describe 'Standard Tests v 5.x' do include_examples 'standard::init', vars
include_examples 'standard::init', "5.5.1", ["ingest-geoip"]
end end

View file

@ -2,6 +2,8 @@
--- ---
- name: Elasticsearch Xpack tests - no security and manual download - name: Elasticsearch Xpack tests - no security and manual download
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
roles: roles:
- { role: elasticsearch, es_api_port: 9200, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "security_node" } - { role: elasticsearch, es_api_port: 9200, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "security_node" }
vars: vars:

View file

@ -1,5 +1,7 @@
require 'xpack_standard_spec' require 'xpack_standard_spec'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
describe 'Xpack Standard Tests v 5.x' do describe 'Xpack Standard Tests' do
include_examples 'xpack_standard::init', "5.5.1", [] include_examples 'xpack_standard::init', vars
end end

View file

@ -1,6 +1,8 @@
--- ---
- name: Elasticsearch Xpack tests initial - name: Elasticsearch Xpack tests initial
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
roles: roles:
- { role: elasticsearch, es_api_port: 9200, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300", - { role: elasticsearch, es_api_port: 9200, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300",
"xpack.security.authc.realms.file1.type": "file","xpack.security.authc.realms.file1.order": 0, "xpack.security.authc.realms.native1.type": "native","xpack.security.authc.realms.native1.order": 1 }, "xpack.security.authc.realms.file1.type": "file","xpack.security.authc.realms.file1.order": 0, "xpack.security.authc.realms.native1.type": "native","xpack.security.authc.realms.native1.order": 1 },
@ -8,7 +10,8 @@
vars: vars:
es_heap_size: "1g" es_heap_size: "1g"
es_templates: true es_templates: true
es_version: "5.4.0" es_major_version: "5.x"
es_version: "5.5.1"
es_enable_xpack: true es_enable_xpack: true
es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}" es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}"
es_plugins: es_plugins:
@ -101,6 +104,8 @@
#modifies the installation. Changes es_admin password and upgrades ES. Tests confirm the correct version is installed. #modifies the installation. Changes es_admin password and upgrades ES. Tests confirm the correct version is installed.
- name: Elasticsearch Xpack modify - name: Elasticsearch Xpack modify
hosts: localhost hosts: localhost
tasks:
- include: elasticsearch/test/integration/debug.yml
roles: roles:
- { role: elasticsearch, es_api_port: 9200, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300", - { role: elasticsearch, es_api_port: 9200, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300",
"xpack.security.authc.realms.file1.type": "file","xpack.security.authc.realms.file1.order": 0, "xpack.security.authc.realms.native1.type": "native","xpack.security.authc.realms.native1.order": 1 }, "xpack.security.authc.realms.file1.type": "file","xpack.security.authc.realms.file1.order": 0, "xpack.security.authc.realms.native1.type": "native","xpack.security.authc.realms.native1.order": 1 },
@ -108,7 +113,8 @@
vars: vars:
es_heap_size: "1g" es_heap_size: "1g"
es_templates: true es_templates: true
es_version: "5.5.1" es_major_version: "6.x"
es_version: "6.1.2"
es_enable_xpack: true es_enable_xpack: true
es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}" es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}"
es_plugins: es_plugins:

View file

@ -1,5 +1,7 @@
require 'xpack_spec' require 'xpack_spec'
require 'json'
vars = JSON.parse(File.read('/tmp/vars.json'))
describe 'Xpack Tests v 5.x' do describe 'Xpack Tests' do
include_examples 'xpack::init', "5.5.1", ["ingest-attachment"] include_examples 'xpack::init', vars
end end