Skip to content

Commit

Permalink
add test to for handling nested arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
kengelhardt-godaddy committed Jan 30, 2023
1 parent f18923a commit 33095b7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/acceptance/ipset_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@
end
end

context 'with a nested array' do
it 'handles nested arrays with no errors' do
pp = <<-EOS
include ipset
ipset::set{'nested-set':
set => ['10.0.0.1', ['10.0.0.2', '10.0.0.42']],
type => 'hash:net',
}
EOS
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe command('ipset list basic-set') do
its(:stdout) { is_expected.to match %r{.*basic-set.*Type: hash:net.*10\.0\.0\.2.*}m }
end
end

context 'can delete ipsets' do
it 'works even here idempotently with no errors' do
pp = <<-EOS
Expand Down

0 comments on commit 33095b7

Please sign in to comment.