Skip to content

Commit

Permalink
update testing for env vars and api checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dearing committed Jul 31, 2015
1 parent 16db016 commit ec364c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test/integration/helpers/serverspec/elasticsearch.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# sshd_service = os[:family] == 'redhat' ? 'sshd' : 'ssh'

shared_examples 'elasticsearch' do

describe command('sv status elasticsearch') do
its(:stdout) { should match 'run: elasticsearch' }
end
end

# curl -X GET http://localhost:9200/
# curl 'localhost:9200/_cat/health?v'
describe command('curl http://localhost:9200/') do
its(:stdout) { should match '"status" : 200,' }
end

describe command('curl http://localhost:9200/_cat/health?v') do
its(:stdout) { should match 'elasticsearch' }
end

describe file('/etc/service/elasticsearch/env/ES_USER') do
it { should be_file }
its(:content) { should match 'elasticsearch' }
end
end
4 changes: 4 additions & 0 deletions test/integration/helpers/serverspec/logstash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
describe command('sv status logstash') do
its(:stdout) { should match 'run: logstash' }
end
describe file('/etc/service/logstash/env/LS_USER') do
it { should be_file }
its(:content) { should match 'logstash' }
end
end

0 comments on commit ec364c1

Please sign in to comment.