Loading spec/classes/postfix_augeas_spec.rb +6 −0 Original line number Diff line number Diff line Loading @@ -2,9 +2,15 @@ require 'spec_helper' describe 'postfix::augeas' do let (:facts) { { :augeasversion => '1.2.0', :lsbdistcodename => 'wheezy', :operatingsystem => 'Debian', :osfamily => 'Debian', :rubyversion => '1.9.3', } } let :pre_condition do "include ::augeas" end it { should contain_augeas__lens('postfix_transport').with( :ensure => 'present', Loading spec/classes/postfix_mta_spec.rb +8 −1 Original line number Diff line number Diff line Loading @@ -2,9 +2,16 @@ require 'spec_helper' describe 'postfix::mta' do let (:facts) { { :needs_postfix_class_with_params => true, :lsbdistcodename => 'wheezy', :osfamily => 'Debian', } } let :pre_condition do "class { 'postfix': mydestination => 'bar', mynetworks => 'baz', relayhost => 'foo', }" end it { should contain_postfix__config('mydestination').with_value('bar') } it { should contain_postfix__config('mynetworks').with_value('baz') } Loading spec/classes/postfix_satellite_spec.rb +11 −1 Original line number Diff line number Diff line Loading @@ -3,9 +3,19 @@ require 'spec_helper' describe 'postfix::satellite' do let (:node) { 'foo.example.com' } let (:facts) { { :augeasversion => '1.2.0', :lsbdistcodename => 'wheezy', :osfamily => 'Debian', :needs_postfix_class_with_params => true, :rubyversion => '1.9.3', } } let :pre_condition do " class { 'augeas': } class { 'postfix': relayhost => 'foo', mydestination => 'bar', mynetworks => 'baz', }" end it { should contain_class('postfix::mta') } it { should contain_postfix__virtual('@foo.example.com').with( :ensure => 'present', Loading spec/classes/postfix_spec.rb +9 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ describe 'postfix' do context 'when using defaults' do context 'when on Debian' do let (:facts) { { :lsbdistcodename => 'wheezy', :operatingsystem => 'Debian', :osfamily => 'Debian', :fqdn => 'fqdn.example.com', Loading Loading @@ -35,6 +36,7 @@ describe 'postfix' do context 'when on RedHat' do let (:facts) { { :lsbmajdistrelease => '7', :operatingsystem => 'RedHat', :osfamily => 'RedHat', :fqdn => 'fqdn.example.com', Loading Loading @@ -72,6 +74,7 @@ describe 'postfix' do context 'when on Debian' do context "when setting smtp_listen to 'all'" do let (:facts) { { :lsbdistcodename => 'wheezy', :operatingsystem => 'Debian', :osfamily => 'Debian', :fqdn => 'fqdn.example.com', Loading Loading @@ -139,8 +142,11 @@ describe 'postfix' do end context 'when on RedHat' do let (:facts) { { :augeasversion => '1.2.0', :lsbdistcodename => 'wheezy', :operatingsystem => 'Debian', :osfamily => 'Debian', :rubyversion => '1.9.7', :fqdn => 'fqdn.example.com', } } context 'when specifying inet_interfaces' do Loading Loading @@ -246,6 +252,9 @@ describe 'postfix' do end context 'when specifying satellite' do let (:params) { { :satellite => true, :mydestination => '1.2.3.4', :relayhost => '2.3.4.5' } } let :pre_condition do "class { 'augeas': }" end it 'should configure all local email to be forwarded to $root_mail_recipient delivered through $relayhost' do should contain_postfix__config('mydestination').with_value('1.2.3.4') should contain_postfix__config('mynetworks').with_value('127.0.0.0/8') Loading spec/defines/postfix_config_spec.rb +4 −1 Original line number Diff line number Diff line Loading @@ -3,9 +3,12 @@ require 'spec_helper' describe 'postfix::config' do let (:title) { 'foo' } let (:facts) { { :lsbdistcodename => 'wheezy', :osfamily => 'Debian', :needs_postfix_class => true, } } let :pre_condition do "class { 'postfix': }" end context 'when not passing value' do it 'should fail' do Loading Loading
spec/classes/postfix_augeas_spec.rb +6 −0 Original line number Diff line number Diff line Loading @@ -2,9 +2,15 @@ require 'spec_helper' describe 'postfix::augeas' do let (:facts) { { :augeasversion => '1.2.0', :lsbdistcodename => 'wheezy', :operatingsystem => 'Debian', :osfamily => 'Debian', :rubyversion => '1.9.3', } } let :pre_condition do "include ::augeas" end it { should contain_augeas__lens('postfix_transport').with( :ensure => 'present', Loading
spec/classes/postfix_mta_spec.rb +8 −1 Original line number Diff line number Diff line Loading @@ -2,9 +2,16 @@ require 'spec_helper' describe 'postfix::mta' do let (:facts) { { :needs_postfix_class_with_params => true, :lsbdistcodename => 'wheezy', :osfamily => 'Debian', } } let :pre_condition do "class { 'postfix': mydestination => 'bar', mynetworks => 'baz', relayhost => 'foo', }" end it { should contain_postfix__config('mydestination').with_value('bar') } it { should contain_postfix__config('mynetworks').with_value('baz') } Loading
spec/classes/postfix_satellite_spec.rb +11 −1 Original line number Diff line number Diff line Loading @@ -3,9 +3,19 @@ require 'spec_helper' describe 'postfix::satellite' do let (:node) { 'foo.example.com' } let (:facts) { { :augeasversion => '1.2.0', :lsbdistcodename => 'wheezy', :osfamily => 'Debian', :needs_postfix_class_with_params => true, :rubyversion => '1.9.3', } } let :pre_condition do " class { 'augeas': } class { 'postfix': relayhost => 'foo', mydestination => 'bar', mynetworks => 'baz', }" end it { should contain_class('postfix::mta') } it { should contain_postfix__virtual('@foo.example.com').with( :ensure => 'present', Loading
spec/classes/postfix_spec.rb +9 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ describe 'postfix' do context 'when using defaults' do context 'when on Debian' do let (:facts) { { :lsbdistcodename => 'wheezy', :operatingsystem => 'Debian', :osfamily => 'Debian', :fqdn => 'fqdn.example.com', Loading Loading @@ -35,6 +36,7 @@ describe 'postfix' do context 'when on RedHat' do let (:facts) { { :lsbmajdistrelease => '7', :operatingsystem => 'RedHat', :osfamily => 'RedHat', :fqdn => 'fqdn.example.com', Loading Loading @@ -72,6 +74,7 @@ describe 'postfix' do context 'when on Debian' do context "when setting smtp_listen to 'all'" do let (:facts) { { :lsbdistcodename => 'wheezy', :operatingsystem => 'Debian', :osfamily => 'Debian', :fqdn => 'fqdn.example.com', Loading Loading @@ -139,8 +142,11 @@ describe 'postfix' do end context 'when on RedHat' do let (:facts) { { :augeasversion => '1.2.0', :lsbdistcodename => 'wheezy', :operatingsystem => 'Debian', :osfamily => 'Debian', :rubyversion => '1.9.7', :fqdn => 'fqdn.example.com', } } context 'when specifying inet_interfaces' do Loading Loading @@ -246,6 +252,9 @@ describe 'postfix' do end context 'when specifying satellite' do let (:params) { { :satellite => true, :mydestination => '1.2.3.4', :relayhost => '2.3.4.5' } } let :pre_condition do "class { 'augeas': }" end it 'should configure all local email to be forwarded to $root_mail_recipient delivered through $relayhost' do should contain_postfix__config('mydestination').with_value('1.2.3.4') should contain_postfix__config('mynetworks').with_value('127.0.0.0/8') Loading
spec/defines/postfix_config_spec.rb +4 −1 Original line number Diff line number Diff line Loading @@ -3,9 +3,12 @@ require 'spec_helper' describe 'postfix::config' do let (:title) { 'foo' } let (:facts) { { :lsbdistcodename => 'wheezy', :osfamily => 'Debian', :needs_postfix_class => true, } } let :pre_condition do "class { 'postfix': }" end context 'when not passing value' do it 'should fail' do Loading