--- /dev/null
+HOSTS:
+ centos-7-x64:
+ roles:
+ - master
+ platform: el-7-x86_64
+ box : puppetlabs/centos-7.0-64-nocm
+ box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-7.0-64-virtualbox-nocm.box
+ hypervisor : vagrant
+CONFIG:
+ type: foss
+ log_level: verbose
\ No newline at end of file
--- /dev/null
+require 'spec_helper_acceptance'
+
+describe 'firewall on RHEL7', :unless => (UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) || !is_rhel7( !is_rhel7( fact('osfamily'), fact('operatingsystem'), fact('operatingsystemrelease') ) ) do
+ before :all do
+ iptables_flush_all_tables
+ end
+
+ it 'should run successfully' do
+ pp = "
+ class { 'firewall':
+ remove_firewalld => true,
+ }
+ ->
+ resources { 'firewall':
+ purge => true,
+ }
+ ->
+ firewall { '555 - test':
+ proto => tcp,
+ port => '555',
+ action => accept,
+ }
+ "
+
+ # Run it twice and test for idempotency
+ apply_manifest(pp, :catch_failures => true, :debug => true)
+ expect(apply_manifest(pp, :catch_failures => true, :debug => true).exit_code).to be_zero
+ end
+
+end
end
end
+def is_rhel7(osfamily, operatingsystem, operatingsystemrelease)
+ if osfamily == 'RedHat'
+ case operatingsystem
+ when 'Amazon'
+ false
+ when 'Fedora'
+ operatingsystemrelease >= '7.0'
+ else
+ operatingsystemrelease >= '15'
+ end
+ else
+ false
+ end
+end
+
unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
# This will install the latest available package on el and deb based
# systems fail on windows and osx, and install via gem on other *nixes