Add beaker tests
Add tests to ensure the subunit2sql server and worker classes work and that the worker service can start. Depends-On: https://review.openstack.org/581112 Change-Id: I842ecbcd5988484043643fdae1c49dd95bba90f2
This commit is contained in:
parent
8360c894db
commit
6551709ce5
36
spec/acceptance/basic_spec.rb
Normal file
36
spec/acceptance/basic_spec.rb
Normal file
@ -0,0 +1,36 @@
|
||||
require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance'
|
||||
|
||||
describe 'subunit2sql', :if => ['debian', 'ubuntu'].include?(os[:family]) 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('jenkins-subunit-worker-A') do
|
||||
it { should be_running }
|
||||
end
|
||||
|
||||
end
|
30
spec/acceptance/fixtures/default.pp
Normal file
30
spec/acceptance/fixtures/default.pp
Normal file
@ -0,0 +1,30 @@
|
||||
$content = "gearman-host: logstash.openstack.org
|
||||
gearman-port: 4730
|
||||
config: /etc/subunit2sql/subunit2sql.conf
|
||||
mqtt-host: firehose.openstack.org
|
||||
mqtt-port: 8883
|
||||
mqtt-topic: gearman-subunit/localhost
|
||||
mqtt-user: 'mqtt_user'
|
||||
mqtt-pass: 'mqtt_pass'
|
||||
mqtt-ca-certs: /etc/subunit2sql/mqtt-root-CA.pem.crt"
|
||||
|
||||
file { '/etc/subunit2sql/subunit-woker.yaml':
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0555',
|
||||
content => $content,
|
||||
}
|
||||
|
||||
include 'subunit2sql'
|
||||
|
||||
class { 'subunit2sql::server':
|
||||
db_host => 'subunit2sql_db_host',
|
||||
db_pass => 'subunit2sql_db_pass',
|
||||
}
|
||||
|
||||
subunit2sql::worker { 'A':
|
||||
config_file => '/etc/subunit2sql/subunit-woker.yaml',
|
||||
db_host => $subunit2sql_db_host,
|
||||
db_pass => $subunit2sql_db_pass,
|
||||
}
|
3
spec/acceptance/fixtures/postconditions.pp
Normal file
3
spec/acceptance/fixtures/postconditions.pp
Normal file
@ -0,0 +1,3 @@
|
||||
service { 'jenkins-subunit-worker-A':
|
||||
ensure => running,
|
||||
}
|
Loading…
Reference in New Issue
Block a user