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
688c9dbe
Commit
688c9dbe
authored
Jun 19, 2015
by
Mickaël Canévet
Browse files
Add acceptance test
parent
2b386877
Changes
2
Hide whitespace changes
Inline
Side-by-side
spec/acceptance/postfix_spec.rb
0 → 100644
View file @
688c9dbe
require
'spec_helper_acceptance'
describe
'postfix class'
do
context
'default parameters'
do
it
'should work idempotently with no errors'
do
pp
=
<<-
EOS
class { 'postfix': }
EOS
# Run it twice and test for idempotency
apply_manifest
(
pp
,
:catch_failures
=>
true
)
apply_manifest
(
pp
,
:catch_changes
=>
true
)
end
describe
package
(
'postfix'
)
do
it
{
is_expected
.
to
be_installed
}
end
describe
service
(
'postfix'
)
do
it
{
is_expected
.
to
be_enabled
}
it
{
is_expected
.
to
be_running
}
end
end
end
spec/spec_helper_acceptance.rb
0 → 100644
View file @
688c9dbe
require
'beaker-rspec'
require
'beaker_spec_helper'
include
BeakerSpecHelper
hosts
.
each
do
|
host
|
install_puppet_on
host
install_package
host
,
'git'
install_package
host
,
'tar'
install_package
host
,
'sudo'
on
host
,
'rm /usr/sbin/policy-rc.d || true'
end
RSpec
.
configure
do
|
c
|
module_root
=
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
))
module_name
=
module_root
.
split
(
'-'
).
last
# Readable test descriptions
c
.
formatter
=
:documentation
# Configure all nodes in nodeset
c
.
before
:suite
do
# Install module and dependencies
puppet_module_install
(
:source
=>
module_root
,
:module_name
=>
module_name
)
hosts
.
each
do
|
host
|
BeakerSpecHelper
::
spec_prep
(
host
)
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