-
-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
write_http expected to be own package on CentOS 8
As of CentOS 8 the write_http is in its own subpackage so must be installed on CentOS 8.
- Loading branch information
1 parent
d4d70dd
commit 4c35c1c
Showing
6 changed files
with
108 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'collectd::plugin::disk class' do | ||
context 'basic parameters' do | ||
# Using puppet_apply as a helper | ||
it 'works idempotently with no errors' do | ||
pp = <<-EOS | ||
class{'collectd': | ||
utils => true, | ||
} | ||
class{'collectd::plugin::disk': } | ||
# Add one write plugin to keep logs quiet | ||
class{'collectd::plugin::csv':} | ||
# Create a socket to query | ||
class{'collectd::plugin::unixsock': | ||
socketfile => '/var/run/collectd-sock', | ||
socketgroup => 'root', | ||
} | ||
EOS | ||
# Run 3 times since the collectd_version | ||
# fact is impossible until collectd is | ||
# installed. | ||
apply_manifest(pp, catch_failures: false) | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
# Wait to get some data | ||
shell('sleep 10') | ||
end | ||
|
||
describe service('collectd') do | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe command('collectdctl -s /var/run/collectd-sock listval') do | ||
its(:exit_status) { is_expected.to eq 0 } | ||
# the reason debian does not report disk metrics on docker images despite the | ||
# module being loaded is an exercise for the reader. | ||
# For CentOS 7 it works on my laptop but not in travis. | ||
# disk plugin is probably very sensitive to environment. | ||
if fact('os.family') == 'Redhat' && fact('os.release.major') == '8' | ||
its(:stdout) { is_expected.to match %r{disk_time} } | ||
end | ||
end | ||
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'collectd::plugin::write_http class' do | ||
context 'basic parameters' do | ||
# Using puppet_apply as a helper | ||
it 'works idempotently with no errors' do | ||
pp = <<-EOS | ||
class{'collectd':} | ||
class { 'collectd::plugin::write_http': | ||
nodes => { | ||
'collect1' => { 'url' => 'collect1.example.org', 'format' => 'JSON' }, | ||
'collect2' => { 'url' => 'collect2.example.org'}, | ||
} | ||
} | ||
EOS | ||
# Run 3 times since the collectd_version | ||
# fact is impossible until collectd is | ||
# installed. | ||
apply_manifest(pp, catch_failures: false) | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
# Wait to get some data | ||
shell('sleep 10') | ||
end | ||
|
||
describe service('collectd') do | ||
it { is_expected.to be_running } | ||
end | ||
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
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