Colleen Murphy 65c5bb3d95 Depend on helper gem for spec_helper_acceptance
Instead of keeping a local copy of spec_helper_acceptance.rb and
requiring updates to all modules for any change, we can move it into the
common helper gem and require it from there. This will make it easier to
create and review changes that affect all puppet modules. Also change
the Gemfile to look for the gem in the local workspace if running in a
zuul environment.

Change-Id: I4f8f403452416a1b6203684e1b6d7b5e2743dce3
2017-08-18 10:40:36 +02:00

47 lines
1.4 KiB
Ruby

require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance'
describe 'puppet-ansible module' do
def pp_path
base_path = File.dirname(__FILE__)
File.join(base_path, 'fixtures')
end
def default_puppet_module
module_path = File.join(pp_path, 'default.pp')
File.read(module_path)
end
it 'should work with no errors' do
apply_manifest(default_puppet_module, catch_failures: true)
end
# Idempotency check disabled because pip with specified version isn't idempotent
# it 'should be idempotent', :if => ['debian', 'ubuntu'].include?(os[:family]) do
# apply_manifest(default_puppet_module, catch_changes: true)
# end
# it 'should be idempotent', :if => ['fedora', 'redhat'].include?(os[:family]) do
# pending('this module is not idempotent on CentOS yet')
# apply_manifest(default_puppet_module, catch_changes: true)
# end
describe 'required python package' do
describe package('ansible') do
it { should be_installed.by('pip') }
end
end
describe 'required files' do
describe file('/etc/ansible/ansible.cfg') do
it { should be_file }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
its(:content) { should include 'library=/usr/share/ansible' }
end
describe file('/etc/logrotate.d/ansible') do
its(:content) { should include '/var/log/ansible.log' }
end
end
end