PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/test/cookbooks/iptables_ng_test/files/default/tests/minitest/lwrp_rule_delete_test.rb

https://github.com/sewer2/cb-iptables-ng
Ruby | 26 lines | 20 code | 6 blank | 0 comment | 2 complexity | 32d66b08304200ae53b236d284ece81c MD5 | raw file
  1. require File.expand_path('../support/helpers', __FILE__)
  2. describe 'iptables-ng::lwrp_rule_delete' do
  3. include Helpers::TestHelpers
  4. it 'should not set HTTP rule' do
  5. file('/etc/iptables.d/filter/INPUT/http.rule_v4').wont_exist
  6. end
  7. it 'should not set HTTP ip6tables rule' do
  8. file('/etc/iptables.d/filter/INPUT/http.rule_v6').wont_exist
  9. end
  10. it 'should enable iptables serices' do
  11. service(node['iptables-ng']['service_ipv4']).must_be_enabled if node['iptables-ng']['service_ipv4']
  12. service(node['iptables-ng']['service_ipv6']).must_be_enabled if node['iptables-ng']['service_ipv6']
  13. end
  14. it 'should apply the specified iptables rules' do
  15. ipv4 = shell_out('iptables -L -n')
  16. ipv4.stdout.wont_include('tcp dpt:80 state NEW')
  17. ipv6 = shell_out('ip6tables -L -n')
  18. ipv6.stdout.wont_include('tcp dpt:80 state NEW')
  19. end
  20. end