Skip to content

Commit

Permalink
add acceptance test for update from 0.7.1 to 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dynek committed Jan 3, 2019
1 parent ce551e9 commit 14cd466
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions spec/acceptance/haproxy_exporter_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
require 'spec_helper_acceptance'

describe 'prometheus haproxy_exporter' do
it 'haproxy_exporter works idempotently with no errors' do
if default[:platform] =~ %r{ubuntu-18.04-amd64}
pp = "package{'iproute2': ensure => present}"
apply_manifest(pp, catch_failures: true)
end
pp = 'include prometheus::haproxy_exporter'
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe service('haproxy_exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe port(9101) do
it { is_expected.to be_listening.with('tcp6') }
end

describe 'haproxy_exporter update from 0.7.1 to 0.9.0' do
it 'is idempotent' do
pp = "class{'prometheus::haproxy_exporter': version => '0.7.1'}"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe service('haproxy_exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe port(9101) do
it { is_expected.to be_listening.with('tcp6') }
end
it 'is idempotent' do
pp = "class{'prometheus::haproxy_exporter': version => '0.9.0'}"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe service('haproxy_exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe port(9101) do
it { is_expected.to be_listening.with('tcp6') }
end
end
end

0 comments on commit 14cd466

Please sign in to comment.