Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Puppet Camptocamp Postfix
Commits
ee618072
Commit
ee618072
authored
May 20, 2013
by
Raphaël Pinson
Browse files
Add tests
parent
51188fa6
Changes
1
Hide whitespace changes
Inline
Side-by-side
spec/classes/postfix_spec.rb
View file @
ee618072
require
'spec_helper'
describe
'postfix'
do
context
'when on Debian'
do
let
(
:facts
)
{
{
:operatingsystem
=>
'Debian'
,
:osfamily
=>
'Debian'
,
:fqdn
=>
'fqdn.example.com'
,
}
}
it
{
should
contain_package
(
'postfix'
)
}
it
{
should
contain_package
(
'mailx'
)
}
it
{
should
contain_file
(
'/etc/mailname'
).
with_content
(
"fqdn.example.com
\n
"
)
}
it
{
should
contain_file
(
'/etc/aliases'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
should
contain_exec
(
'newaliases'
).
with_refreshonly
(
'true'
)
}
it
{
should
contain_file
(
'/etc/postfix/master.cf'
)
}
it
{
should
contain_file
(
'/etc/postfix/main.cf'
)
}
it
{
should
contain_postfix__config
(
'myorigin'
)
}
it
{
should
contain_postfix__config
(
'alias_maps'
)
}
it
{
should
contain_postfix__config
(
'inet_interfaces'
)
}
end
context
'when using defaults'
do
context
'when on Debian'
do
let
(
:facts
)
{
{
:operatingsystem
=>
'Debian'
,
:osfamily
=>
'Debian'
,
:fqdn
=>
'fqdn.example.com'
,
}
}
it
{
should
contain_package
(
'postfix'
)
}
it
{
should
contain_package
(
'mailx'
)
}
it
{
should
contain_file
(
'/etc/mailname'
).
with_content
(
"fqdn.example.com
\n
"
)
}
it
{
should
contain_file
(
'/etc/aliases'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
should
contain_exec
(
'newaliases'
).
with_refreshonly
(
'true'
)
}
it
{
should
contain_file
(
'/etc/postfix/master.cf'
)
}
it
{
should
contain_file
(
'/etc/postfix/main.cf'
)
}
it
{
should
contain_postfix__config
(
'myorigin'
)
}
it
{
should
contain_postfix__config
(
'alias_maps'
)
}
it
{
should
contain_postfix__config
(
'inet_interfaces'
)
}
it
{
should
contain_mailalias
(
'root'
)
}
it
{
should
contain_service
(
'postfix'
).
with
(
:ensure
=>
'running'
,
:enable
=>
'true'
,
:hasstatus
=>
'true'
,
:restart
=>
'/etc/init.d/postfix reload'
)
}
end
context
'when on RedHat'
do
let
(
:facts
)
{
{
:operatingsystem
=>
'RedHat'
,
:osfamily
=>
'RedHat'
,
:fqdn
=>
'fqdn.example.com'
,
}
}
it
{
should
contain_package
(
'postfix'
)
}
it
{
should
contain_package
(
'mailx'
)
}
it
{
should
contain_file
(
'/etc/mailname'
).
with_content
(
"fqdn.example.com
\n
"
)
}
it
{
should
contain_file
(
'/etc/aliases'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
should
contain_exec
(
'newaliases'
).
with_refreshonly
(
'true'
)
}
it
{
should
contain_file
(
'/etc/postfix/master.cf'
)
}
it
{
should
contain_file
(
'/etc/postfix/main.cf'
)
}
it
{
should
contain_postfix__config
(
'myorigin'
)
}
it
{
should
contain_postfix__config
(
'alias_maps'
)
}
it
{
should
contain_postfix__config
(
'inet_interfaces'
)
}
it
{
should
contain_postfix__config
(
'sendmail_path'
)
}
it
{
should
contain_postfix__config
(
'newaliases_path'
)
}
it
{
should
contain_postfix__config
(
'mailq_path'
)
}
it
{
should
contain_mailalias
(
'root'
)
}
context
'when on RedHat'
do
let
(
:facts
)
{
{
:operatingsystem
=>
'RedHat'
,
:osfamily
=>
'RedHat'
,
:fqdn
=>
'fqdn.example.com'
,
}
}
it
{
should
contain_package
(
'postfix'
)
}
it
{
should
contain_package
(
'mailx'
)
}
it
{
should
contain_file
(
'/etc/mailname'
).
with_content
(
"fqdn.example.com
\n
"
)
}
it
{
should
contain_file
(
'/etc/aliases'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
should
contain_exec
(
'newaliases'
).
with_refreshonly
(
'true'
)
}
it
{
should
contain_file
(
'/etc/postfix/master.cf'
)
}
it
{
should
contain_file
(
'/etc/postfix/main.cf'
)
}
it
{
should
contain_postfix__config
(
'myorigin'
)
}
it
{
should
contain_postfix__config
(
'alias_maps'
)
}
it
{
should
contain_postfix__config
(
'inet_interfaces'
)
}
it
{
should
contain_postfix__config
(
'sendmail_path'
)
}
it
{
should
contain_postfix__config
(
'newaliases_path'
)
}
it
{
should
contain_postfix__config
(
'mailq_path'
)
}
it
{
should
contain_service
(
'postfix'
).
with
(
:ensure
=>
'running'
,
:enable
=>
'true'
,
:hasstatus
=>
'true'
,
:restart
=>
'/etc/init.d/postfix reload'
)
}
end
end
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment