Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Puppet Camptocamp Postfix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Projets publics
Puppet Camptocamp Postfix
Commits
b9fe74da
Commit
b9fe74da
authored
Feb 11, 2015
by
Ben Hocker
Browse files
Options
Downloads
Patches
Plain Diff
Resolves issue #55
- Adding tests for ldap.pp - Only install postfix-ldap package on Debian based
parent
89055a99
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
manifests/ldap.pp
+5
-3
5 additions, 3 deletions
manifests/ldap.pp
spec/classes/postfix_spec.rb
+49
-3
49 additions, 3 deletions
spec/classes/postfix_spec.rb
with
54 additions
and
6 deletions
manifests/ldap.pp
+
5
−
3
View file @
b9fe74da
...
...
@@ -14,8 +14,10 @@
# include postfix::ldap
#
class
postfix::ldap
{
package
{
'postfix-ldap'
:
}
case
$::osfamily
{
'debian'
:
{
package
{
'postfix-ldap'
:
}
}
default
:
{}
}
if
!
$postfix::ldap_base
{
fail
'Missing $postfix::ldap_base !'
...
...
@@ -36,6 +38,6 @@ class postfix::ldap {
owner
=>
'root'
,
group
=>
'postfix'
,
content
=>
template
(
'postfix/postfix-ldap-aliases.cf.erb'
),
require
=>
P
ackage
[
'postfix-ldap'
],
#TODO: Figure out if should have
require
p
ackage
here
}
}
This diff is collapsed.
Click to expand it.
spec/classes/postfix_spec.rb
+
49
−
3
View file @
b9fe74da
...
...
@@ -37,6 +37,7 @@ describe 'postfix' do
context
'when on RedHat'
do
let
(
:facts
)
{
{
:lsbdistcodename
=>
'Maipo'
,
:fqdn
=>
'fqdn.example.com'
,
:operatingsystem
=>
'RedHat'
,
:operatingsystemmajrelease
=>
'7'
,
...
...
@@ -162,8 +163,53 @@ describe 'postfix' do
end
end
context
'when enabling ldap'
do
it
'should do stuff'
do
skip
'need to write this still'
context
'when on Debian'
do
let
(
:params
)
{
{
:ldap
=>
true
,
:ldap_base
=>
'dc=example,dc=com'
,
:ldap_host
=>
'host.example.com'
,
}
}
let
(
:facts
)
{
{
:operatingsystem
=>
'Debian'
,
:osfamily
=>
'Debian'
,
:fqdn
=>
'fqdn.example.com'
,
:lsbdistcodename
=>
'wheezy'
,
}
}
it
{
should
contain_package
(
'postfix-ldap'
)
}
it
{
should
contain_file
(
'/etc/postfix/ldap-aliases.cf'
).
with
(
:owner
=>
'root'
,
:group
=>
'postfix'
).
with_content
(
/search_base = /
)
}
end
context
'when on RedHat'
do
let
(
:params
)
{
{
:ldap
=>
true
,
:ldap_base
=>
'dc=example,dc=com'
,
:ldap_host
=>
'host.example.com'
,
}
}
let
(
:facts
)
{
{
:operatingsystem
=>
'RedHat'
,
:osfamily
=>
'RedHat'
,
:operatingsystemmajrelease
=>
'7'
,
:lsbdistcodename
=>
'Maipo'
,
:fqdn
=>
'fqdn.example.com'
,
}
}
it
do
expect
{
should_not
contain_package
(
'postfix-ldap'
)
}
end
it
{
should
contain_file
(
'/etc/postfix/ldap-aliases.cf'
).
with
(
:owner
=>
'root'
,
:group
=>
'postfix'
).
with_content
(
/search_base = /
)
}
end
end
context
'when a custom mail_user is specified'
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment