summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-11-21 22:49:09 +0000
committerGerrit Code Review <review@openstack.org>2018-11-21 22:49:09 +0000
commitb7cbc13e2b20f84733903aacdfc1eaf318a4479a (patch)
treef8e45cb43308253e4046eb46fdf7da25d0bd5849
parent3ffe437dbfef747d56cd9df643d0354af5ed39b6 (diff)
parentb6c60c0414279b4f3ad1bca2aacf65b6a7c85c7f (diff)
Merge "Add beaker tests"HEADmaster
-rwxr-xr-xspec/acceptance/basic_spec.rb36
-rw-r--r--spec/acceptance/fixtures/default.pp15
-rw-r--r--spec/acceptance/fixtures/postconditions.pp3
3 files changed, 54 insertions, 0 deletions
diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb
new file mode 100755
index 0000000..abdbd2e
--- /dev/null
+++ b/spec/acceptance/basic_spec.rb
@@ -0,0 +1,36 @@
1require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance'
2
3describe 'statusbot' do
4
5 def pp_path
6 base_path = File.dirname(__FILE__)
7 File.join(base_path, 'fixtures')
8 end
9
10 def puppet_manifest
11 manifest_path = File.join(pp_path, 'default.pp')
12 File.read(manifest_path)
13 end
14
15 def postconditions_puppet_manifest
16 manifest_path = File.join(pp_path, 'postconditions.pp')
17 File.read(manifest_path)
18 end
19
20 it 'should work with no errors' do
21 apply_manifest(puppet_manifest, catch_failures: true)
22 end
23
24 it 'should be idempotent' do
25 apply_manifest(puppet_manifest, catch_changes: true)
26 end
27
28 it 'should start' do
29 apply_manifest(postconditions_puppet_manifest, catch_failures: true)
30 end
31
32 describe service('statusbot') do
33 it { should be_running }
34 end
35
36end
diff --git a/spec/acceptance/fixtures/default.pp b/spec/acceptance/fixtures/default.pp
new file mode 100644
index 0000000..190a69d
--- /dev/null
+++ b/spec/acceptance/fixtures/default.pp
@@ -0,0 +1,15 @@
1class { 'statusbot':
2 nick => 'statusbot-test',
3 password => 'statusbot-password',
4 server => 'irc.notreal.net',
5 channels => 'unrealchannel',
6 auth_nicks => 'statusbot-test',
7 wiki_user => 'dummy',
8 wiki_password => 'dummy',
9 wiki_url => 'dummy',
10 wiki_pageid => 'dummy',
11 wiki_successpageid => 'dummy',
12 wiki_successpageurl => 'dummy',
13 wiki_thankspageid => 'dummy',
14 wiki_thankspageurl => 'dummy',
15}
diff --git a/spec/acceptance/fixtures/postconditions.pp b/spec/acceptance/fixtures/postconditions.pp
new file mode 100644
index 0000000..8359147
--- /dev/null
+++ b/spec/acceptance/fixtures/postconditions.pp
@@ -0,0 +1,3 @@
1service { 'statusbot':
2 ensure => running,
3}