Skip to content

Commit

Permalink
Add acceptance test for statsd_exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
wiebe committed Oct 25, 2018
1 parent 720c0a9 commit f06aded
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions spec/acceptance/statsd_exporter_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
require 'spec_helper_acceptance'

describe 'prometheus statsd exporter' do
it 'statsd_exporter works idempotently with no errors' do
pp = 'include prometheus::statsd_exporter'
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe 'prometheus statsd exporter version 0.5.0' do
it ' statsd_exporter installs with version 0.5.0' do
pp = "class {'prometheus::statsd_exporter': version => '0.5.0' }"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
describe process('statsd_exporter') do
its(:args) { is_expected.to match %r{\ -statsd.mapping-config} }
end
describe service('statsd_exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
describe port(9102) do
it { is_expected.to be_listening.with('tcp6') }
end
describe port(9125) do
it { is_expected.to be_listening.with('udp6') }
end
end

describe 'prometheus statsd exporter version 0.7.0' do
it ' statsd_exporter installs with version 0.7.0' do
pp = "class {'prometheus::statsd_exporter': version => '0.7.0' }"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
describe process('statsd_exporter') do
its(:args) { is_expected.to match %r{\ --statsd.mapping-config} }
end
describe service('statsd_exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
describe port(9102) do
it { is_expected.to be_listening.with('tcp6') }
end
describe port(9125) do
it { is_expected.to be_listening.with('udp6') }
end
end
end

0 comments on commit f06aded

Please sign in to comment.