Browse Source

Merge "Add beaker tests"

changes/03/647003/1
Zuul 6 months ago
parent
commit
b7cbc13e2b

+ 36
- 0
spec/acceptance/basic_spec.rb View File

@@ -0,0 +1,36 @@
1
+require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance'
2
+
3
+describe '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
+
36
+end

+ 15
- 0
spec/acceptance/fixtures/default.pp View File

@@ -0,0 +1,15 @@
1
+class { '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
+}

+ 3
- 0
spec/acceptance/fixtures/postconditions.pp View File

@@ -0,0 +1,3 @@
1
+service { 'statusbot':
2
+  ensure => running,
3
+}

Loading…
Cancel
Save