Merge "Add beaker tests"

This commit is contained in:
Zuul 2018-10-15 17:09:48 +00:00 committed by Gerrit Code Review
commit 563c437cd0
2 changed files with 59 additions and 0 deletions

27
spec/acceptance/basic_spec.rb Executable file
View File

@ -0,0 +1,27 @@
require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance'
describe 'gerritbot', 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('gerritbot') do
it { should be_running }
end
end

View File

@ -0,0 +1,32 @@
$gerritbot_ssh_rsa_pubkey_contents = 'ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFnYsbHrGl99in5doo1uy+V3N3ayR4J0/sJprK+7E8exDwAGe1vZmUftjZ6uMi4RckxuFTuVJdxrFvTLEQpNrSU='
$gerritbot_ssh_rsa_key_contents = 'MHcCAQEEIJUIOR4hPwqds8ESewPHm+r5ejSqjuFjBfVa7jQTH99QoAoGCCqGSM49
AwEHoUQDQgAEWdixsesaX32Kfl2ijW7L5Xc3drJHgnT+wmmsr7sTx7EPAAZ7W9mZ
R+2Nnq4yLhFyTG4VO5Ul3GsW9MsRCk2tJQ==
-----END EC PRIVATE KEY-----'
file { '/etc/gerritbot-channels.yaml':
ensure => present,
content => '',
}
include gerrit::user
file { '/home/gerrit2/.ssh':
ensure => directory,
owner => 'gerrit2',
mode => '0700',
require => User['gerrit2'],
}
class { 'gerritbot':
nick => 'openstackgerrit',
password => 'gerritbot_password',
server => 'irc.freenode.net',
user => 'gerritbot',
vhost_name => 'review.openstack.org',
ssh_rsa_key_contents => $gerritbot_ssh_rsa_key_contents,
ssh_rsa_pubkey_contents => $gerritbot_ssh_rsa_pubkey_contents,
channel_file => '/etc/gerritbot-channels.yaml',
require => File['/etc/gerritbot-channels.yaml'],
}