forked from fsalum/puppet-newrelic
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Craig Watson
committed
Aug 29, 2018
1 parent
b653bbf
commit 7ae3c58
Showing
8 changed files
with
107 additions
and
119 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,37 +1,34 @@ | ||
require 'spec_helper' | ||
|
||
describe 'newrelic::infra', :type => :class do | ||
|
||
describe 'newrelic::infra', 'type' => 'class' do | ||
let(:facts) do | ||
{ | ||
'os' => { | ||
'family' => 'RedHat', | ||
'name' => 'CentOS', | ||
'release' => { | ||
'major' => '7' | ||
} | ||
{ | ||
'os' => { | ||
'family' => 'RedHat', | ||
'name' => 'CentOS', | ||
'release' => { | ||
'major' => '7', | ||
}, | ||
}, | ||
} | ||
} | ||
end | ||
|
||
|
||
let(:params) do | ||
{ | ||
:license_key => '1234567890qwerty', | ||
} | ||
{ | ||
'license_key' => '1234567890qwerty', | ||
} | ||
end | ||
|
||
|
||
it { is_expected.to compile } | ||
it { should contain_package('newrelic-infra') } | ||
it { should contain_service('newrelic-infra').that_requires('Package[newrelic-infra]') } | ||
it { should contain_file('/etc/newrelic-infra.yml').with_content("license_key: 1234567890qwerty\n") } | ||
it { is_expected.to contain_package('newrelic-infra') } | ||
it { is_expected.to contain_service('newrelic-infra').that_requires('Package[newrelic-infra]') } | ||
it { is_expected.to contain_file('/etc/newrelic-infra.yml').with_content("license_key: 1234567890qwerty\n") } | ||
|
||
context 'with manage_repo => true' do | ||
let(:params)do | ||
super().merge({ 'manage_repo' => true }) | ||
let(:params) do | ||
super().merge('manage_repo' => true) | ||
end | ||
|
||
it { should contain_class('newrelic::repo::infra') } | ||
it { is_expected.to contain_class('newrelic::repo::infra') } | ||
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 |
---|---|---|
@@ -1,31 +1,31 @@ | ||
require 'spec_helper' | ||
|
||
describe 'newrelic::agent::java', :type => :class do | ||
let(:facts) do | ||
describe 'newrelic::agent::java', type: :class do | ||
let(:facts) do | ||
{ | ||
'os' => { | ||
'family' => 'RedHat', | ||
'name' => 'CentOS', | ||
'release' => { | ||
'major' => '7' | ||
} | ||
'major' => '7', | ||
}, | ||
}, | ||
'operatingsystem' => 'Centos', | ||
'path' => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/root/.local/bin:/root/bin' | ||
} | ||
'path' => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/root/.local/bin:/root/bin', | ||
} | ||
end | ||
|
||
let(:params) do | ||
{ | ||
:license_key => '1234567890qwerty', | ||
:manage_config => true | ||
license_key: '1234567890qwerty', | ||
manage_config: true, | ||
} | ||
end | ||
|
||
it { is_expected.to compile } | ||
it { should contain_package('unzip') } | ||
it { should contain_exec('wget-newrelic-java-agent')} | ||
it { should contain_exec('chown-newrelic-install-dir')} | ||
it { should contain_exec('unzip-newrelic-java-agent-zip')} | ||
it { should contain_file('/opt/newrelic/newrelic.yml')} | ||
it { is_expected.to contain_package('unzip') } | ||
it { is_expected.to contain_exec('wget-newrelic-java-agent') } | ||
it { is_expected.to contain_exec('chown-newrelic-install-dir') } | ||
it { is_expected.to contain_exec('unzip-newrelic-java-agent-zip') } | ||
it { is_expected.to contain_file('/opt/newrelic/newrelic.yml') } | ||
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 |
---|---|---|
@@ -1,42 +1,42 @@ | ||
require 'spec_helper' | ||
|
||
describe 'newrelic::agent::php', :type => :class do | ||
let(:facts) do | ||
describe 'newrelic::agent::php', type: :class do | ||
let(:facts) do | ||
{ | ||
'os' => { | ||
'family' => 'RedHat', | ||
'name' => 'CentOS', | ||
'release' => { | ||
'major' => '7' | ||
} | ||
'major' => '7', | ||
}, | ||
}, | ||
'operatingsystem' => 'Centos', | ||
'path' => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/root/.local/bin:/root/bin' | ||
} | ||
'path' => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/root/.local/bin:/root/bin', | ||
} | ||
end | ||
|
||
let(:params) do | ||
{ | ||
:license_key => '1234567890qwerty', | ||
:conf_dir => '/opt/rh/php54/root/etc/php.d', | ||
license_key: '1234567890qwerty', | ||
conf_dir: '/opt/rh/php54/root/etc/php.d', | ||
} | ||
end | ||
|
||
it { is_expected.to compile } | ||
it { should contain_class('newrelic::params') } | ||
it { should contain_class('newrelic::repo::legacy') } | ||
it { should contain_package('newrelic-php5') } | ||
it { should contain_package('php-cli') } | ||
it { should contain_file('/etc/newrelic/newrelic.cfg') } | ||
it { should contain_file('/opt/rh/php54/root/etc/php.d/newrelic.ini') } | ||
it { should contain_exec('newrelic install') } | ||
it { should contain_exec('newrelic_kill') } | ||
|
||
it { is_expected.to contain_class('newrelic::params') } | ||
it { is_expected.to contain_class('newrelic::repo::legacy') } | ||
it { is_expected.to contain_package('newrelic-php5') } | ||
it { is_expected.to contain_package('php-cli') } | ||
it { is_expected.to contain_file('/etc/newrelic/newrelic.cfg') } | ||
it { is_expected.to contain_file('/opt/rh/php54/root/etc/php.d/newrelic.ini') } | ||
it { is_expected.to contain_exec('newrelic install') } | ||
it { is_expected.to contain_exec('newrelic_kill') } | ||
|
||
context 'startup_mode => external' do | ||
let(:params) do | ||
super().merge({ 'startup_mode' => 'external' }) | ||
super().merge('startup_mode' => 'external') | ||
end | ||
it { should contain_service('newrelic-daemon') } | ||
|
||
it { is_expected.to contain_service('newrelic-daemon') } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,39 @@ | ||
require 'spec_helper' | ||
|
||
describe 'newrelic::repo::legacy', :type => :class do | ||
|
||
describe 'newrelic::repo::legacy', type: :class do | ||
context 'OS Family => Redhat' do | ||
let(:facts) do | ||
{ | ||
'os' => { | ||
'family' => 'RedHat', | ||
'name' => 'CentOS', | ||
'release' => { | ||
'major' => '7' | ||
} | ||
} | ||
'major' => '7', | ||
}, | ||
}, | ||
} | ||
end | ||
|
||
it { is_expected.to compile } | ||
it { should contain_package('newrelic-repo-5-3.noarch') } | ||
it { is_expected.to contain_package('newrelic-repo-5-3.noarch') } | ||
end | ||
|
||
context 'OS Family => Debian' do | ||
let(:facts) do | ||
{ | ||
'os' => { | ||
'family' => 'Debian', | ||
'name' => 'Debian', | ||
'release' => { | ||
'full' => '7.0' | ||
} | ||
'family' => 'Debian', | ||
'name' => 'Debian', | ||
'release' => { | ||
'full' => '7.0', | ||
}, | ||
}, | ||
'osfamily' => 'Debian', | ||
'lsbdistcodename' => 'wheezy' | ||
} | ||
end | ||
'lsbdistcodename' => 'wheezy', | ||
} | ||
end | ||
|
||
it { is_expected.to compile } | ||
it { should contain_apt__source('newrelic') } | ||
it { is_expected.to contain_apt__source('newrelic') } | ||
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 |
---|---|---|
@@ -1,40 +1,38 @@ | ||
require 'spec_helper' | ||
|
||
describe 'newrelic::server::linux', :type => :class do | ||
describe 'newrelic::server::linux', type: :class do | ||
let(:facts) do | ||
{ | ||
'path' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin:/snap/bin:/opt/puppetlabs/bin/', | ||
'os' => { | ||
'family' => 'RedHat', | ||
'name' => 'CentOS', | ||
'release' => { | ||
'major' => '7' | ||
} | ||
} | ||
} | ||
'major' => '7', | ||
}, | ||
}, | ||
} | ||
end | ||
|
||
let(:params) do | ||
{ | ||
:license_key => '1234567890qwerty', | ||
license_key: '1234567890qwerty', | ||
} | ||
end | ||
|
||
it { is_expected.to compile } | ||
it { should contain_class('newrelic::repo::legacy') } | ||
it { should contain_service('newrelic-sysmond') } | ||
it { should contain_package('newrelic-sysmond') } | ||
it { should contain_file('/var/log/newrelic') } | ||
it { should contain_file('/etc/newrelic/nrsysmond.cfg') } | ||
it { should contain_exec('install_newrelic_license_key') } | ||
it { is_expected.to contain_class('newrelic::repo::legacy') } | ||
it { is_expected.to contain_service('newrelic-sysmond') } | ||
it { is_expected.to contain_package('newrelic-sysmond') } | ||
it { is_expected.to contain_file('/var/log/newrelic') } | ||
it { is_expected.to contain_file('/etc/newrelic/nrsysmond.cfg') } | ||
it { is_expected.to contain_exec('install_newrelic_license_key') } | ||
|
||
context 'with manage_repo => true' do | ||
let(:params)do | ||
super().merge({ 'manage_repo' => true }) | ||
let(:params) do | ||
super().merge('manage_repo' => true) | ||
end | ||
|
||
it { should contain_class('newrelic::repo::legacy') } | ||
it { is_expected.to contain_class('newrelic::repo::legacy') } | ||
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 |
---|---|---|
@@ -1,25 +1,24 @@ | ||
require 'spec_helper' | ||
|
||
describe 'newrelic', :type => :class do | ||
describe 'newrelic', type: :class do | ||
let(:facts) do | ||
{ | ||
'os' => { | ||
'family' => 'RedHat', | ||
'name' => 'CentOS', | ||
'release' => { | ||
'major' => '7' | ||
} | ||
} | ||
} | ||
'major' => '7', | ||
}, | ||
}, | ||
} | ||
end | ||
|
||
let(:params) do | ||
{ | ||
:license_key => '1234567890qwerty', | ||
} | ||
{ | ||
license_key: '1234567890qwerty', | ||
} | ||
end | ||
|
||
it { is_expected.to compile } | ||
it { should contain_class('newrelic::params') } | ||
|
||
it { is_expected.to contain_class('newrelic::params') } | ||
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