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
b3af7a33
Unverified
Commit
b3af7a33
authored
Aug 25, 2021
by
Christos Papageorgiou
Browse files
Options
Downloads
Patches
Plain Diff
Fix unit tests
Signed-off-by:
Christos Papageorgiou
<
christos.papageorgioy@gmail.com
>
parent
1b31cb1f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
spec/classes/postfix_spec.rb
+17
-31
17 additions, 31 deletions
spec/classes/postfix_spec.rb
with
17 additions
and
31 deletions
spec/classes/postfix_spec.rb
+
17
−
31
View file @
b3af7a33
...
@@ -42,7 +42,7 @@ describe 'postfix' do
...
@@ -42,7 +42,7 @@ describe 'postfix' do
it
{
is_expected
.
to
contain_postfix__config
(
'inet_protocols'
).
with_value
(
'all'
)
}
it
{
is_expected
.
to
contain_postfix__config
(
'inet_protocols'
).
with_value
(
'all'
)
}
it
{
is_expected
.
to
contain_mailalias
(
'root'
).
with_recipient
(
'nobody'
)
}
it
{
is_expected
.
to
contain_mailalias
(
'root'
).
with_recipient
(
'nobody'
)
}
context
'when on Debian family'
,
excl
:
facts
[
:osfamily
]
!
=
'Debian'
do
context
'when on Debian family'
,
if
:
facts
[
:osfamily
]
=
=
'Debian'
do
it
{
is_expected
.
to
contain_package
(
'mailx'
)
}
it
{
is_expected
.
to
contain_package
(
'mailx'
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/mailname'
).
without
(
'seltype'
).
with_content
(
"foo.example.com
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/mailname'
).
without
(
'seltype'
).
with_content
(
"foo.example.com
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
without
(
'seltype'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
without
(
'seltype'
).
with_content
(
"# file managed by puppet
\n
"
)
}
...
@@ -59,7 +59,7 @@ describe 'postfix' do
...
@@ -59,7 +59,7 @@ describe 'postfix' do
}
}
end
end
context
'when on RedHat family'
,
excl
:
facts
[
:osfamily
]
!
=
'RedHat'
do
context
'when on RedHat family'
,
if
:
facts
[
:osfamily
]
=
=
'RedHat'
do
it
{
is_expected
.
to
contain_package
(
'mailx'
)
}
it
{
is_expected
.
to
contain_package
(
'mailx'
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/mailname'
).
with_seltype
(
'postfix_etc_t'
).
with_content
(
"foo.example.com
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/mailname'
).
with_seltype
(
'postfix_etc_t'
).
with_content
(
"foo.example.com
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
postfix_master_cf_path
).
with_seltype
(
'postfix_etc_t'
)
}
it
{
is_expected
.
to
contain_file
(
postfix_master_cf_path
).
with_seltype
(
'postfix_etc_t'
)
}
...
@@ -69,7 +69,7 @@ describe 'postfix' do
...
@@ -69,7 +69,7 @@ describe 'postfix' do
it
{
is_expected
.
to
contain_postfix__config
(
'newaliases_path'
)
}
it
{
is_expected
.
to
contain_postfix__config
(
'newaliases_path'
)
}
it
{
is_expected
.
to
contain_postfix__config
(
'mailq_path'
)
}
it
{
is_expected
.
to
contain_postfix__config
(
'mailq_path'
)
}
context
'when on release 8'
,
excl
:
(
facts
[
:osfamily
]
!
=
'RedHat'
||
facts
[
:operatingsystemmajrelease
]
!
=
'8'
)
do
context
'when on release 8'
,
if
:
(
facts
[
:osfamily
]
=
=
'RedHat'
&&
facts
[
:operatingsystemmajrelease
]
=
=
'8'
)
do
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
it
{
is_expected
.
to
contain_service
(
'postfix'
).
with
(
is_expected
.
to
contain_service
(
'postfix'
).
with
(
...
@@ -81,7 +81,7 @@ describe 'postfix' do
...
@@ -81,7 +81,7 @@ describe 'postfix' do
}
}
end
end
context
'when on release 7'
,
excl
:
(
facts
[
:osfamily
]
!
=
'RedHat'
||
facts
[
:operatingsystemmajrelease
]
!
=
'7'
)
do
context
'when on release 7'
,
if
:
(
facts
[
:osfamily
]
=
=
'RedHat'
&&
facts
[
:operatingsystemmajrelease
]
=
=
'7'
)
do
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
it
{
is_expected
.
to
contain_service
(
'postfix'
).
with
(
is_expected
.
to
contain_service
(
'postfix'
).
with
(
...
@@ -93,7 +93,7 @@ describe 'postfix' do
...
@@ -93,7 +93,7 @@ describe 'postfix' do
}
}
end
end
context
'when on release 6'
,
excl
:
(
facts
[
:osfamily
]
!
=
'RedHat'
||
facts
[
:operatingsystemmajrelease
]
!
=
'6'
)
do
context
'when on release 6'
,
if
:
(
facts
[
:osfamily
]
=
=
'RedHat'
&&
facts
[
:operatingsystemmajrelease
]
=
=
'6'
)
do
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
it
{
is_expected
.
to
contain_service
(
'postfix'
).
with
(
is_expected
.
to
contain_service
(
'postfix'
).
with
(
...
@@ -103,8 +103,10 @@ describe 'postfix' do
...
@@ -103,8 +103,10 @@ describe 'postfix' do
restart:
'/etc/init.d/postfix reload'
restart:
'/etc/init.d/postfix reload'
)
)
}
}
end
end
context
'when on Fedora'
,
excl
:
facts
[
:operatingsystem
]
!
=
'Fedora'
do
context
'when on Fedora'
,
if
:
facts
[
:operatingsystem
]
=
=
'Fedora'
do
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
it
{
is_expected
.
to
contain_service
(
'postfix'
).
with
(
is_expected
.
to
contain_service
(
'postfix'
).
with
(
...
@@ -115,22 +117,6 @@ describe 'postfix' do
...
@@ -115,22 +117,6 @@ describe 'postfix' do
)
)
}
}
end
end
context
(
'when on other'
,
excl:
(
facts
[
:osfamily
]
!=
'RedHat'
||
facts
[
:operatingsystem
]
==
'Fedora'
||
%w[6 7 8]
.
include?
(
facts
[
:operatingsystemmajrelease
])))
do
context
(
'on Linux'
,
excl:
facts
[
:osfamily
]
!=
'Linux'
)
do
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'postfix_etc_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
end
it
{
is_expected
.
to
contain_service
(
'postfix'
).
with
(
ensure:
'running'
,
enable:
'true'
,
hasstatus:
'true'
,
restart:
'/etc/init.d/postfix reload'
)
}
end
end
end
end
end
context
'when setting parameters'
do
context
'when setting parameters'
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
sign in
to comment