-
-
Notifications
You must be signed in to change notification settings - Fork 236
/
postfix_exporter_spec.rb
40 lines (33 loc) · 1021 Bytes
/
postfix_exporter_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true
require 'spec_helper_acceptance'
describe 'prometheus postfix exporter' do
describe 'install postfix' do
before do
shell('puppet module install puppet/postfix')
end
it do
pp = 'include postfix'
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
end
context 'default version' do
it 'postfix_exporter works idempotently with no errors' do
pp = 'include prometheus::postfix_exporter'
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
describe service('postfix_exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
describe port(9154) do
it { is_expected.to be_listening.with('tcp6') }
end
it 'provides postfix metrics' do
shell('curl -s http://127.0.0.1:9154/metrics') do |r|
expect(r.stdout).to match(%r{postfix_smtpd_connects_total})
end
end
end
end