Add beaker tests
Add basic tests to ensure the class can be applied and the service will start. Change-Id: I8fcdddb983bcf535e51e000408fd3678ef635846
This commit is contained in:
parent
955e43c960
commit
1e57d3237c
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 'germqtt' 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('germqtt') do
|
||||
it { should be_running }
|
||||
end
|
||||
|
||||
end
|
18
spec/acceptance/fixtures/default.pp
Normal file
18
spec/acceptance/fixtures/default.pp
Normal file
@ -0,0 +1,18 @@
|
||||
$gerrit_public_key = 'ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFnYsbHrGl99in5doo1uy+V3N3ayR4J0/sJprK+7E8exDwAGe1vZmUftjZ6uMi4RckxuFTuVJdxrFvTLEQpNrSU='
|
||||
|
||||
$gerrit_private_key = 'MHcCAQEEIJUIOR4hPwqds8ESewPHm+r5ejSqjuFjBfVa7jQTH99QoAoGCCqGSM49
|
||||
AwEHoUQDQgAEWdixsesaX32Kfl2ijW7L5Xc3drJHgnT+wmmsr7sTx7EPAAZ7W9mZ
|
||||
R+2Nnq4yLhFyTG4VO5Ul3GsW9MsRCk2tJQ==
|
||||
-----END EC PRIVATE KEY-----'
|
||||
|
||||
$gerrit_ssh_host_key = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCfsIj/jqpI+2CFdjCL6kOiqdORWvxQ2sQbCzSzzmLXic8yVhCCbwarkvEpfUOHG4eyB0vqVZfMffxf0Yy3qjURrsroBCiuJ8GdiAcGdfYwHNfBI0cR6kydBZL537YDasIk0Z3ILzhwf7474LmkVzS7V2tMTb4ZiBS/jUeiHsVp88FZhIBkyhlb/awAGcUxT5U4QBXCAmerYXeB47FPuz9JFOVyF08LzH9JRe9tfXtqaCNhlSdRe/2pPRvn2EIhn5uHWwATACG9MBdrK8xv8LqPOik2w1JkgLWyBj11vDd5I3IjrmREGw8dqImqp0r6MD8rxqADlc1elfDIXYsy+TVH'
|
||||
|
||||
include germqtt
|
||||
class {'germqtt::server':
|
||||
gerrit_username => 'gerrit_username',
|
||||
gerrit_public_key => $gerrit_public_key,
|
||||
gerrit_private_key => $gerrit_private_key,
|
||||
gerrit_ssh_host_key => $gerrit_ssh_host_key,
|
||||
mqtt_username => 'mqtt_username',
|
||||
mqtt_password => 'mqtt_password',
|
||||
}
|
3
spec/acceptance/fixtures/postconditions.pp
Normal file
3
spec/acceptance/fixtures/postconditions.pp
Normal file
@ -0,0 +1,3 @@
|
||||
service { 'germqtt':
|
||||
ensure => running,
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user