/
configure_spec.rb
69 lines (60 loc) · 1.64 KB
/
configure_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
require_relative 'spec_helper'
# normal elasticsearch config with defaults
[
'/usr/local/etc/elasticsearch',
'/usr/local/var/data/elasticsearch',
'/usr/local/var/log/elasticsearch',
].each do |p|
describe file(p) do
it { should be_directory }
it { should be_mode 755 }
it { should be_owned_by 'elasticsearch' }
it { should be_grouped_into 'elasticsearch' }
end
end
describe file('/usr/local/etc/elasticsearch/elasticsearch.in.sh') do
it { should be_file }
it { should be_owned_by 'elasticsearch' }
it { should be_grouped_into 'elasticsearch' }
[
'ES_HOME=.+',
'ES_CLASSPATH=.+',
'ES_HEAP_SIZE=[0-9]+m',
'ES_JAVA_OPTS=',
'-server',
'-Djava.net.preferIPv4Stack=true',
'-Des.config=\/.+',
'-Xss256k',
'UseParNewGC',
'UseConcMarkSweepGC',
'CMSInitiatingOccupancyFraction=75',
'UseCMSInitiatingOccupancyOnly',
'HeapDumpOnOutOfMemoryError'
].each do |line|
its(:content) { should contain(/#{line}/) }
end
end
describe file('/usr/local/etc/elasticsearch/elasticsearch.yml') do
it { should be_file }
it { should be_owned_by 'elasticsearch' }
it { should be_grouped_into 'elasticsearch' }
[
'cluster.name: elasticsearch',
'node.name: .+',
'path.conf: \/.+',
'path.data: \/.+',
'path.logs: \/.+',
].each do |line|
its(:content) { should contain(/#{line}/) }
end
end
describe file('/usr/local/etc/elasticsearch/logging.yml') do
it { should be_file }
it { should be_owned_by 'elasticsearch' }
it { should be_grouped_into 'elasticsearch' }
[
'Configuration set by Chef'
].each do |line|
its(:content) { should match(/#{line}/)}
end
end