Add acceptance tests for puppet-haveged
This patch adds some acceptance tests for puppet-haveged, making sure that we can applied it without errors and ensuring idempotency. Also we check if the packages are installed and the services are running. Change-Id: Ieab5554ddf45c0311d6de7e197c856c87cbccd92
This commit is contained in:
parent
c12c3e00a4
commit
1efab539f9
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,5 @@
|
||||
Gemfile.lock
|
||||
.bundled_gems/
|
||||
log/
|
||||
junit/
|
||||
.vagrant/
|
||||
|
3
Gemfile
3
Gemfile
@ -24,7 +24,10 @@ group :development, :test do
|
||||
else
|
||||
gem 'puppet', '~> 3.0', :require => false
|
||||
end
|
||||
end
|
||||
|
||||
group :system_tests do
|
||||
gem 'beaker-rspec', :require => false
|
||||
end
|
||||
|
||||
# vim:ft=ruby
|
||||
|
30
spec/acceptance/basic_spec.rb
Normal file
30
spec/acceptance/basic_spec.rb
Normal file
@ -0,0 +1,30 @@
|
||||
require 'spec_helper_acceptance'
|
||||
|
||||
describe 'puppet-haveged module' do
|
||||
def pp_path
|
||||
base_path = File.dirname(__FILE__)
|
||||
File.join(base_path, 'fixtures')
|
||||
end
|
||||
|
||||
def default_puppet_module
|
||||
module_path = File.join(pp_path, 'default.pp')
|
||||
File.read(module_path)
|
||||
end
|
||||
|
||||
it 'should work with no errors' do
|
||||
apply_manifest(default_puppet_module, catch_failures: true)
|
||||
end
|
||||
|
||||
it 'should be idempotent' do
|
||||
apply_manifest(default_puppet_module, catch_changes: true)
|
||||
end
|
||||
|
||||
describe package('haveged') do
|
||||
it { should be_installed }
|
||||
end
|
||||
|
||||
describe service('haveged') do
|
||||
it { should be_enabled }
|
||||
it { should be_running }
|
||||
end
|
||||
end
|
1
spec/acceptance/fixtures/default.pp
Normal file
1
spec/acceptance/fixtures/default.pp
Normal file
@ -0,0 +1 @@
|
||||
class { '::haveged': }
|
Loading…
x
Reference in New Issue
Block a user