puppet-tripleo/spec/defines/tripleo_firewall_service_rules_spec.rb
Cédric Jeanneret 2f7d622b0a correct unit tests
Moved to on_supported_os instead of hard-coded list

Change-Id: Id501931b7cb32463680cc861ab4e70230e2d98d1
2017-12-16 09:36:18 +01:00

38 lines
863 B
Ruby

require 'spec_helper'
describe 'tripleo::firewall::service_rules' do
let :pre_condition do
'include ::tripleo::firewall'
end
shared_examples_for 'tripleo firewall service rules' do
context 'with existing service_rules' do
let(:title) { 'dynamic-rules' }
it 'should compile' do
is_expected.to compile.with_all_deps
end
it 'should configure firewall' do
is_expected.to contain_tripleo__firewall__rule('11-neutron')
end
end
context 'with NON-existing service_rules' do
let(:title) { 'no-rules' }
it 'should compile' do
is_expected.to compile.with_all_deps
end
end
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({})
end
it_behaves_like 'tripleo firewall service rules'
end
end
end