Loading spec/classes/postfix_spec.rb +33 −33 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/etc/init.d/postfix reload' restart: '/etc/init.d/postfix reload', ) } end Loading @@ -103,7 +103,7 @@ describe 'postfix' do it { is_expected.to contain_augeas("manage postfix 'mailq_path'") } it { is_expected.to contain_alternatives('mta') } context 'when on release 8', if: (facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '8') do # rubocop:disable RSpec/MultipleMemoizedHelpers context 'when on release 8', if: facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '8' do # rubocop:disable RSpec/MultipleMemoizedHelpers it { is_expected.to contain_file('/etc/aliases').with_seltype('etc_aliases_t').with_content("# file managed by puppet\n") } it { Loading @@ -111,12 +111,12 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/bin/systemctl reload postfix' restart: '/bin/systemctl reload postfix', ) } end context 'when on release 7', if: (facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '7') do # rubocop:disable RSpec/MultipleMemoizedHelpers context 'when on release 7', if: facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '7' do # rubocop:disable RSpec/MultipleMemoizedHelpers it { is_expected.to contain_file('/etc/aliases').with_seltype('etc_aliases_t').with_content("# file managed by puppet\n") } it { Loading @@ -124,12 +124,12 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/bin/systemctl reload postfix' restart: '/bin/systemctl reload postfix', ) } end context 'when on release 6', if: (facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '6') do # rubocop:disable RSpec/MultipleMemoizedHelpers context 'when on release 6', if: facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '6' do # rubocop:disable RSpec/MultipleMemoizedHelpers it { is_expected.to contain_file('/etc/aliases').with_seltype('etc_aliases_t').with_content("# file managed by puppet\n") } it { Loading @@ -137,7 +137,7 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/etc/init.d/postfix reload' restart: '/etc/init.d/postfix reload', ) } end Loading @@ -151,7 +151,7 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/bin/systemctl reload postfix' restart: '/bin/systemctl reload postfix', ) } end Loading Loading @@ -207,23 +207,23 @@ describe 'postfix' do it { is_expected.to contain_file(postfix_master_cf_path).without('seltype').with_content( %r{smtp inet n - - - - smtpd} %r{smtp inet n - - - - smtpd}, ).with_content( %r{amavis unix} %r{amavis unix}, ).with_content( %r{dovecot.*\n.* user=bar:bar } %r{dovecot.*\n.* user=bar:bar }, ).with_content( %r{schleuder} %r{schleuder}, ).with_content( %r{sympa} %r{sympa}, ).with_content( %r{user=bar} %r{user=bar}, ).with_content( %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:} %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:}, ).with_content( %r{^smtps inet n} %r{^smtps inet n}, ).with_content( %r{^submission inet n} %r{^submission inet n}, ) } Loading @@ -234,7 +234,7 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/etc/init.d/postfix reload' restart: '/etc/init.d/postfix reload', ) } Loading @@ -261,7 +261,7 @@ describe 'postfix' do ldap: true, ldap_base: 'cn=Users,dc=example,dc=com', ldap_host: 'ldaps://ldap.example.com:636 ldap://ldap2.example.com', ldap_options: 'start_tls = yes' ldap_options: 'start_tls = yes', } end Loading Loading @@ -421,9 +421,9 @@ describe 'postfix' do it 'updates master.cf with the specified flags to smtp' do is_expected.to contain_file(postfix_master_cf_path).with_content( %r{smtp inet n - - - - smtpd} %r{smtp inet n - - - - smtpd}, ).with_content( %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:} %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:}, ) end end Loading Loading @@ -473,8 +473,8 @@ describe 'postfix' do { masquerade_classes: ['envelope_sender'], masquerade_domains: ['host.example.com', 'example.com'], masquerade_exceptions: ['root'] } masquerade_exceptions: ['root'], }, ) end Loading Loading @@ -510,7 +510,7 @@ describe 'postfix' do { mta: true, mydestination: 'example.org, example.com, localhost.localdomain, localhost', relayhost: '2.3.4.5' relayhost: '2.3.4.5', } end Loading @@ -526,7 +526,7 @@ describe 'postfix' do mta: true, mydestination: '1.2.3.4', relayhost: 'direct', mynetworks: '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24' mynetworks: '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24', } end Loading @@ -548,7 +548,7 @@ describe 'postfix' do let(:params) do { mta: true, relayhost: 'relay.example.org' relayhost: 'relay.example.org', } end Loading Loading @@ -612,7 +612,7 @@ describe 'postfix' do it 'updates master.cf to listen to all addresses' do is_expected.to contain_file(postfix_master_cf_path).with_content( %r{smtp inet n - n - - smtpd} %r{smtp inet n - n - - smtpd}, ) end end Loading @@ -622,9 +622,9 @@ describe 'postfix' do it 'updates master.cf with multiple smtp listeners' do is_expected.to contain_file(postfix_master_cf_path).with_content( %r{192.168.0.123:smtp inet n - n - - smtpd} %r{192.168.0.123:smtp inet n - n - - smtpd}, ).with_content( %r{10.0.0.123:smtp inet n - n - - smtpd} %r{10.0.0.123:smtp inet n - n - - smtpd}, ) end end Loading @@ -634,9 +634,9 @@ describe 'postfix' do it 'updates master.cf with multiple smtp listeners' do is_expected.to contain_file(postfix_master_cf_path).with_content( %r{192.168.0.123:smtp inet n - n - - smtpd} %r{192.168.0.123:smtp inet n - n - - smtpd}, ).with_content( %r{10.0.0.123:smtp inet n - n - - smtpd} %r{10.0.0.123:smtp inet n - n - - smtpd}, ) end end Loading Loading @@ -812,7 +812,7 @@ describe 'postfix' do 'search_base' => 'dc=example, dc=com', 'query_filter' => 'mail=%s', 'result_attribute' => 'uid', } }, ) is_expected.to contain_file('postfix conffile ldapoptions.cf').with_ensure('present') end Loading @@ -833,7 +833,7 @@ describe 'postfix' do it 'creates the map resource' do is_expected.to contain_postfix__map('a_map').with( 'type' => 'regexp', 'content' => 'abc xyz' 'content' => 'abc xyz', ) is_expected.to contain_exec('generate a_map.db') is_expected.to contain_file('postfix map a_map') Loading spec/defines/postfix_conffile_spec.rb +4 −4 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ describe 'postfix::conffile' do it { is_expected.to contain_file('postfix conffile foo').with( ensure: 'present', source: 'puppet:///modules/postfix/bar' source: 'puppet:///modules/postfix/bar', ).without(:content) } end Loading @@ -69,7 +69,7 @@ describe 'postfix::conffile' do it { is_expected.to contain_file('postfix conffile foo').with( ensure: 'present', content: 'bar' content: 'bar', ).without(:source) } end Loading Loading @@ -126,7 +126,7 @@ describe 'postfix::conffile' do it { is_expected.to contain_file('postfix conffile foo').with( mode: '0644', content: 'bar' content: 'bar', ) } end Loading @@ -142,7 +142,7 @@ describe 'postfix::conffile' do it { is_expected.to contain_file('postfix conffile foo').with( path: '/tmp/foo', content: 'bar' content: 'bar', ) } end Loading spec/defines/postfix_config_spec.rb +3 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ describe 'postfix::config' do is_expected.to contain_augeas("manage postfix 'foo'").with( incl: postfix_main_cf_path, lens: 'Postfix_Main.lns', changes: "set foo 'bar'" changes: "set foo 'bar'", ) } end Loading @@ -73,7 +73,7 @@ describe 'postfix::config' do is_expected.to contain_augeas("manage postfix 'foo'").with( incl: postfix_main_cf_path, lens: 'Postfix_Main.lns', changes: 'rm foo' changes: 'rm foo', ) } end Loading @@ -90,7 +90,7 @@ describe 'postfix::config' do is_expected.to contain_augeas("manage postfix 'foo'").with( incl: postfix_main_cf_path, lens: 'Postfix_Main.lns', changes: 'clear foo' changes: 'clear foo', ) } end Loading spec/defines/postfix_hash_spec.rb +3 −3 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ describe 'postfix::hash' do it { is_expected.to contain_file('postfix map /tmp/foo').with( ensure: 'present', source: '/tmp/bar' source: '/tmp/bar', ).without(:content) } Loading @@ -90,7 +90,7 @@ describe 'postfix::hash' do it { is_expected.to contain_file('postfix map /tmp/foo').with( ensure: 'present', content: 'bar' content: 'bar', ).without(:source) } Loading @@ -107,7 +107,7 @@ describe 'postfix::hash' do context 'when not passing source or content' do it { is_expected.to contain_file('postfix map /tmp/foo').with( ensure: 'present' ensure: 'present', ).without(:source).without(:content) } Loading spec/defines/postfix_map_spec.rb +3 −3 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ describe 'postfix::map' do it { is_expected.to contain_file('postfix map foo').with( ensure: 'present', source: '/tmp/bar' source: '/tmp/bar', ).without(:content) } Loading @@ -79,7 +79,7 @@ describe 'postfix::map' do it { is_expected.to contain_file('postfix map foo').with( ensure: 'present', content: 'bar' content: 'bar', ).without(:source) } Loading @@ -90,7 +90,7 @@ describe 'postfix::map' do context 'when not passing source or content' do it { is_expected.to contain_file('postfix map foo').with( ensure: 'present' ensure: 'present', ).without(:source).without(:content) } Loading Loading
spec/classes/postfix_spec.rb +33 −33 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/etc/init.d/postfix reload' restart: '/etc/init.d/postfix reload', ) } end Loading @@ -103,7 +103,7 @@ describe 'postfix' do it { is_expected.to contain_augeas("manage postfix 'mailq_path'") } it { is_expected.to contain_alternatives('mta') } context 'when on release 8', if: (facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '8') do # rubocop:disable RSpec/MultipleMemoizedHelpers context 'when on release 8', if: facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '8' do # rubocop:disable RSpec/MultipleMemoizedHelpers it { is_expected.to contain_file('/etc/aliases').with_seltype('etc_aliases_t').with_content("# file managed by puppet\n") } it { Loading @@ -111,12 +111,12 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/bin/systemctl reload postfix' restart: '/bin/systemctl reload postfix', ) } end context 'when on release 7', if: (facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '7') do # rubocop:disable RSpec/MultipleMemoizedHelpers context 'when on release 7', if: facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '7' do # rubocop:disable RSpec/MultipleMemoizedHelpers it { is_expected.to contain_file('/etc/aliases').with_seltype('etc_aliases_t').with_content("# file managed by puppet\n") } it { Loading @@ -124,12 +124,12 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/bin/systemctl reload postfix' restart: '/bin/systemctl reload postfix', ) } end context 'when on release 6', if: (facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '6') do # rubocop:disable RSpec/MultipleMemoizedHelpers context 'when on release 6', if: facts[:os]['family'] == 'RedHat' && facts[:operatingsystemmajrelease] == '6' do # rubocop:disable RSpec/MultipleMemoizedHelpers it { is_expected.to contain_file('/etc/aliases').with_seltype('etc_aliases_t').with_content("# file managed by puppet\n") } it { Loading @@ -137,7 +137,7 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/etc/init.d/postfix reload' restart: '/etc/init.d/postfix reload', ) } end Loading @@ -151,7 +151,7 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/bin/systemctl reload postfix' restart: '/bin/systemctl reload postfix', ) } end Loading Loading @@ -207,23 +207,23 @@ describe 'postfix' do it { is_expected.to contain_file(postfix_master_cf_path).without('seltype').with_content( %r{smtp inet n - - - - smtpd} %r{smtp inet n - - - - smtpd}, ).with_content( %r{amavis unix} %r{amavis unix}, ).with_content( %r{dovecot.*\n.* user=bar:bar } %r{dovecot.*\n.* user=bar:bar }, ).with_content( %r{schleuder} %r{schleuder}, ).with_content( %r{sympa} %r{sympa}, ).with_content( %r{user=bar} %r{user=bar}, ).with_content( %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:} %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:}, ).with_content( %r{^smtps inet n} %r{^smtps inet n}, ).with_content( %r{^submission inet n} %r{^submission inet n}, ) } Loading @@ -234,7 +234,7 @@ describe 'postfix' do ensure: 'running', enable: 'true', hasstatus: 'true', restart: '/etc/init.d/postfix reload' restart: '/etc/init.d/postfix reload', ) } Loading @@ -261,7 +261,7 @@ describe 'postfix' do ldap: true, ldap_base: 'cn=Users,dc=example,dc=com', ldap_host: 'ldaps://ldap.example.com:636 ldap://ldap2.example.com', ldap_options: 'start_tls = yes' ldap_options: 'start_tls = yes', } end Loading Loading @@ -421,9 +421,9 @@ describe 'postfix' do it 'updates master.cf with the specified flags to smtp' do is_expected.to contain_file(postfix_master_cf_path).with_content( %r{smtp inet n - - - - smtpd} %r{smtp inet n - - - - smtpd}, ).with_content( %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:} %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:}, ) end end Loading Loading @@ -473,8 +473,8 @@ describe 'postfix' do { masquerade_classes: ['envelope_sender'], masquerade_domains: ['host.example.com', 'example.com'], masquerade_exceptions: ['root'] } masquerade_exceptions: ['root'], }, ) end Loading Loading @@ -510,7 +510,7 @@ describe 'postfix' do { mta: true, mydestination: 'example.org, example.com, localhost.localdomain, localhost', relayhost: '2.3.4.5' relayhost: '2.3.4.5', } end Loading @@ -526,7 +526,7 @@ describe 'postfix' do mta: true, mydestination: '1.2.3.4', relayhost: 'direct', mynetworks: '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24' mynetworks: '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24', } end Loading @@ -548,7 +548,7 @@ describe 'postfix' do let(:params) do { mta: true, relayhost: 'relay.example.org' relayhost: 'relay.example.org', } end Loading Loading @@ -612,7 +612,7 @@ describe 'postfix' do it 'updates master.cf to listen to all addresses' do is_expected.to contain_file(postfix_master_cf_path).with_content( %r{smtp inet n - n - - smtpd} %r{smtp inet n - n - - smtpd}, ) end end Loading @@ -622,9 +622,9 @@ describe 'postfix' do it 'updates master.cf with multiple smtp listeners' do is_expected.to contain_file(postfix_master_cf_path).with_content( %r{192.168.0.123:smtp inet n - n - - smtpd} %r{192.168.0.123:smtp inet n - n - - smtpd}, ).with_content( %r{10.0.0.123:smtp inet n - n - - smtpd} %r{10.0.0.123:smtp inet n - n - - smtpd}, ) end end Loading @@ -634,9 +634,9 @@ describe 'postfix' do it 'updates master.cf with multiple smtp listeners' do is_expected.to contain_file(postfix_master_cf_path).with_content( %r{192.168.0.123:smtp inet n - n - - smtpd} %r{192.168.0.123:smtp inet n - n - - smtpd}, ).with_content( %r{10.0.0.123:smtp inet n - n - - smtpd} %r{10.0.0.123:smtp inet n - n - - smtpd}, ) end end Loading Loading @@ -812,7 +812,7 @@ describe 'postfix' do 'search_base' => 'dc=example, dc=com', 'query_filter' => 'mail=%s', 'result_attribute' => 'uid', } }, ) is_expected.to contain_file('postfix conffile ldapoptions.cf').with_ensure('present') end Loading @@ -833,7 +833,7 @@ describe 'postfix' do it 'creates the map resource' do is_expected.to contain_postfix__map('a_map').with( 'type' => 'regexp', 'content' => 'abc xyz' 'content' => 'abc xyz', ) is_expected.to contain_exec('generate a_map.db') is_expected.to contain_file('postfix map a_map') Loading
spec/defines/postfix_conffile_spec.rb +4 −4 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ describe 'postfix::conffile' do it { is_expected.to contain_file('postfix conffile foo').with( ensure: 'present', source: 'puppet:///modules/postfix/bar' source: 'puppet:///modules/postfix/bar', ).without(:content) } end Loading @@ -69,7 +69,7 @@ describe 'postfix::conffile' do it { is_expected.to contain_file('postfix conffile foo').with( ensure: 'present', content: 'bar' content: 'bar', ).without(:source) } end Loading Loading @@ -126,7 +126,7 @@ describe 'postfix::conffile' do it { is_expected.to contain_file('postfix conffile foo').with( mode: '0644', content: 'bar' content: 'bar', ) } end Loading @@ -142,7 +142,7 @@ describe 'postfix::conffile' do it { is_expected.to contain_file('postfix conffile foo').with( path: '/tmp/foo', content: 'bar' content: 'bar', ) } end Loading
spec/defines/postfix_config_spec.rb +3 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ describe 'postfix::config' do is_expected.to contain_augeas("manage postfix 'foo'").with( incl: postfix_main_cf_path, lens: 'Postfix_Main.lns', changes: "set foo 'bar'" changes: "set foo 'bar'", ) } end Loading @@ -73,7 +73,7 @@ describe 'postfix::config' do is_expected.to contain_augeas("manage postfix 'foo'").with( incl: postfix_main_cf_path, lens: 'Postfix_Main.lns', changes: 'rm foo' changes: 'rm foo', ) } end Loading @@ -90,7 +90,7 @@ describe 'postfix::config' do is_expected.to contain_augeas("manage postfix 'foo'").with( incl: postfix_main_cf_path, lens: 'Postfix_Main.lns', changes: 'clear foo' changes: 'clear foo', ) } end Loading
spec/defines/postfix_hash_spec.rb +3 −3 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ describe 'postfix::hash' do it { is_expected.to contain_file('postfix map /tmp/foo').with( ensure: 'present', source: '/tmp/bar' source: '/tmp/bar', ).without(:content) } Loading @@ -90,7 +90,7 @@ describe 'postfix::hash' do it { is_expected.to contain_file('postfix map /tmp/foo').with( ensure: 'present', content: 'bar' content: 'bar', ).without(:source) } Loading @@ -107,7 +107,7 @@ describe 'postfix::hash' do context 'when not passing source or content' do it { is_expected.to contain_file('postfix map /tmp/foo').with( ensure: 'present' ensure: 'present', ).without(:source).without(:content) } Loading
spec/defines/postfix_map_spec.rb +3 −3 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ describe 'postfix::map' do it { is_expected.to contain_file('postfix map foo').with( ensure: 'present', source: '/tmp/bar' source: '/tmp/bar', ).without(:content) } Loading @@ -79,7 +79,7 @@ describe 'postfix::map' do it { is_expected.to contain_file('postfix map foo').with( ensure: 'present', content: 'bar' content: 'bar', ).without(:source) } Loading @@ -90,7 +90,7 @@ describe 'postfix::map' do context 'when not passing source or content' do it { is_expected.to contain_file('postfix map foo').with( ensure: 'present' ensure: 'present', ).without(:source).without(:content) } Loading