mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-12-16 13:20:35 +00:00
added context to class spec tests to be able to test osfamily RedHat
This commit is contained in:
parent
be1a555591
commit
ae7256a8c2
@ -1,16 +1,7 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::config', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_file('/etc/td-agent/td-agent.conf').with({
|
||||
'ensure' => 'file',
|
||||
@ -28,4 +19,27 @@ describe 'fluentd::config', :type => :class do
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
end
|
||||
|
@ -1,16 +1,8 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::install', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_package('fluentd').with({
|
||||
'ensure' => 'installed',
|
||||
@ -19,4 +11,27 @@ describe 'fluentd::install', :type => :class do
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1,6 +1,8 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::repo', :type => :class do
|
||||
|
||||
context 'when called with no parameters on osfamily Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
@ -9,10 +11,19 @@ describe 'fluentd::repo', :type => :class do
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
it {
|
||||
should contain_class('fluentd::repo::apt')
|
||||
}
|
||||
end
|
||||
|
||||
context 'when called with no parameters on osfamily RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
it {
|
||||
should contain_class('fluentd::repo::yum')
|
||||
}
|
||||
end
|
||||
end
|
||||
|
@ -1,16 +1,7 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::config', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_service('fluentd').with({
|
||||
'name' => 'td-agent',
|
||||
@ -21,4 +12,27 @@ describe 'fluentd::config', :type => :class do
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
end
|
||||
|
@ -1,6 +1,16 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd', :type => :class do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_class('fluentd::repo')
|
||||
should contain_class('fluentd::install')
|
||||
should contain_class('fluentd::config')
|
||||
should contain_class('fluentd::service')
|
||||
}
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
@ -10,12 +20,17 @@ describe 'fluentd', :type => :class do
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
it {
|
||||
should contain_class('fluentd::repo')
|
||||
should contain_class('fluentd::install')
|
||||
should contain_class('fluentd::config')
|
||||
should contain_class('fluentd::service')
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1,6 +1,17 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::user', :type => :class do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_user('fluentd').with({
|
||||
'name' => 'td-agent',
|
||||
'gid' => 'td-agent',
|
||||
'groups' => ['adm']
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
@ -10,13 +21,16 @@ describe 'fluentd::user', :type => :class do
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
it {
|
||||
should contain_user('fluentd').with({
|
||||
'name' => 'td-agent',
|
||||
'gid' => 'td-agent',
|
||||
'groups' => ['adm']
|
||||
})
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user