-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update tests with http calls; fixes #9
- Loading branch information
Showing
6 changed files
with
48 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
shared_examples 'elasticsearch' do | ||
describe command('sv status elasticsearch') do | ||
its(:stdout) { should match 'run: elasticsearch' } | ||
its(:stdout) { should contain 'run: elasticsearch' } | ||
end | ||
|
||
# TODO: unreliable | ||
# describe command('curl http://localhost:9200/') do | ||
# its(:stdout) { should match '"status" : 200,' } | ||
# end | ||
# describe command('curl http://localhost:9200/_cat/health') do | ||
# its(:stdout) { should match 'elasticsearch' } # node name | ||
# end | ||
describe command('curl http://localhost:9200/') do | ||
its(:stdout) { should contain '"status" : 200,' } | ||
end | ||
describe command('curl -s http://localhost:9200/_cluster/state|jq .cluster_name') do | ||
its(:stdout) { should contain 'elasticsearch' } # node name | ||
end | ||
|
||
describe file('/etc/service/elasticsearch/env/ES_USER') do | ||
it { should be_file } | ||
its(:content) { should match 'elasticsearch' } | ||
its(:content) { should contain 'elasticsearch' } | ||
end | ||
|
||
describe file('/opt/elasticsearch/elasticsearch-1.7.1/config/elasticsearch.yml') do | ||
it { should be_file } | ||
its(:content) { should match '# This file was generated by Chef' } | ||
its(:content) { should contain '# This file was generated by Chef' } | ||
end | ||
|
||
describe file('/opt/elasticsearch/elasticsearch-1.7.1/config/logging.yml') do | ||
it { should be_file } | ||
its(:content) { should match '# This file was generated by Chef' } | ||
its(:content) { should contain '# This file was generated by Chef' } | ||
end | ||
|
||
describe file('/var/log/elasticsearch/current') do | ||
it { should be_file } | ||
its(:content) { should contain 'bound_address' } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
shared_examples 'kibana' do | ||
describe command('sv status kibana') do | ||
its(:stdout) { should match 'run: kibana' } | ||
its(:stdout) { should contain 'run: kibana' } | ||
end | ||
describe file('/opt/kibana/kibana-4.1.1/config/kibana.yml') do | ||
it { should be_file } | ||
its(:content) { should match '# This file was generated by Chef' } | ||
its(:content) { should contain '# This file was generated by Chef' } | ||
end | ||
describe command('curl http://localhost:8080') do | ||
its(:stdout) { should contain 'Kibana 4' } | ||
end | ||
describe file('/var/log/kibana/current') do | ||
it { should be_file } | ||
its(:content) { should contain 'Listening on 0.0.0.0:8080' } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
shared_examples 'logstash' do | ||
describe command('sv status logstash') do | ||
its(:stdout) { should match 'run: logstash' } | ||
its(:stdout) { should contain 'run: logstash' } | ||
end | ||
|
||
describe file('/etc/service/logstash/env/LS_USER') do | ||
it { should be_file } | ||
its(:content) { should match 'kibana' } # <= not a typo; testing hash merge | ||
its(:content) { should contain 'kibana' } # <= not a typo; testing hash merge | ||
end | ||
|
||
describe file('/etc/service/logstash/env/HELLO') do | ||
it { should be_file } | ||
its(:content) { should match 'WORLD' } | ||
its(:content) { should contain 'WORLD' } | ||
end | ||
|
||
describe file('/opt/logstash/logstash-1.5.3/config/logging.yml') do | ||
it { should be_file } | ||
its(:content) { should match '# This file was generated by ELKTEST' } | ||
its(:content) { should contain '# This file was generated by ELKTEST' } | ||
end | ||
|
||
describe file('/opt/logstash/logstash-1.5.3/config/logstash.conf') do | ||
it { should be_file } | ||
its(:content) { should match '# This file was generated by merged hash from a recipe!' } | ||
its(:content) { should contain '# This file was generated by merged hash from a recipe!' } | ||
end | ||
|
||
describe file('/var/log/logstash/current') do | ||
it { should be_file } | ||
its(:content) { should contain 'detected_master' } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
shared_examples 'logstash_forwarder' do | ||
describe command('sv status logstash-forwarder') do | ||
its(:stdout) { should match 'run: logstash-forwarder' } | ||
its(:stdout) { should contain 'run: logstash-forwarder' } | ||
end | ||
|
||
describe file('/opt/logstash-forwarder/logstash-forwarder-0.4.0/logstash-forwarder.conf') do | ||
it { should be_file } | ||
its(:content) { should match '# This file was generated by Chef' } | ||
its(:content) { should contain '# This file was generated by Chef' } | ||
end | ||
|
||
describe file('/var/log/logstash-forwarder/current') do | ||
it { should be_file } | ||
its(:content) { should contain 'Connected to' } | ||
its(:content) { should contain 'Registrar: processing' } | ||
its(:content) { should contain 'Launching harvester on new file:' } | ||
end | ||
end | ||
|