forked from sensu/sensu-puppet
-
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.
Remove namespace validation for agents
Ensure entity config validator actually gets included Update unit test fixtures to use HTTPS Remove EOL OSes Update default resources to match latest Sensu Go Skip enterprise tests Add test for agent working while backend is down
- Loading branch information
Showing
17 changed files
with
80 additions
and
134 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 |
---|---|---|
@@ -1,36 +1,36 @@ | ||
fixtures: | ||
repositories: | ||
apt: | ||
repo: git://github.com/puppetlabs/puppetlabs-apt.git | ||
repo: https://github.com/puppetlabs/puppetlabs-apt.git | ||
stdlib: | ||
repo: git://github.com/puppetlabs/puppetlabs-stdlib.git | ||
repo: https://github.com/puppetlabs/puppetlabs-stdlib.git | ||
datacat: | ||
repo: git://github.com/richardc/puppet-datacat.git | ||
repo: https://github.com/richardc/puppet-datacat.git | ||
yumrepo_core: | ||
repo: git://github.com/puppetlabs/puppetlabs-yumrepo_core | ||
repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core | ||
puppet_version: ">= 6.0.0" | ||
chocolatey: | ||
repo: git://github.com/puppetlabs/puppetlabs-chocolatey.git | ||
repo: https://github.com/puppetlabs/puppetlabs-chocolatey.git | ||
# Needed by chocolatey | ||
registry: | ||
repo: git://github.com/puppetlabs/puppetlabs-registry.git | ||
repo: https://github.com/puppetlabs/puppetlabs-registry.git | ||
# Needed by chocolatey | ||
powershell: | ||
repo: git://github.com/puppetlabs/puppetlabs-powershell.git | ||
repo: https://github.com/puppetlabs/puppetlabs-powershell.git | ||
# Need by postgresql | ||
augeas_core: | ||
repo: git://github.com/puppetlabs/puppetlabs-augeas_core | ||
repo: https://github.com/puppetlabs/puppetlabs-augeas_core | ||
puppet_version: ">= 6.0.0" | ||
# Need by postgresql | ||
concat: | ||
repo: git://github.com/puppetlabs/puppetlabs-concat.git | ||
repo: https://github.com/puppetlabs/puppetlabs-concat.git | ||
postgresql: | ||
repo: git://github.com/puppetlabs/puppetlabs-postgresql.git | ||
repo: https://github.com/puppetlabs/puppetlabs-postgresql.git | ||
archive: | ||
repo: git://github.com/voxpupuli/puppet-archive.git | ||
repo: https://github.com/voxpupuli/puppet-archive.git | ||
windows_env: | ||
repo: git://github.com/voxpupuli/puppet-windows_env.git | ||
repo: https://github.com/voxpupuli/puppet-windows_env.git | ||
systemd: | ||
repo: git://github.com/camptocamp/puppet-systemd.git | ||
repo: https://github.com/camptocamp/puppet-systemd.git | ||
symlinks: | ||
sensu: "#{source_dir}" |
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 |
---|---|---|
@@ -1,49 +1,49 @@ | ||
fixtures: | ||
repositories: | ||
apt: | ||
repo: git://github.com/puppetlabs/puppetlabs-apt.git | ||
repo: https://github.com/puppetlabs/puppetlabs-apt.git | ||
ref: 5.0.1 | ||
stdlib: | ||
repo: git://github.com/puppetlabs/puppetlabs-stdlib.git | ||
repo: https://github.com/puppetlabs/puppetlabs-stdlib.git | ||
ref: 5.1.0 | ||
datacat: | ||
repo: git://github.com/richardc/puppet-datacat.git | ||
repo: https://github.com/richardc/puppet-datacat.git | ||
ref: 0.6.2 | ||
yumrepo_core: | ||
repo: git://github.com/puppetlabs/puppetlabs-yumrepo_core | ||
repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core | ||
ref: 1.0.1 | ||
puppet_version: ">= 6.0.0" | ||
chocolatey: | ||
repo: git://github.com/puppetlabs/puppetlabs-chocolatey.git | ||
repo: https://github.com/puppetlabs/puppetlabs-chocolatey.git | ||
ref: 3.0.0 | ||
# Needed by chocolatey | ||
registry: | ||
repo: git://github.com/puppetlabs/puppetlabs-registry.git | ||
repo: https://github.com/puppetlabs/puppetlabs-registry.git | ||
ref: 1.0.0 | ||
# Needed by chocolatey | ||
powershell: | ||
repo: git://github.com/puppetlabs/puppetlabs-powershell.git | ||
repo: https://github.com/puppetlabs/puppetlabs-powershell.git | ||
ref: 1.0.1 | ||
# Need by postgresql | ||
augeas_core: | ||
repo: git://github.com/puppetlabs/puppetlabs-augeas_core | ||
repo: https://github.com/puppetlabs/puppetlabs-augeas_core | ||
ref: 1.0.4 | ||
puppet_version: ">= 6.0.0" | ||
# Need by postgresql | ||
concat: | ||
repo: git://github.com/puppetlabs/puppetlabs-concat.git | ||
repo: https://github.com/puppetlabs/puppetlabs-concat.git | ||
ref: v6.0.0 | ||
postgresql: | ||
repo: git://github.com/puppetlabs/puppetlabs-postgresql.git | ||
repo: https://github.com/puppetlabs/puppetlabs-postgresql.git | ||
ref: v6.4.0 | ||
archive: | ||
repo: git://github.com/voxpupuli/puppet-archive.git | ||
repo: https://github.com/voxpupuli/puppet-archive.git | ||
ref: 'v3.0.0' | ||
windows_env: | ||
repo: git://github.com/voxpupuli/puppet-windows_env.git | ||
repo: https://github.com/voxpupuli/puppet-windows_env.git | ||
ref: 'v3.0.0' | ||
systemd: | ||
repo: git://github.com/camptocamp/puppet-systemd.git | ||
repo: https://github.com/camptocamp/puppet-systemd.git | ||
ref: '2.0.0' | ||
symlinks: | ||
sensu: "#{source_dir}" |
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
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
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 |
---|---|---|
|
@@ -374,4 +374,47 @@ class { 'sensu::agent': | |
end | ||
end | ||
end | ||
|
||
context 'when backend is down' do | ||
it 'should work with errors' do | ||
pp = <<-EOS | ||
class { '::sensu': } | ||
class { 'sensu::agent': | ||
backends => ['sensu-backend:8081'], | ||
entity_name => 'sensu-agent', | ||
subscriptions => ['base'], | ||
labels => { 'foo' => 'bar' }, | ||
annotations => { 'contacts' => '[email protected]' }, | ||
service_env_vars => { 'SENSU_API_PORT' => '4041' }, | ||
config_hash => { | ||
'log-level' => 'info', | ||
'keepalive-interval' => 30, | ||
} | ||
} | ||
sensu::agent::subscription { 'linux': } | ||
sensu::agent::label { 'cpu.warning': value => '90' } | ||
sensu::agent::label { 'cpu.critical': value => '95' } | ||
sensu::agent::label { 'bar': value => 'baz2', redact => true } | ||
sensu::agent::annotation { 'foobar': value => 'bar' } | ||
sensu::agent::annotation { 'cpu.message': value => 'bar' } | ||
sensu::agent::config_entry { 'keepalive-interval': value => 20 } | ||
file { '/tmp/test': ensure => 'file' } | ||
EOS | ||
|
||
on backend, 'puppet resource service sensu-backend ensure=stopped' | ||
if RSpec.configuration.sensu_use_agent | ||
site_pp = "node 'sensu-agent' { #{pp} }" | ||
puppetserver = hosts_as('puppetserver')[0] | ||
create_remote_file(puppetserver, "/etc/puppetlabs/code/environments/production/manifests/site.pp", site_pp) | ||
on node, puppet("agent -t --detailed-exitcodes"), acceptable_exit_codes: [1,4,6] | ||
else | ||
apply_manifest_on(node, pp, :catch_failures => false) | ||
end | ||
on backend, 'puppet resource service sensu-backend ensure=running' | ||
end | ||
|
||
describe file('/tmp/test'), :node => node do | ||
it { is_expected.to be_file } | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.