Révision 7030bde0
Add bridge as a valid family for chain tables
spec/defines/chain_spec.rb | ||
---|---|---|
61 | 61 |
) |
62 | 62 |
} |
63 | 63 |
|
64 |
context('with table set to ip6-foo') do |
|
65 |
let(:params) do |
|
66 |
{ |
|
67 |
table: 'ip6-foo', |
|
68 |
} |
|
69 |
end |
|
64 |
%w[ip ip6 inet bridge netdev].each do |family| |
|
65 |
context("with table set to #{family}-foo") do |
|
66 |
let(:params) do |
|
67 |
{ |
|
68 |
table: "#{family}-foo", |
|
69 |
} |
|
70 |
end |
|
70 | 71 |
|
71 |
it { |
|
72 |
expect(subject).to contain_concat('nftables-ip6-foo-chain-MYCHAIN').with(
|
|
73 |
path: '/etc/nftables/puppet-preflight/ip6-foo-chain-MYCHAIN.nft',
|
|
74 |
owner: 'root', |
|
75 |
group: 'root', |
|
76 |
mode: nft_mode, |
|
77 |
ensure_newline: true |
|
78 |
) |
|
79 |
} |
|
72 |
it {
|
|
73 |
expect(subject).to contain_concat("nftables-#{family}-foo-chain-MYCHAIN").with(
|
|
74 |
path: "/etc/nftables/puppet-preflight/#{family}-foo-chain-MYCHAIN.nft",
|
|
75 |
owner: 'root',
|
|
76 |
group: 'root',
|
|
77 |
mode: nft_mode,
|
|
78 |
ensure_newline: true
|
|
79 |
)
|
|
80 |
}
|
|
80 | 81 |
|
81 |
it { |
|
82 |
expect(subject).to contain_file('/etc/nftables/puppet/ip6-foo-chain-MYCHAIN.nft').with(
|
|
83 |
ensure: 'file', |
|
84 |
source: '/etc/nftables/puppet-preflight/ip6-foo-chain-MYCHAIN.nft',
|
|
85 |
mode: nft_mode, |
|
86 |
owner: 'root', |
|
87 |
group: 'root' |
|
88 |
) |
|
89 |
} |
|
82 |
it {
|
|
83 |
expect(subject).to contain_file("/etc/nftables/puppet/#{family}-foo-chain-MYCHAIN.nft").with(
|
|
84 |
ensure: 'file',
|
|
85 |
source: "/etc/nftables/puppet-preflight/#{family}-foo-chain-MYCHAIN.nft",
|
|
86 |
mode: nft_mode,
|
|
87 |
owner: 'root',
|
|
88 |
group: 'root'
|
|
89 |
)
|
|
90 |
}
|
|
90 | 91 |
|
91 |
it { |
|
92 |
expect(subject).to contain_concat__fragment('nftables-ip6-foo-chain-MYCHAIN-header').with(
|
|
93 |
order: '00', |
|
94 |
content: "# Start of fragment order:00 MYCHAIN header\nchain MYCHAIN {", |
|
95 |
target: 'nftables-ip6-foo-chain-MYCHAIN'
|
|
96 |
) |
|
97 |
} |
|
92 |
it {
|
|
93 |
expect(subject).to contain_concat__fragment("nftables-#{family}-foo-chain-MYCHAIN-header").with(
|
|
94 |
order: '00',
|
|
95 |
content: "# Start of fragment order:00 MYCHAIN header\nchain MYCHAIN {",
|
|
96 |
target: "nftables-#{family}-foo-chain-MYCHAIN"
|
|
97 |
)
|
|
98 |
}
|
|
98 | 99 |
|
99 |
it { |
|
100 |
expect(subject).to contain_concat__fragment('nftables-ip6-foo-chain-MYCHAIN-footer').with( |
|
101 |
order: '99', |
|
102 |
content: "# Start of fragment order:99 MYCHAIN footer\n}", |
|
103 |
target: 'nftables-ip6-foo-chain-MYCHAIN' |
|
104 |
) |
|
105 |
} |
|
100 |
it { |
|
101 |
expect(subject).to contain_concat__fragment("nftables-#{family}-foo-chain-MYCHAIN-footer").with( |
|
102 |
order: '99', |
|
103 |
content: "# Start of fragment order:99 MYCHAIN footer\n}", |
|
104 |
target: "nftables-#{family}-foo-chain-MYCHAIN" |
|
105 |
) |
|
106 |
} |
|
107 |
end |
|
106 | 108 |
end |
107 | 109 |
|
108 | 110 |
context 'with inject set to 22-foobar' do |
Formats disponibles : Unified diff