puppet-jenkins/spec/acceptance/master_spec.rb
Colleen Murphy 3a1e5525fd Remove unnecessary beaker tests
We don't need beaker to check that every single file and package is
installed. It is safe to assume that if puppet ran successfully then it
was also able to successfully find and install packages and apply config
files. Rather than update the tests to reflect new names of Java
packages on xenial, we can reduce maintenance costs by just removing the
tests.

It's important to keep tests that check that the service is running and
working correctly, because it is possible for puppet to claim success
but for the application to not be working.

Change-Id: Ifd41b858812638191049f415bbdf78c1f3145e46
2017-06-11 16:10:52 +02:00

51 lines
1.3 KiB
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 http://127.0.0.1 --verbose') do
its(:stdout) { should contain('302 Found') }
its(:stdout) { should contain('The document has moved') }
end
describe command('curl http://127.0.0.1 --insecure --location --verbose') do
its(:stdout) { should contain('Jenkins') }
end
describe command('curl https://127.0.0.1 --insecure') do
its(:stdout) { should contain('Jenkins') }
end
describe command('curl 127.0.0.1:8080') do
its(:stdout) { should contain('Jenkins') }
end
end
end