From 12e145658e0af8301752ee64893c0ebed144031f Mon Sep 17 00:00:00 2001 From: Trevor Vaughan Date: Fri, 16 Mar 2018 09:53:35 -0400 Subject: [PATCH] Added regression test and updated changelog --- CHANGELOG | 3 +++ build/rpm_metadata/requires | 13 ---------- metadata.json | 2 +- spec/classes/init_spec.rb | 50 +++++++++++++++++++++---------------- 4 files changed, 33 insertions(+), 35 deletions(-) delete mode 100644 build/rpm_metadata/requires diff --git a/CHANGELOG b/CHANGELOG index 304d26b..2c57e92 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +* Fri Mar 16 2018 Philippe Muller 7.1.1-0 +- Fixed several cases where literal '\n' was contained in file output + * Mon Jul 31 2017 Liz Nemsick - 7.1.0-0 - Add ability to specify full rule content for rsyslog::rule::local and rsyslog::rule::remote defined types. diff --git a/build/rpm_metadata/requires b/build/rpm_metadata/requires deleted file mode 100644 index 0486920..0000000 --- a/build/rpm_metadata/requires +++ /dev/null @@ -1,13 +0,0 @@ -Obsoletes: pupmod-rsyslog-test >= 0.0.1 -Requires: pupmod-puppetlabs-stdlib < 5.0.0-0 -Requires: pupmod-puppetlabs-stdlib >= 4.13.1-0 -Requires: pupmod-simp-iptables < 7.0.0-0 -Requires: pupmod-simp-iptables >= 6.0.0-0 -Requires: pupmod-simp-logrotate < 7.0.0-0 -Requires: pupmod-simp-logrotate >= 6.0.0-0 -Requires: pupmod-simp-pki < 7.0.0-0 -Requires: pupmod-simp-pki >= 6.0.0-0 -Requires: pupmod-simp-simplib >= 3.1.0-0 -Requires: pupmod-simp-simplib < 4.0.0-0 -Requires: pupmod-simp-tcpwrappers >= 6.0.0-0 -Requires: pupmod-simp-tcpwrappers < 7.0.0-0 diff --git a/metadata.json b/metadata.json index 93f7e84..89d4792 100644 --- a/metadata.json +++ b/metadata.json @@ -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", diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 5b141b1..5e7127d 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -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 @@ -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'