summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaitĂȘ Balhester <mbalhest@thoughtworks.com>2015-11-12 15:54:03 -0200
committerMaitĂȘ Balhester <mbalhest@thoughtworks.com>2015-11-12 16:12:34 -0200
commit1efab539f95e865fb30f27c5d2bf08376ac0c845 (patch)
tree9b3bf2461650e6eaabfc659757ede9cb30026f25
parentc12c3e00a475886da85f588e894e98e5cf237865 (diff)
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
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: yolanda.robla <info@ysoft.biz> Code-Review+2: Spencer Krum <nibz@spencerkrum.com> Workflow+1: Spencer Krum <nibz@spencerkrum.com> Code-Review+1: Glauco Oliveira <gvinici@thoughtworks.com> Code-Review+1: Danilo Ramalho <dramalho@thoughtworks.com> Code-Review+1: Bruno Tavares <btavare@thoughtworks.com> Submitted-by: Jenkins Submitted-at: Tue, 17 Nov 2015 20:53:54 +0000 Reviewed-on: https://review.openstack.org/244796 Project: openstack-infra/puppet-haveged Branch: refs/heads/master
-rw-r--r--.gitignore3
-rw-r--r--Gemfile3
-rw-r--r--spec/acceptance/basic_spec.rb30
-rw-r--r--spec/acceptance/fixtures/default.pp1
4 files changed, 37 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index dade81e..ea90996 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,5 @@
1Gemfile.lock 1Gemfile.lock
2.bundled_gems/ 2.bundled_gems/
3log/
4junit/
5.vagrant/
diff --git a/Gemfile b/Gemfile
index 96912da..d69f807 100644
--- a/Gemfile
+++ b/Gemfile
@@ -24,7 +24,10 @@ group :development, :test do
24 else 24 else
25 gem 'puppet', '~> 3.0', :require => false 25 gem 'puppet', '~> 3.0', :require => false
26 end 26 end
27end
27 28
29group :system_tests do
30 gem 'beaker-rspec', :require => false
28end 31end
29 32
30# vim:ft=ruby 33# vim:ft=ruby
diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb
new file mode 100644
index 0000000..ae9a7d3
--- /dev/null
+++ b/spec/acceptance/basic_spec.rb
@@ -0,0 +1,30 @@
1require 'spec_helper_acceptance'
2
3describe 'puppet-haveged module' do
4 def pp_path
5 base_path = File.dirname(__FILE__)
6 File.join(base_path, 'fixtures')
7 end
8
9 def default_puppet_module
10 module_path = File.join(pp_path, 'default.pp')
11 File.read(module_path)
12 end
13
14 it 'should work with no errors' do
15 apply_manifest(default_puppet_module, catch_failures: true)
16 end
17
18 it 'should be idempotent' do
19 apply_manifest(default_puppet_module, catch_changes: true)
20 end
21
22 describe package('haveged') do
23 it { should be_installed }
24 end
25
26 describe service('haveged') do
27 it { should be_enabled }
28 it { should be_running }
29 end
30end
diff --git a/spec/acceptance/fixtures/default.pp b/spec/acceptance/fixtures/default.pp
new file mode 100644
index 0000000..e92a079
--- /dev/null
+++ b/spec/acceptance/fixtures/default.pp
@@ -0,0 +1 @@
class { '::haveged': }