Skip to content

Commit 51834d6

Browse files
committed
(CAT-761) Implement acceptance testing of purge and associated attributes ignore/ignore_foreign
- Updates `ignore` to compare against firewall read only attribute `line` rather than `name` as it allows for a greater degree of control. - Contains small updates to other acceptance tests.
1 parent 4069d08 commit 51834d6

File tree

6 files changed

+404
-380
lines changed

6 files changed

+404
-380
lines changed

lib/puppet/provider/firewallchain/firewallchain.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def generate(_context, title, _is, should)
189189
# Remove rules which match our ignore filter
190190
# Ensure ignore value is wrapped as an array to simplify the code
191191
should[:ignore] = [should[:ignore]] if should[:ignore].is_a?(String)
192-
rules_resources.delete_if { |resource| should[:ignore].find_index { |ignore| resource.rsapi_current_state[:name].match(ignore) } } if should[:ignore]
192+
rules_resources.delete_if { |resource| should[:ignore].find_index { |ignore| resource.rsapi_current_state[:line].match(ignore) } } if should[:ignore]
193193

194194
# Remove rules that were (presumably) not put in by puppet
195195
rules_resources.delete_if { |resource| resource.rsapi_current_state[:name].match(%r{^(\d+)[[:graph:][:space:]]})[1].to_i >= 9000 } if should[:ignore_foreign]

lib/puppet/type/firewall.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
type: 'Optional[String[1]]',
151151
behaviour: :read_only,
152152
desc: <<-DESC
153-
A read only attribute containing the full rule, used when deleting only.
153+
A read only attribute containing the full rule, used when deleting and when applying firewallchain purge attributes.
154154
DESC
155155
},
156156
protocol: {

0 commit comments

Comments
 (0)