require 'spec_helper_acceptance'
-describe 'firewall type' do
+describe 'firewall type', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe 'reset' do
it 'deletes all rules' do
shell('iptables --flush; iptables -t nat --flush; iptables -t mangle --flush')
require 'spec_helper_acceptance'
-describe "firewall class:" do
+describe "firewall class:", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
it 'should run successfully' do
pp = "class { 'firewall': }"
require 'spec_helper_acceptance'
-describe 'firewall type' do
+describe 'firewall type', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe 'connlimit_above' do
context '10' do
require 'spec_helper_acceptance'
-describe 'firewall type' do
+describe 'firewall type', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe 'connmark' do
context '50' do
require 'spec_helper_acceptance'
-describe 'firewall type' do
+describe 'firewall type', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe 'reset' do
it 'deletes all rules' do
require 'spec_helper_acceptance'
-describe 'puppet resource firewallchain command:' do
+describe 'puppet resource firewallchain command:', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
before :all do
iptables_flush_all_tables
end
require 'spec_helper_acceptance'
if default['platform'] =~ /el-5/
- describe "firewall ip6tables doesn't work on 1.3.5 because --comment is missing" do
+ describe "firewall ip6tables doesn't work on 1.3.5 because --comment is missing", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
before :all do
ip6tables_flush_all_tables
end
end
end
else
- describe 'firewall ishasmorefrags/islastfrag/isfirstfrag properties' do
+ describe 'firewall ishasmorefrags/islastfrag/isfirstfrag properties', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
before :all do
ip6tables_flush_all_tables
end
require 'spec_helper_acceptance'
-describe 'firewall isfragment property' do
+describe 'firewall isfragment property', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
before :all do
iptables_flush_all_tables
end
require 'spec_helper_acceptance'
-describe "param based tests:" do
+describe "param based tests:", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
# Takes a hash and converts it into a firewall resource
def pp(params)
name = params.delete('name') || '100 test'
require 'spec_helper_acceptance'
-describe "purge tests:" do
+describe "purge tests:", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
context('resources purge') do
before(:all) do
iptables_flush_all_tables
# Here we want to test the the resource commands ability to work with different
# existing ruleset scenarios. This will give the parsing capabilities of the
# code a good work out.
-describe 'puppet resource firewall command:' do
+describe 'puppet resource firewall command:', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
context 'make sure it returns no errors when executed on a clean machine' do
it do
shell('puppet resource firewall') do |r|
require 'spec_helper_acceptance'
-describe 'complex ruleset 1' do
+describe 'complex ruleset 1', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
before :all do
iptables_flush_all_tables
end
require 'spec_helper_acceptance'
# RHEL5 does not support -m socket
-describe 'firewall socket property', :unless => (default['platform'] =~ /el-5/ || fact('operatingsystem') == 'SLES') do
+describe 'firewall socket property', :unless => (UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) || default['platform'] =~ /el-5/ || fact('operatingsystem') == 'SLES') do
before :all do
iptables_flush_all_tables
end
require 'spec_helper_acceptance'
# Some tests for the standard recommended usage
-describe 'standard usage tests:' do
+describe 'standard usage tests:', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
it 'applies twice' do
pp = <<-EOS
class my_fw::pre {
--- /dev/null
+require 'spec_helper_acceptance'
+
+describe 'unsupported distributions and OSes', :if => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
+ it 'should fail' do
+ pp = <<-EOS
+ class { 'firewall': }
+ EOS
+ expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/not currently supported/i)
+ end
+end
end
end
+UNSUPPORTED_PLATFORMS = ['windows','Solaris','Darwin']
+
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))