]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(IAC-1025) Fix spec test helper method
authorCiaran McCrisken <ciaran.mccrisken@puppet.com>
Wed, 5 Aug 2020 16:13:09 +0000 (17:13 +0100)
committerCiaran McCrisken <ciaran.mccrisken@puppet.com>
Wed, 5 Aug 2020 16:13:09 +0000 (17:13 +0100)
Tests failing on RHEL systems as the `install_iptables` method
always assumed it was running against Debian / Ubuntu.

spec/spec_helper_acceptance_local.rb

index ca4783aabbbbc29de8d61870f28cf65e28e050bf..6682c44ccbc380a9d9c12c6543786d8647155fed 100644 (file)
@@ -20,7 +20,11 @@ end
 def install_iptables
   run_shell('iptables -V')
 rescue
-  run_shell('apt-get install iptables -y')
+  if os[:family] == 'redhat'
+    run_shell('yum install iptables-services -y')
+  else
+    run_shell('apt-get install iptables -y')
+  end
 end
 
 def iptables_version