Skip to content

Commit

Permalink
Added regression test and updated changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-vaughan committed Mar 16, 2018
1 parent ced23e1 commit 12e1456
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 35 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Fri Mar 16 2018 Philippe Muller <[email protected]> 7.1.1-0
- Fixed several cases where literal '\n' was contained in file output

* Mon Jul 31 2017 Liz Nemsick <[email protected]> - 7.1.0-0
- Add ability to specify full rule content for rsyslog::rule::local
and rsyslog::rule::remote defined types.
Expand Down
13 changes: 0 additions & 13 deletions build/rpm_metadata/requires

This file was deleted.

2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simp-rsyslog",
"version": "7.1.0",
"version": "7.1.1",
"author": "SIMP Team",
"summary": "A puppet module to support RSyslog versions 7 and higher using new style RainerScript.",
"license": "Apache-2.0",
Expand Down
50 changes: 29 additions & 21 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,25 @@
end
end

context 'rsyslog class without any parameters' do
let(:params) {{ }}
it_behaves_like 'a structured module'
it { is_expected.to contain_class('rsyslog').with_trusted_nets(['127.0.0.1/32']) }
it { is_expected.to contain_class('rsyslog').with_service_name('rsyslog') }
it { is_expected.to contain_class('rsyslog').with_package_name(rsyslog_package_name) }
it { is_expected.to contain_class('rsyslog').with_tls_package_name("#{rsyslog_package_name}-gnutls") }
it { is_expected.to contain_package("#{rsyslog_package_name}.x86_64").with_ensure('latest') }
it { is_expected.to contain_package("#{rsyslog_package_name}.i386").with_ensure('absent') }

if facts[:operatingsystemmajrelease] == '6'
it {
is_expected.to contain_rsyslog__rule('00_simp_pre_logging/global.conf')
.without_content(/ModLoad imjournal/)
}
else
it {
is_expected.to contain_rsyslog__rule('00_simp_pre_logging/global.conf')
.with_content(/ModLoad imjournal/)
}
end
let(:params) {{ }}
it_behaves_like 'a structured module'
it { is_expected.to contain_class('rsyslog').with_trusted_nets(['127.0.0.1/32']) }
it { is_expected.to contain_class('rsyslog').with_service_name('rsyslog') }
it { is_expected.to contain_class('rsyslog').with_package_name(rsyslog_package_name) }
it { is_expected.to contain_class('rsyslog').with_tls_package_name("#{rsyslog_package_name}-gnutls") }
it { is_expected.to contain_package("#{rsyslog_package_name}.x86_64").with_ensure('latest') }
it { is_expected.to contain_package("#{rsyslog_package_name}.i386").with_ensure('absent') }

if facts[:operatingsystemmajrelease] == '6'
it {
is_expected.to contain_rsyslog__rule('00_simp_pre_logging/global.conf')
.without_content(/ModLoad imjournal/)
}
else
it {
is_expected.to contain_rsyslog__rule('00_simp_pre_logging/global.conf')
.with_content(/ModLoad imjournal/)
}
end

context 'rsyslog class with logrotate enabled' do
Expand All @@ -74,6 +72,16 @@
end
end

it 'no file resources should have a literal \n' do
expect(
catalogue.resources.select { |resource|
resource.type == 'File' &&
resource[:content] &&
resource[:content].include?('\n')
}
).to be_empty
end

context 'rsyslog class with pki = simp' do
let(:params) {{
:pki => 'simp'
Expand Down

0 comments on commit 12e1456

Please sign in to comment.