Add beaker tests
Add basic tests to ensure the puppet manifests can be applied cleanly and the service will start. Change-Id: I15a83e6d7c0449d0982fcc0a62dcab75766addec
This commit is contained in:
parent
8acf255563
commit
b285011749
36
spec/acceptance/basic_spec.rb
Executable file
36
spec/acceptance/basic_spec.rb
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance'
|
||||||
|
|
||||||
|
describe 'simpleproxy', if: os[:family] == 'ubuntu' do
|
||||||
|
|
||||||
|
def pp_path
|
||||||
|
base_path = File.dirname(__FILE__)
|
||||||
|
File.join(base_path, 'fixtures')
|
||||||
|
end
|
||||||
|
|
||||||
|
def puppet_manifest
|
||||||
|
manifest_path = File.join(pp_path, 'default.pp')
|
||||||
|
File.read(manifest_path)
|
||||||
|
end
|
||||||
|
|
||||||
|
def postconditions_puppet_manifest
|
||||||
|
manifest_path = File.join(pp_path, 'postconditions.pp')
|
||||||
|
File.read(manifest_path)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should work with no errors' do
|
||||||
|
apply_manifest(puppet_manifest, catch_failures: true)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should be idempotent' do
|
||||||
|
apply_manifest(puppet_manifest, catch_changes: true)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should start' do
|
||||||
|
apply_manifest(postconditions_puppet_manifest, catch_failures: true)
|
||||||
|
end
|
||||||
|
|
||||||
|
describe service('simpleproxy-mysql') do
|
||||||
|
it { should be_running }
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
5
spec/acceptance/fixtures/default.pp
Normal file
5
spec/acceptance/fixtures/default.pp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
include 'simpleproxy'
|
||||||
|
|
||||||
|
class { 'simpleproxy::server':
|
||||||
|
db_host => 'localhost',
|
||||||
|
}
|
3
spec/acceptance/fixtures/postconditions.pp
Normal file
3
spec/acceptance/fixtures/postconditions.pp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
service { 'simpleproxy-mysql':
|
||||||
|
ensure => running,
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user