|
57 | 57 | it { should_not exist }
|
58 | 58 | end
|
59 | 59 |
|
60 |
| - describe file('/etc/default/elasticsearch') do |
61 |
| - it { should_not exist } |
| 60 | + if ['debian', 'ubuntu'].include?(os[:family]) |
| 61 | + describe file('/etc/default/elasticsearch') do |
| 62 | + its(:content) { should match '' } |
| 63 | + end |
62 | 64 | end
|
63 | 65 |
|
64 |
| - describe file('/etc/sysconfig/elasticsearch') do |
65 |
| - it { should_not exist } |
| 66 | + if ['centos', 'redhat'].include?(os[:family]) |
| 67 | + describe file('/etc/sysconfig/elasticsearch') do |
| 68 | + its(:content) { should match '' } |
| 69 | + end |
66 | 70 | end
|
67 | 71 |
|
68 | 72 | describe file('/usr/lib/systemd/system/elasticsearch.service') do
|
|
116 | 120 | it { should be_owned_by 'elasticsearch' }
|
117 | 121 | end
|
118 | 122 |
|
119 |
| - describe command('curl -s localhost:9200/_nodes/plugins | grep \'"name":"x-pack","version":"'+vars['es_version']+'"\'') do |
120 |
| - its(:exit_status) { should eq 0 } |
| 123 | + describe 'x-pack-core plugin' do |
| 124 | + it 'should be installed with the correct version' do |
| 125 | + plugins = curl_json('http://localhost:9200/_nodes/plugins') |
| 126 | + node, data = plugins['nodes'].first |
| 127 | + version = 'plugin not found' |
| 128 | + |
| 129 | + if Gem::Version.new(vars['es_version']) >= Gem::Version.new('6.2') |
| 130 | + name = 'x-pack-core' |
| 131 | + else |
| 132 | + name = 'x-pack' |
| 133 | + end |
| 134 | + |
| 135 | + data['plugins'].each do |plugin| |
| 136 | + if plugin['name'] == name |
| 137 | + version = plugin['version'] |
| 138 | + end |
| 139 | + end |
| 140 | + expect(version).to eql(vars['es_version']) |
| 141 | + end |
121 | 142 | end
|
122 | 143 |
|
123 | 144 | #Test users file, users_roles and roles.yml
|
|
0 commit comments