From 94b059080b9aab96982a001b16ecf7b66d85ec3f Mon Sep 17 00:00:00 2001 From: Michael Russell Date: Wed, 31 Jan 2018 08:14:24 +0100 Subject: [PATCH] Update tests to work with dynamic es_versions --- test/integration/config.yml | 6 ++++- .../config/serverspec/default_spec.rb | 6 +++-- test/integration/debug.yml | 6 +++++ .../helpers/serverspec/config_spec.rb | 13 +++++----- .../helpers/serverspec/issue_test_spec.rb | 4 ++- .../helpers/serverspec/multi_spec.rb | 15 ++++++----- .../helpers/serverspec/package_spec.rb | 13 ++++++---- .../helpers/serverspec/spec_helper.rb | 2 +- .../helpers/serverspec/standard_spec.rb | 18 ++++++++----- .../helpers/serverspec/xpack_spec.rb | 26 +++++++++++-------- .../helpers/serverspec/xpack_standard_spec.rb | 12 +++++---- test/integration/issue-test.yml | 4 ++- .../issue-test/serverspec/default_spec.rb | 4 ++- test/integration/multi.yml | 4 +++ .../multi/serverspec/default_spec.rb | 7 ++--- test/integration/package.yml | 4 +++ .../package/serverspec/default_spec.rb | 9 ++++--- test/integration/standard.yml | 4 ++- .../standard/serverspec/default_spec.rb | 7 ++--- test/integration/xpack-standard.yml | 4 ++- .../xpack-standard/serverspec/default_spec.rb | 6 +++-- test/integration/xpack.yml | 12 ++++++--- .../xpack/serverspec/default_spec.rb | 6 +++-- 23 files changed, 127 insertions(+), 65 deletions(-) create mode 100644 test/integration/debug.yml diff --git a/test/integration/config.yml b/test/integration/config.yml index e8b623d..06bc035 100644 --- a/test/integration/config.yml +++ b/test/integration/config.yml @@ -2,6 +2,8 @@ #Test explicit setting of parameters and variables - name: Elasticsearch Config initial hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml roles: #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 } } @@ -17,6 +19,8 @@ #Modify the above configuration. Final test should evaluate this configuration. Also tests the plugins are added and removed. - name: Elasticsearch Config test modify hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml roles: #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 } } @@ -31,4 +35,4 @@ es_max_threads: 3000 es_plugins: - plugin: ingest-attachment - - plugin: ingest-user-agent \ No newline at end of file + - plugin: ingest-user-agent diff --git a/test/integration/config/serverspec/default_spec.rb b/test/integration/config/serverspec/default_spec.rb index ade4b54..b76a509 100644 --- a/test/integration/config/serverspec/default_spec.rb +++ b/test/integration/config/serverspec/default_spec.rb @@ -1,6 +1,8 @@ require 'config_spec' +require 'json' +vars = JSON.parse(File.read('/tmp/vars.json')) -describe 'Config Tests v 5.x' do - include_examples 'config::init', "5.5.1", ["ingest-attachment","ingest-user-agent"] +describe 'Config Tests' do + include_examples 'config::init', vars end diff --git a/test/integration/debug.yml b/test/integration/debug.yml new file mode 100644 index 0000000..81b08b1 --- /dev/null +++ b/test/integration/debug.yml @@ -0,0 +1,6 @@ +--- +- name: Dump all variables to a file + changed_when: False + copy: + content: '{{ vars | to_nice_json }} ' + dest: '/tmp/vars.json' diff --git a/test/integration/helpers/serverspec/config_spec.rb b/test/integration/helpers/serverspec/config_spec.rb index 9631a4c..761cbd4 100644 --- a/test/integration/helpers/serverspec/config_spec.rb +++ b/test/integration/helpers/serverspec/config_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -shared_examples 'config::init' do |es_version,plugins| +shared_examples 'config::init' do |vars| describe user('elasticsearch') do it { should exist } @@ -77,20 +77,21 @@ shared_examples 'config::init' do |es_version,plugins| 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') - expect(command.stdout).to match(es_version) + expect(command.stdout).to match(vars['es_version']) expect(command.exit_status).to eq(0) end end - for plugin in plugins + for plugin in vars['es_plugins'] + plugin = plugin['plugin'] describe file('/usr/share/elasticsearch/plugins/'+plugin) do it { should be_directory } it { should be_owned_by 'elasticsearch' } end #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 } end end @@ -100,7 +101,7 @@ shared_examples 'config::init' do |es_version,plugins| it { should_not exist } end #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 } end diff --git a/test/integration/helpers/serverspec/issue_test_spec.rb b/test/integration/helpers/serverspec/issue_test_spec.rb index fe18a6b..f65ed61 100644 --- a/test/integration/helpers/serverspec/issue_test_spec.rb +++ b/test/integration/helpers/serverspec/issue_test_spec.rb @@ -1,6 +1,8 @@ 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 diff --git a/test/integration/helpers/serverspec/multi_spec.rb b/test/integration/helpers/serverspec/multi_spec.rb index 003ffe6..fcb3b6b 100644 --- a/test/integration/helpers/serverspec/multi_spec.rb +++ b/test/integration/helpers/serverspec/multi_spec.rb @@ -1,6 +1,8 @@ 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 it { should exist } @@ -154,22 +156,23 @@ shared_examples 'multi::init' do |es_version,plugins| end 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') - expect(command.stdout).to match(es_version) + expect(command.stdout).to match(vars['es_version']) expect(command.exit_status).to eq(0) end end 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') - expect(command.stdout).to match(es_version) + expect(command.stdout).to match(vars['es_version']) expect(command.exit_status).to eq(0) 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 its(:exit_status) { should eq 0 } diff --git a/test/integration/helpers/serverspec/package_spec.rb b/test/integration/helpers/serverspec/package_spec.rb index ac68bc2..947ce87 100644 --- a/test/integration/helpers/serverspec/package_spec.rb +++ b/test/integration/helpers/serverspec/package_spec.rb @@ -1,6 +1,8 @@ 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 it { should exist } @@ -56,9 +58,9 @@ shared_examples 'package::init' do |es_version,plugins| end 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') - expect(command.stdout).to match(es_version) + expect(command.stdout).to match(vars['es_version']) expect(command.exit_status).to eq(0) end end @@ -69,13 +71,14 @@ shared_examples 'package::init' do |es_version,plugins| end - for plugin in plugins + for plugin in vars['es_plugins'] + plugin = plugin['plugin'] describe file('/usr/share/elasticsearch/plugins/'+plugin) do it { should be_directory } it { should be_owned_by 'elasticsearch' } end #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 } end end diff --git a/test/integration/helpers/serverspec/spec_helper.rb b/test/integration/helpers/serverspec/spec_helper.rb index 1a1bfb5..5bef120 100644 --- a/test/integration/helpers/serverspec/spec_helper.rb +++ b/test/integration/helpers/serverspec/spec_helper.rb @@ -8,4 +8,4 @@ RSpec.configure do |config| config.verbose_retry = true # show exception that triggers a retry if verbose_retry is set to true config.display_try_failure_messages = true -end \ No newline at end of file +end diff --git a/test/integration/helpers/serverspec/standard_spec.rb b/test/integration/helpers/serverspec/standard_spec.rb index d5cb660..59b9f2a 100644 --- a/test/integration/helpers/serverspec/standard_spec.rb +++ b/test/integration/helpers/serverspec/standard_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -shared_examples 'standard::init' do |es_version,plugins| +shared_examples 'standard::init' do |vars| describe user('elasticsearch') do it { should exist } @@ -33,7 +33,11 @@ shared_examples 'standard::init' do |es_version,plugins| describe file('/etc/elasticsearch/node1/elasticsearch.yml') do it { should contain 'node.name: localhost-node1' } 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.logs: /var/log/elasticsearch/localhost-node1' } end @@ -45,9 +49,9 @@ shared_examples 'standard::init' do |es_version,plugins| end 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') - expect(command.stdout).to match(es_version) + expect(command.stdout).to match(vars['es_version']) expect(command.exit_status).to eq(0) end end @@ -76,13 +80,15 @@ shared_examples 'standard::init' do |es_version,plugins| it { should_not exist } end - for plugin in plugins + for plugin in vars['es_plugins'] + plugin = plugin['plugin'] + describe file('/usr/share/elasticsearch/plugins/'+plugin) do it { should be_directory } it { should be_owned_by 'elasticsearch' } end #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 } end end diff --git a/test/integration/helpers/serverspec/xpack_spec.rb b/test/integration/helpers/serverspec/xpack_spec.rb index 54df75a..c38843e 100644 --- a/test/integration/helpers/serverspec/xpack_spec.rb +++ b/test/integration/helpers/serverspec/xpack_spec.rb @@ -1,6 +1,8 @@ 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 it { should exist } @@ -39,9 +41,9 @@ shared_examples 'xpack::init' do |es_version,plugins| end 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') - expect(command.stdout).to match(es_version) + expect(command.stdout).to match(vars['es_version']) expect(command.exit_status).to eq(0) end end @@ -104,13 +106,15 @@ shared_examples 'xpack::init' do |es_version,plugins| it { should be_owned_by 'elasticsearch' } end - for plugin in plugins + for plugin in vars['es_plugins'] + plugin = plugin['plugin'] + describe file('/usr/share/elasticsearch/plugins/'+plugin) do it { should be_directory } it { should be_owned_by 'elasticsearch' } 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 } 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 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') - expect(command.stdout).to match(es_version) + expect(command.stdout).to match(vars['es_version']) expect(command.exit_status).to eq(0) end end @@ -216,9 +220,9 @@ shared_examples 'xpack::init' do |es_version,plugins| 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') - expect(command.stdout).to match(es_version) + expect(command.stdout).to match(vars['es_version']) expect(command.exit_status).to eq(0) end end @@ -228,9 +232,9 @@ shared_examples 'xpack::init' do |es_version,plugins| end 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') - expect(command.stdout).to match(es_version) + expect(command.stdout).to match(vars['es_version']) expect(command.exit_status).to eq(0) end end diff --git a/test/integration/helpers/serverspec/xpack_standard_spec.rb b/test/integration/helpers/serverspec/xpack_standard_spec.rb index 1dcef52..fa5de1c 100644 --- a/test/integration/helpers/serverspec/xpack_standard_spec.rb +++ b/test/integration/helpers/serverspec/xpack_standard_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -shared_examples 'xpack_standard::init' do |es_version,plugins| +shared_examples 'xpack_standard::init' do |vars| describe user('elasticsearch') do it { should exist } @@ -42,9 +42,9 @@ shared_examples 'xpack_standard::init' do |es_version,plugins| end 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') - expect(command.stdout).to match(es_version) + expect(command.stdout).to match(vars['es_version']) expect(command.exit_status).to eq(0) end end @@ -107,13 +107,15 @@ shared_examples 'xpack_standard::init' do |es_version,plugins| it { should be_owned_by 'elasticsearch' } end - for plugin in plugins + for plugin in vars['es_plugins'] + plugin = plugin['plugin'] + describe file('/usr/share/elasticsearch/plugins/'+plugin) do it { should be_directory } it { should be_owned_by 'elasticsearch' } 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 } end end diff --git a/test/integration/issue-test.yml b/test/integration/issue-test.yml index 1f7ef2a..881ba85 100644 --- a/test/integration/issue-test.yml +++ b/test/integration/issue-test.yml @@ -5,6 +5,8 @@ - name: Simple Example hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml roles: - { role: elasticsearch, @@ -46,4 +48,4 @@ - manage_index_templates logstash_system: cluster: - - manage_index_templates \ No newline at end of file + - manage_index_templates diff --git a/test/integration/issue-test/serverspec/default_spec.rb b/test/integration/issue-test/serverspec/default_spec.rb index b284d06..ee7536b 100644 --- a/test/integration/issue-test/serverspec/default_spec.rb +++ b/test/integration/issue-test/serverspec/default_spec.rb @@ -1,6 +1,8 @@ require 'issue_test_spec' +require 'json' +vars = JSON.parse(File.read('/tmp/vars.json')) describe 'Issue Test' do - include_examples 'issue_test::init', "5.5.1", [] + include_examples 'issue_test::init', vars end diff --git a/test/integration/multi.yml b/test/integration/multi.yml index 702b11f..fecbd54 100644 --- a/test/integration/multi.yml +++ b/test/integration/multi.yml @@ -2,6 +2,8 @@ #Test ability to deploy multiple instances to a machine - name: Elasticsearch Multi test - master on 9200 hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml vars: es_scripts: true es_templates: true @@ -14,6 +16,8 @@ - name: Elasticsearch Multi test - data on 9201 hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml vars: es_scripts: true es_templates: true diff --git a/test/integration/multi/serverspec/default_spec.rb b/test/integration/multi/serverspec/default_spec.rb index fcf6ee5..94bd05f 100644 --- a/test/integration/multi/serverspec/default_spec.rb +++ b/test/integration/multi/serverspec/default_spec.rb @@ -1,8 +1,9 @@ require 'multi_spec' +require 'json' +vars = JSON.parse(File.read('/tmp/vars.json')) - -describe 'Multi Tests v 5.x' do - include_examples 'multi::init', "5.5.1", ["ingest-geoip"] +describe 'Multi Tests' do + include_examples 'multi::init', vars end diff --git a/test/integration/package.yml b/test/integration/package.yml index 77168c4..41614fd 100644 --- a/test/integration/package.yml +++ b/test/integration/package.yml @@ -1,6 +1,8 @@ --- - name: Elasticsearch Package test intial hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml roles: - { role: elasticsearch, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "node1" } 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. - name: Elasticsearch Package test modify hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml roles: - { role: elasticsearch, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "node1" } vars: diff --git a/test/integration/package/serverspec/default_spec.rb b/test/integration/package/serverspec/default_spec.rb index 225541a..ee8f77b 100644 --- a/test/integration/package/serverspec/default_spec.rb +++ b/test/integration/package/serverspec/default_spec.rb @@ -1,6 +1,7 @@ require 'package_spec' +require 'json' +vars = JSON.parse(File.read('/tmp/vars.json')) - -describe 'Package Tests v 5.x' do - include_examples 'package::init', "5.5.1", ["ingest-attachment","ingest-geoip"] -end \ No newline at end of file +describe 'Package Tests' do + include_examples 'package::init', vars +end diff --git a/test/integration/standard.yml b/test/integration/standard.yml index 7d8e6cc..769f2c5 100644 --- a/test/integration/standard.yml +++ b/test/integration/standard.yml @@ -1,6 +1,8 @@ --- - name: Standard test for single node setup. Tests idempotence. hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml roles: - { role: elasticsearch, es_instance_name: "node1" } vars: @@ -9,4 +11,4 @@ es_plugins: - plugin: ingest-geoip -#Do not add tests here. This test is run twice and confirms idempotency. \ No newline at end of file +#Do not add tests here. This test is run twice and confirms idempotency. diff --git a/test/integration/standard/serverspec/default_spec.rb b/test/integration/standard/serverspec/default_spec.rb index 729b306..449a1c0 100644 --- a/test/integration/standard/serverspec/default_spec.rb +++ b/test/integration/standard/serverspec/default_spec.rb @@ -1,8 +1,9 @@ require 'standard_spec' +require 'json' +vars = JSON.parse(File.read('/tmp/vars.json')) - -describe 'Standard Tests v 5.x' do - include_examples 'standard::init', "5.5.1", ["ingest-geoip"] +describe 'Standard Tests' do + include_examples 'standard::init', vars end diff --git a/test/integration/xpack-standard.yml b/test/integration/xpack-standard.yml index b9e7fe9..62be5a6 100644 --- a/test/integration/xpack-standard.yml +++ b/test/integration/xpack-standard.yml @@ -2,6 +2,8 @@ --- - name: Elasticsearch Xpack tests - no security and manual download hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml 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" } vars: @@ -12,4 +14,4 @@ es_xpack_features: - monitoring - graph - - ml \ No newline at end of file + - ml diff --git a/test/integration/xpack-standard/serverspec/default_spec.rb b/test/integration/xpack-standard/serverspec/default_spec.rb index f9a7552..771c7c3 100644 --- a/test/integration/xpack-standard/serverspec/default_spec.rb +++ b/test/integration/xpack-standard/serverspec/default_spec.rb @@ -1,5 +1,7 @@ require 'xpack_standard_spec' +require 'json' +vars = JSON.parse(File.read('/tmp/vars.json')) -describe 'Xpack Standard Tests v 5.x' do - include_examples 'xpack_standard::init', "5.5.1", [] +describe 'Xpack Standard Tests' do + include_examples 'xpack_standard::init', vars end diff --git a/test/integration/xpack.yml b/test/integration/xpack.yml index 3e53349..cd49ef8 100644 --- a/test/integration/xpack.yml +++ b/test/integration/xpack.yml @@ -1,6 +1,8 @@ --- - name: Elasticsearch Xpack tests initial hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml roles: - { 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 }, @@ -8,7 +10,8 @@ vars: es_heap_size: "1g" es_templates: true - es_version: "5.4.0" + es_major_version: "5.x" + es_version: "5.5.1" es_enable_xpack: true es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}" es_plugins: @@ -101,6 +104,8 @@ #modifies the installation. Changes es_admin password and upgrades ES. Tests confirm the correct version is installed. - name: Elasticsearch Xpack modify hosts: localhost + tasks: + - include: elasticsearch/test/integration/debug.yml roles: - { 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 }, @@ -108,7 +113,8 @@ vars: es_heap_size: "1g" es_templates: true - es_version: "5.5.1" + es_major_version: "6.x" + es_version: "6.1.2" es_enable_xpack: true es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}" es_plugins: @@ -143,4 +149,4 @@ password: changeMeAlso! roles: - power_user - - user \ No newline at end of file + - user diff --git a/test/integration/xpack/serverspec/default_spec.rb b/test/integration/xpack/serverspec/default_spec.rb index ab0946b..8a3791a 100644 --- a/test/integration/xpack/serverspec/default_spec.rb +++ b/test/integration/xpack/serverspec/default_spec.rb @@ -1,5 +1,7 @@ require 'xpack_spec' +require 'json' +vars = JSON.parse(File.read('/tmp/vars.json')) -describe 'Xpack Tests v 5.x' do - include_examples 'xpack::init', "5.5.1", ["ingest-attachment"] +describe 'Xpack Tests' do + include_examples 'xpack::init', vars end