puppet-jenkins/spec/acceptance/master_spec.rb
Colleen Murphy c476756cd6 Fix SSL in beaker tests
The snakeoil package uses the host's fqdn for the cert's CN, which means
trying to use '127.0.0.1' as the JJB URL will fail with an SSL error,
and the curl tests will also fail. JJB also doesn't have --insecure or
--cafle options, so it gets a SSL_CERTIFICATE_VERIFY_FAILED when trying
to run. Use the fqdn everywhere instead of the localhost address, and
add the snakeoil certs to the system's trusted bundle.

Change-Id: Iac97910b0d04eada62dd161341ee246a9cf3ebf8
2017-06-11 16:41:15 +02:00

38 lines
981 B
Ruby

require 'spec_helper_acceptance'
describe 'puppet-jenkins master 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_master_puppet_module
module_path = File.join(pp_path, 'master.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_master_puppet_module, catch_failures: true)
end
it 'should be idempotent' do
apply_manifest(jenkins_master_puppet_module, catch_changes: true)
end
describe 'required services' do
describe command('curl https://`hostname -f`/login --insecure --location --verbose') do
its(:stdout) { should contain('Jenkins') }
end
end
end