WIP: 6.3 support
This commit is contained in:
parent
a9f8403ffa
commit
6d82cf3142
17 changed files with 82 additions and 70 deletions
|
|
@ -18,7 +18,7 @@ shared_examples 'config::init' do |vars|
|
|||
it { should be_running }
|
||||
end
|
||||
|
||||
describe package('elasticsearch') do
|
||||
describe package(vars['es_package_name']) do
|
||||
it { should be_installed }
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ shared_examples 'multi::init' do |vars|
|
|||
it { should be_running }
|
||||
end
|
||||
|
||||
describe package('elasticsearch') do
|
||||
describe package(vars['es_package_name']) do
|
||||
it { should be_installed }
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ shared_examples 'package::init' do |vars|
|
|||
it { should be_running }
|
||||
end
|
||||
|
||||
describe package('elasticsearch') do
|
||||
describe package(vars['es_package_name']) do
|
||||
it { should be_installed }
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ shared_examples 'standard::init' do |vars|
|
|||
it { should be_running }
|
||||
end
|
||||
|
||||
describe package('elasticsearch') do
|
||||
describe package(vars['es_package_name']) do
|
||||
it { should be_installed }
|
||||
end
|
||||
|
||||
|
|
@ -85,15 +85,22 @@ shared_examples 'standard::init' do |vars|
|
|||
end
|
||||
|
||||
for plugin in vars['es_plugins']
|
||||
plugin = plugin['plugin']
|
||||
name = plugin['plugin']
|
||||
|
||||
describe file('/usr/share/elasticsearch/plugins/'+plugin) do
|
||||
describe file('/usr/share/elasticsearch/plugins/'+name) 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":"'+vars['es_version']+'"\'') do
|
||||
its(:exit_status) { should eq 0 }
|
||||
it 'should be installed and the right version' do
|
||||
plugins = curl_json('http://localhost:9200/_nodes/plugins')
|
||||
version = nil
|
||||
node, data = plugins['nodes'].first
|
||||
data['plugins'].each do |plugin|
|
||||
if plugin['name'] == name
|
||||
version = plugin['version']
|
||||
end
|
||||
end
|
||||
expect(version).to eql(vars['es_version'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ shared_examples 'xpack::init' do |vars|
|
|||
it { should be_running }
|
||||
end
|
||||
|
||||
describe package('elasticsearch') do
|
||||
describe package(vars['es_package_name']) do
|
||||
it { should be_installed }
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ shared_examples 'xpack_standard::init' do |vars|
|
|||
it { should be_running }
|
||||
end
|
||||
|
||||
describe package('elasticsearch') do
|
||||
describe package(vars['es_package_name']) do
|
||||
it { should be_installed }
|
||||
end
|
||||
|
||||
|
|
@ -96,60 +96,48 @@ shared_examples 'xpack_standard::init' do |vars|
|
|||
end
|
||||
end
|
||||
|
||||
describe file('/usr/share/elasticsearch/plugins/x-pack') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
# X-Pack is no longer installed as a plugin in elasticsearch
|
||||
if vars['es_major_version'] == '5.x'
|
||||
describe file('/usr/share/elasticsearch/plugins/x-pack') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe 'x-pack-core plugin' do
|
||||
it 'should be installed with the correct version' do
|
||||
plugins = curl_json('http://localhost:9200/_nodes/plugins')
|
||||
node, data = plugins['nodes'].first
|
||||
version = 'plugin not found'
|
||||
name = 'x-pack'
|
||||
|
||||
data['plugins'].each do |plugin|
|
||||
if plugin['name'] == name
|
||||
version = plugin['version']
|
||||
end
|
||||
end
|
||||
expect(version).to eql(vars['es_version'])
|
||||
end
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/security_node/x-pack') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
#Test users file, users_roles and roles.yml
|
||||
describe file('/etc/elasticsearch/security_node/x-pack/users_roles') do
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/security_node/x-pack/users') do
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
end
|
||||
|
||||
describe command('curl -s localhost:9200/_nodes/plugins?pretty=true -u es_admin:changeMeAgain | grep x-pack') do
|
||||
its(:exit_status) { should eq 0 }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/security_node/x-pack') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe file('/usr/share/elasticsearch/plugins/x-pack') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe file('/usr/share/elasticsearch/plugins/x-pack') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe 'x-pack-core plugin' do
|
||||
it 'should be installed with the correct version' do
|
||||
plugins = curl_json('http://localhost:9200/_nodes/plugins')
|
||||
node, data = plugins['nodes'].first
|
||||
version = 'plugin not found'
|
||||
|
||||
if Gem::Version.new(vars['es_version']) >= Gem::Version.new('6.2')
|
||||
name = 'x-pack-core'
|
||||
else
|
||||
name = 'x-pack'
|
||||
end
|
||||
|
||||
data['plugins'].each do |plugin|
|
||||
if plugin['name'] == name
|
||||
version = plugin['version']
|
||||
end
|
||||
end
|
||||
expect(version).to eql(vars['es_version'])
|
||||
end
|
||||
end
|
||||
|
||||
#Test users file, users_roles and roles.yml
|
||||
describe file('/etc/elasticsearch/security_node/x-pack/users_roles') do
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/security_node/x-pack/users') do
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe command('curl -s localhost:9200/_xpack') do
|
||||
its(:stdout_as_json) { should include('features' => include('security' => include('enabled' => false))) }
|
||||
its(:stdout_as_json) { should include('features' => include('watcher' => include('enabled' => false))) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue