Add beaker tests
Add tests to ensure the asterisk class can be applied correctly and the service can start. Change-Id: I9714e040d6c73e7b0e8ce5d9fe91f2674214efa6
This commit is contained in:
parent
1211b073a3
commit
db3962c1a0
27
spec/acceptance/basic_spec.rb
Executable file
27
spec/acceptance/basic_spec.rb
Executable file
@ -0,0 +1,27 @@
|
||||
require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance'
|
||||
|
||||
describe 'asterisk', 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
|
||||
|
||||
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
|
||||
|
||||
describe service('asterisk') do
|
||||
it { should be_running }
|
||||
end
|
||||
|
||||
end
|
13
spec/acceptance/fixtures/default.pp
Normal file
13
spec/acceptance/fixtures/default.pp
Normal file
@ -0,0 +1,13 @@
|
||||
$config = '[modules](+)
|
||||
; Application modules
|
||||
load => app_confbridge.so
|
||||
load => chan_bridge.so'
|
||||
|
||||
file { '/tmp/asterisk-modules.conf':
|
||||
ensure => present,
|
||||
content => $config,
|
||||
}
|
||||
|
||||
class { 'asterisk':
|
||||
modules_conf_source => '/tmp/asterisk-modules.conf',
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user