Skip to content
Snippets Groups Projects
Commit 688c9dbe authored by Mickaël Canévet's avatar Mickaël Canévet
Browse files

Add acceptance test

parent 2b386877
No related branches found
No related tags found
No related merge requests found
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment