diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb new file mode 100755 index 0000000..fb2e025 --- /dev/null +++ b/spec/acceptance/basic_spec.rb @@ -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 diff --git a/spec/acceptance/fixtures/default.pp b/spec/acceptance/fixtures/default.pp new file mode 100644 index 0000000..b45d4f1 --- /dev/null +++ b/spec/acceptance/fixtures/default.pp @@ -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', +} diff --git a/spec/acceptance/fixtures/postconditions.pp b/spec/acceptance/fixtures/postconditions.pp new file mode 100644 index 0000000..e5a5a02 --- /dev/null +++ b/spec/acceptance/fixtures/postconditions.pp @@ -0,0 +1,3 @@ +service { 'germqtt': + ensure => running, +}