ansible-role-postfix_mta/test/integration/default/serverspec/default_spec.rb

32 lines
666 B
Ruby

require 'serverspec'
set :backend, :exec
puts
puts '================================'
puts %x(ansible --version)
puts '================================'
%w[postfix bsd-mailx].each do |name|
describe package(name) do
it { should be_installed }
end
end
describe file('/etc/postfix/main.cf') do
it { should be_file }
it { should be_mode 644 }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
it { should contain 'protocols = ipv4' }
end
describe service('postfix') do
it { should be_enabled }
it { should be_running }
it { should be_running.under('systemd') }
end
describe port(25) do
it { should be_listening }
end