diff --git a/test/integration/config/serverspec/default_spec.rb b/test/integration/config/serverspec/default_spec.rb index 4d42eeb..56f064a 100644 --- a/test/integration/config/serverspec/default_spec.rb +++ b/test/integration/config/serverspec/default_spec.rb @@ -61,17 +61,23 @@ context "basic tests" do end #test we started on the correct port was used - describe command('curl "localhost:9201" | grep status') do + describe command('curl -s "localhost:9201" | grep status') do #TODO: This is returning an empty string #its(:stdout) { should match /\"status\" : 200/ } its(:exit_status) { should eq 0 } end #test to make sure mlock was applied - describe command('curl "localhost:9201/_nodes/process?pretty" | grep mlockall') do - its(:stdout) { should match /\"mlockall\" : true/ } + describe command('curl -s "localhost:9201/_nodes/process?pretty" | grep mlockall') do + its(:stdout) { should match /true/ } its(:exit_status) { should eq 0 } end + describe file('/usr/lib/systemd/system/node1_elasticsearch.service') do + it { should be_file } + it { should contain 'LimitMEMLOCK=infinity' } + it { should contain 'EnvironmentFile=-/etc/sysconfig/node1_elasticsearch' } + end + end diff --git a/test/integration/multi/serverspec/default_spec.rb b/test/integration/multi/serverspec/default_spec.rb index 93b03aa..ca93b42 100644 --- a/test/integration/multi/serverspec/default_spec.rb +++ b/test/integration/multi/serverspec/default_spec.rb @@ -18,16 +18,9 @@ context "basic tests" do it { should be_installed } end - describe file('/etc/elasticsearch/node1/elasticsearch.yml') do - it { should be_file } - end - - describe file('/etc/elasticsearch/master/elasticsearch.yml') do - it { should be_file } - end - #test configuration parameters have been set - test all appropriately set in config file describe file('/etc/elasticsearch/node1/elasticsearch.yml') do + it { should be_file } it { should contain 'http.port: 9201' } it { should contain 'transport.tcp.port: 9301' } it { should contain 'node.data: true' } @@ -44,6 +37,7 @@ context "basic tests" do #test configuration parameters have been set for master - test all appropriately set in config file describe file('/etc/elasticsearch/master/elasticsearch.yml') do + it { should be_file } it { should contain 'http.port: 9200' } it { should contain 'transport.tcp.port: 9300' } it { should contain 'node.data: false' } @@ -150,15 +144,30 @@ context "basic tests" do end #test to make sure mlock was applied - describe command('curl "localhost:9200/_nodes/localhost-master/process?pretty" | grep mlockall') do + describe command('curl -s "localhost:9200/_nodes/localhost-master/process?pretty=true" | grep mlockall') do its(:stdout) { should match /true/ } its(:exit_status) { should eq 0 } end #test to make sure mlock was not applied - describe command('curl "localhost:9201/_nodes/localhost-node1/process?pretty" | grep mlockall') do + describe command('curl -s "localhost:9201/_nodes/localhost-node1/process?pretty=true" | grep mlockall') do its(:stdout) { should match /false/ } its(:exit_status) { should eq 0 } end + + + #Test server spec file has been created and modified + describe file('/usr/lib/systemd/system/master_elasticsearch.service') do + it { should be_file } + it { should contain 'LimitMEMLOCK=infinity' } + it { should contain 'EnvironmentFile=-/etc/sysconfig/master_elasticsearch' } + end + + describe file('/usr/lib/systemd/system/node1_elasticsearch.service') do + it { should be_file } + it { should_not contain 'LimitMEMLOCK=infinity' } + it { should contain 'EnvironmentFile=-/etc/sysconfig/node1_elasticsearch' } + end + end diff --git a/test/integration/package/serverspec/default_spec.rb b/test/integration/package/serverspec/default_spec.rb index 4751760..29bc14b 100644 --- a/test/integration/package/serverspec/default_spec.rb +++ b/test/integration/package/serverspec/default_spec.rb @@ -46,7 +46,7 @@ context "basic tests" do describe 'Template Installed' do it 'should be reported as being installed', :retry => 3, :retry_wait => 10 do - command = command('curl localhost:9200/_template/basic') + command = command('curl -s "localhost:9200/_template/basic"') expect(command.stdout).to match(/basic/) expect(command.exit_status).to eq(0) end diff --git a/test/integration/standard/serverspec/default_spec.rb b/test/integration/standard/serverspec/default_spec.rb index 78c7823..9e3a51b 100644 --- a/test/integration/standard/serverspec/default_spec.rb +++ b/test/integration/standard/serverspec/default_spec.rb @@ -41,7 +41,7 @@ context "basic tests" do describe 'plugin' do it 'should be reported as existing', :retry => 3, :retry_wait => 10 do - command = command('curl localhost:9200/_nodes/?plugin | grep kopf') + command = command('curl -s localhost:9200/_nodes/?plugin | grep kopf') expect(command.stdout).to match(/kopf/) expect(command.exit_status).to eq(0) end