From 043c1bff69916ec47c4d221f81acc3c67ba7f99d Mon Sep 17 00:00:00 2001 From: Michael Russell Date: Wed, 31 Jan 2018 08:17:44 +0100 Subject: [PATCH] 6.x should not have path.conf present --- test/integration/helpers/serverspec/config_spec.rb | 6 +++++- test/integration/helpers/serverspec/multi_spec.rb | 12 ++++++++++-- test/integration/helpers/serverspec/xpack_spec.rb | 6 +++++- .../helpers/serverspec/xpack_standard_spec.rb | 6 +++++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/test/integration/helpers/serverspec/config_spec.rb b/test/integration/helpers/serverspec/config_spec.rb index 761cbd4..148ade0 100644 --- a/test/integration/helpers/serverspec/config_spec.rb +++ b/test/integration/helpers/serverspec/config_spec.rb @@ -36,7 +36,11 @@ shared_examples 'config::init' do |vars| it { should contain 'node.name: node1' } it { should contain 'bootstrap.memory_lock: true' } it { should contain 'discovery.zen.ping.unicast.hosts: localhost:9501' } - 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: /opt/elasticsearch/data-1/localhost-node1,/opt/elasticsearch/data-2/localhost-node1' } it { should contain 'path.logs: /opt/elasticsearch/logs/localhost-node1' } end diff --git a/test/integration/helpers/serverspec/multi_spec.rb b/test/integration/helpers/serverspec/multi_spec.rb index fcb3b6b..20b3aa8 100644 --- a/test/integration/helpers/serverspec/multi_spec.rb +++ b/test/integration/helpers/serverspec/multi_spec.rb @@ -29,7 +29,11 @@ shared_examples 'multi::init' do |vars| it { should contain 'node.master: false' } it { should contain 'node.name: localhost-node1' } it { should_not contain 'bootstrap.memory_lock: true' } - 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: /opt/elasticsearch/data-1/localhost-node1,/opt/elasticsearch/data-2/localhost-node1' } it { should contain 'path.logs: /var/log/elasticsearch/localhost-node1' } end @@ -44,7 +48,11 @@ shared_examples 'multi::init' do |vars| it { should contain 'node.master: true' } it { should contain 'node.name: localhost-master' } it { should contain 'bootstrap.memory_lock: true' } - it { should contain 'path.conf: /etc/elasticsearch/master' } + 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: /opt/elasticsearch/master/localhost-master' } it { should contain 'path.logs: /var/log/elasticsearch/localhost-master' } end diff --git a/test/integration/helpers/serverspec/xpack_spec.rb b/test/integration/helpers/serverspec/xpack_spec.rb index c38843e..abe4203 100644 --- a/test/integration/helpers/serverspec/xpack_spec.rb +++ b/test/integration/helpers/serverspec/xpack_spec.rb @@ -29,7 +29,11 @@ shared_examples 'xpack::init' do |vars| describe file('/etc/elasticsearch/security_node/elasticsearch.yml') do it { should contain 'node.name: localhost-security_node' } it { should contain 'cluster.name: elasticsearch' } - it { should contain 'path.conf: /etc/elasticsearch/security_node' } + 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-security_node' } it { should contain 'path.logs: /var/log/elasticsearch/localhost-security_node' } end diff --git a/test/integration/helpers/serverspec/xpack_standard_spec.rb b/test/integration/helpers/serverspec/xpack_standard_spec.rb index fa5de1c..4f636f8 100644 --- a/test/integration/helpers/serverspec/xpack_standard_spec.rb +++ b/test/integration/helpers/serverspec/xpack_standard_spec.rb @@ -27,7 +27,11 @@ shared_examples 'xpack_standard::init' do |vars| describe file('/etc/elasticsearch/security_node/elasticsearch.yml') do it { should contain 'node.name: localhost-security_node' } it { should contain 'cluster.name: elasticsearch' } - it { should contain 'path.conf: /etc/elasticsearch/security_node' } + 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-security_node' } it { should contain 'path.logs: /var/log/elasticsearch/localhost-security_node' } it { should contain 'xpack.security.enabled: false' }