forked from voxpupuli/puppet-prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add acceptance test for update from 0.7.1 to 0.9.0
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 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
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 |