
This was added by commit de7975c--Gerrit change 7--so old it predates Change-Id headers in the repo (and, apparently, commit messages). Today it seems to be completely unused. The pubring.gpg contained just this one key: pub 2048R/32EE128C 2010-08-15 uid OpenStack Hudson <hudson@openstack.org> sub 2048R/92E212FC 2010-08-15 Based on discussion in IRC, Monty vaguely recalls this might have been related to DEB package building once upon a time (something we no longer do and wouldn't configure from this module anyway when eventually want to start doing again). Change-Id: I70c3b82185681ee64791cda653360c26a93bd466
187 lines
5.0 KiB
Ruby
187 lines
5.0 KiB
Ruby
require 'spec_helper_acceptance'
|
|
|
|
describe 'puppet-jenkins slave module', :if => ['debian', 'ubuntu'].include?(os[:family]) do
|
|
def pp_path
|
|
base_path = File.dirname(__FILE__)
|
|
File.join(base_path, 'fixtures')
|
|
end
|
|
|
|
def preconditions_puppet_module
|
|
module_path = File.join(pp_path, 'preconditions.pp')
|
|
File.read(module_path)
|
|
end
|
|
|
|
def jenkins_slave_puppet_module
|
|
module_path = File.join(pp_path, 'slave.pp')
|
|
File.read(module_path)
|
|
end
|
|
|
|
before(:all) do
|
|
apply_manifest(preconditions_puppet_module, catch_failures: true)
|
|
end
|
|
|
|
it 'should work with no errors' do
|
|
apply_manifest(jenkins_slave_puppet_module, catch_failures: true)
|
|
end
|
|
|
|
it 'should be idempotent' do
|
|
apply_manifest(jenkins_slave_puppet_module, catch_changes: true)
|
|
end
|
|
|
|
describe 'required files' do
|
|
describe file('/home/jenkins/.gitconfig') do
|
|
it { should be_file }
|
|
its(:content) { should match '[user]' }
|
|
its(:content) { should match 'name = OpenStack Jenkins' }
|
|
its(:content) { should match 'email = jenkins@openstack.org' }
|
|
its(:content) { should match '[gitreview]' }
|
|
its(:content) { should match 'username = jenkins' }
|
|
end
|
|
|
|
describe file('/home/jenkins/.m2/settings.xml') do
|
|
it { should be_file }
|
|
its(:content) { should match '<id>jenkins</id>' }
|
|
its(:content) { should match '<url>http://repo.jenkins-ci.org/public/</url>' }
|
|
end
|
|
|
|
describe file('/home/jenkins/.ssh/config') do
|
|
it { should be_file }
|
|
its(:content) { should match 'StrictHostKeyChecking=no' }
|
|
end
|
|
|
|
jenkins_user_directories = [
|
|
file('/home/jenkins/.pip'),
|
|
file('/home/jenkins/.config'),
|
|
]
|
|
|
|
jenkins_user_directories.each do |directory|
|
|
describe directory do
|
|
it { should be_directory }
|
|
it { should be_owned_by 'jenkins' }
|
|
it { should be_grouped_into 'jenkins' }
|
|
end
|
|
end
|
|
|
|
jenkins_user_files = [
|
|
file('/home/jenkins/.bash_logout'),
|
|
file('/home/jenkins/.bashrc'),
|
|
file('/home/jenkins/.profile'),
|
|
file('/home/jenkins/.ssh/authorized_keys'),
|
|
]
|
|
|
|
jenkins_user_files.each do |file|
|
|
describe file do
|
|
it { should be_file }
|
|
end
|
|
end
|
|
|
|
describe 'symlinkies' do
|
|
symlinkies = {
|
|
file('/usr/local/bin/c++') => '/usr/bin/ccache',
|
|
file('/usr/local/bin/cc') => '/usr/bin/ccache',
|
|
file('/usr/local/bin/g++') => '/usr/bin/ccache',
|
|
file('/usr/local/bin/gcc') => '/usr/bin/ccache',
|
|
}
|
|
|
|
symlinkies.each do |link, destination|
|
|
describe link do
|
|
it { should be_symlink }
|
|
it { should be_linked_to destination }
|
|
end
|
|
end
|
|
end
|
|
|
|
describe file('/usr/local/jenkins') do
|
|
it { should be_directory }
|
|
it { should be_owned_by 'root' }
|
|
it { should be_grouped_into 'root' }
|
|
end
|
|
end
|
|
|
|
describe 'required packages' do
|
|
if ['ubuntu', 'debian'].include?(os[:family]) then
|
|
required_packages = [
|
|
package('build-essential'),
|
|
package('ccache'),
|
|
package('maven2'),
|
|
package('openjdk-7-jdk'),
|
|
package('python-netaddr'),
|
|
package('ruby1.9.1'),
|
|
]
|
|
elsif ['centos', 'redhat'].include?(os[:family]) then
|
|
required_packages = [
|
|
package('ccache'),
|
|
package('java-1.7.0-openjdk-devel'),
|
|
package('python-netaddr'),
|
|
]
|
|
end
|
|
|
|
required_packages.each do |package|
|
|
describe package do
|
|
it { should be_installed }
|
|
end
|
|
end
|
|
|
|
unnecessary_packages = [
|
|
package('openjdk-6-jre-headless')
|
|
]
|
|
|
|
unnecessary_packages.each do |package|
|
|
describe package do
|
|
it { should_not be_installed }
|
|
end
|
|
end
|
|
|
|
pip_packages = [
|
|
package('git-review'),
|
|
package('tox'),
|
|
]
|
|
|
|
pip_packages.each do |package|
|
|
describe package do
|
|
it { should be_installed.by('pip') }
|
|
end
|
|
end
|
|
end
|
|
|
|
describe 'required users and groups' do
|
|
describe group('jenkins') do
|
|
it { should exist }
|
|
end
|
|
|
|
describe user('jenkins') do
|
|
it { should exist }
|
|
it { should belong_to_group 'jenkins' }
|
|
it { should have_home_directory '/home/jenkins' }
|
|
it { should have_login_shell '/bin/bash' }
|
|
end
|
|
end
|
|
end
|
|
|
|
describe 'puppet-jenkins jenkins-job-builder module', :if => ['debian', 'ubuntu'].include?(os[:family]) do
|
|
describe 'required files' do
|
|
describe file('/etc/jenkins_jobs/jenkins_jobs.ini') do
|
|
its(:content) { should match '[jenkins]' }
|
|
its(:content) { should match 'user=jenkins' }
|
|
its(:content) { should match 'password=secret' }
|
|
its(:content) { should match 'url=https://127.0.0.1' }
|
|
end
|
|
|
|
describe file('/etc/jenkins_jobs/config') do
|
|
it { should be_directory }
|
|
it { should be_owned_by 'root' }
|
|
it { should be_grouped_into 'root' }
|
|
end
|
|
end
|
|
|
|
describe 'required packages' do
|
|
describe package('python-jenkins') do
|
|
it { should be_installed.by('pip') }
|
|
end
|
|
|
|
describe package('python-yaml') do
|
|
it { should be_installed }
|
|
end
|
|
end
|
|
end
|