|
1 | | -require_relative '../../../kitchen/data/spec_helper' |
| 1 | +require 'serverspec' |
| 2 | + |
| 3 | +set :backend, :exec |
2 | 4 |
|
3 | 5 | describe iptables do |
4 | 6 | it { should have_rule('-A INPUT -j simple_rule') } |
5 | | - it { should have_rule('-A simple_rule -p tcp -m tcp --dport 80 -j ACCEPT') } |
6 | | - it { should have_rule('-A INPUT -p tcp -m tcp --dport 81 -j ACCEPT') } |
7 | | - it { should have_rule('-A FORWARD -p tcp -m tcp --dport 82 -j ACCEPT') } |
| 7 | + it { should have_rule('-A simple_rule -p tcp -m tcp --dport 80 -m comment --comment simple_rule -j ACCEPT') } |
| 8 | + it { should have_rule('-A INPUT -p tcp -m tcp --dport 81 -m comment --comment rule_in_input_chain -j ACCEPT') } |
| 9 | + it { should have_rule('-A FORWARD -p tcp -m tcp --dport 82 -m comment --comment rule_in_forward_chain -j ACCEPT') } |
8 | 10 | it { should have_rule('-A INPUT -m state --state NEW -j jump_with_rule') } |
9 | | - it { should have_rule('-A jump_with_rule -p tcp -m tcp --dport 83 -j ACCEPT') } |
10 | | - it { should have_rule('-A array_of_rules -p tcp -m tcp --dport 84 -j ACCEPT') } |
11 | | - it { should have_rule('-A array_of_rules -p tcp -m tcp --dport 85 -j ACCEPT') } |
| 11 | + it { should have_rule('-A jump_with_rule -p tcp -m tcp --dport 83 -m comment --comment jump_with_rule -j ACCEPT') } |
| 12 | + it { should have_rule('-A array_of_rules -p tcp -m tcp --dport 84 -m comment --comment array_of_rules -j ACCEPT') } |
| 13 | + it { should have_rule('-A array_of_rules -p tcp -m tcp --dport 85 -m comment --comment array_of_rules -j ACCEPT') } |
12 | 14 | it { should have_rule('-A INPUT -j array_of_rules') } |
13 | 15 | it { should_not have_rule('*nat') } |
14 | 16 | it { should have_rule('*mangle') } |
|
18 | 20 |
|
19 | 21 | describe ip6tables do |
20 | 22 | it { should have_rule('-A INPUT -j simple_rule') } |
21 | | - it { should have_rule('-A simple_rule -p tcp -m tcp --dport 80 -j ACCEPT') } |
22 | | - it { should have_rule('-A INPUT -p tcp -m tcp --dport 81 -j ACCEPT') } |
| 23 | + it { should have_rule('-A simple_rule -p tcp -m tcp --dport 80 -m comment --comment simple_rule -j ACCEPT') } |
| 24 | + it { should have_rule('-A INPUT -p tcp -m tcp --dport 81 -m comment --comment rule_in_input_chain -j ACCEPT') } |
23 | 25 | it { should_not have_rule('-A FORWARD -p tcp -m tcp --dport 82 -j ACCEPT') } |
24 | 26 | it { should_not have_rule('-A INPUT -m state --state NEW -j jump_with_rule') } |
25 | 27 | it { should_not have_rule('-A jump_with_rule -p tcp -m tcp --dport 83 -j ACCEPT') } |
26 | | - it { should have_rule('-A array_of_rules -p tcp -m tcp --dport 84 -j ACCEPT') } |
27 | | - it { should have_rule('-A array_of_rules -p tcp -m tcp --dport 85 -j ACCEPT') } |
| 28 | + it { should have_rule('-A array_of_rules -p tcp -m tcp --dport 84 -m comment --comment array_of_rules -j ACCEPT') } |
| 29 | + it { should have_rule('-A array_of_rules -p tcp -m tcp --dport 85 -m comment --comment array_of_rules -j ACCEPT') } |
28 | 30 | it { should have_rule('-A INPUT -j array_of_rules') } |
29 | 31 | it { should_not have_rule('*nat') } |
30 | 32 | it { should have_rule('*mangle') } |
|
0 commit comments