PageRenderTime 48ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/sewer2/cb-iptables-ng
Ruby | 22 lines | 17 code | 5 blank | 0 comment | 2 complexity | 04416b0f318c8a5f590c78496809f555 MD5 | raw file
  1. require File.expand_path('../support/helpers', __FILE__)
  2. describe 'iptables-ng::lwrp_chain_create_empty' do
  3. include Helpers::TestHelpers
  4. it 'should create empty custom chain' do
  5. file('/etc/iptables.d/filter/EMPTY/default').must_include('- [0:0]')
  6. end
  7. it 'should enable iptables serices' do
  8. service(node['iptables-ng']['service_ipv4']).must_be_enabled if node['iptables-ng']['service_ipv4']
  9. service(node['iptables-ng']['service_ipv6']).must_be_enabled if node['iptables-ng']['service_ipv6']
  10. end
  11. it 'should apply the specified iptables rules' do
  12. ipv4 = shell_out('iptables -L -n')
  13. ipv4.stdout.must_include('Chain EMPTY (0 references)')
  14. ipv6 = shell_out('ip6tables -L -n')
  15. ipv6.stdout.must_include('Chain EMPTY (0 references)')
  16. end
  17. end