From: Raphaƫl Pinson Date: Mon, 1 Apr 2019 12:43:22 +0000 (+0200) Subject: Add unit tests for ctdir X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3ebee1cb83b609d9088907a37a7f58535fbdef71;p=puppet-modules%2Fpuppetlabs-firewall.git Add unit tests for ctdir --- diff --git a/lib/puppet/type/firewall.rb b/lib/puppet/type/firewall.rb index 1bc8f83..b943700 100644 --- a/lib/puppet/type/firewall.rb +++ b/lib/puppet/type/firewall.rb @@ -941,6 +941,15 @@ Puppet::Type.newtype(:firewall) do end newproperty(:ctdir) do + desc <<-PUPPETCODE + Matches a packet that is flowing in the specified direction. + If this flag is not specified at all, matches packets in both directions. + Values can be: + + * REPLY + * ORIGINAL + PUPPETCODE + newvalues(:REPLY, :ORIGINAL) end diff --git a/spec/unit/puppet/type/firewall_spec.rb b/spec/unit/puppet/type/firewall_spec.rb index 6f29602..f05e681 100755 --- a/spec/unit/puppet/type/firewall_spec.rb +++ b/spec/unit/puppet/type/firewall_spec.rb @@ -436,6 +436,18 @@ describe firewall do # rubocop:disable RSpec/MultipleDescribes end end + describe ':ctdir' do + it 'accepts value as a string - REPLY' do + resource[:ctdir] = :REPLY + expect(resource[:ctdir]).to be :REPLY + end + + it 'accepts value as a string - ORIGINAL' do + resource[:ctdir] = :ORIGINAL + expect(resource[:ctdir]).to be :ORIGINAL + end + end + describe ':burst' do it 'accepts numeric values' do resource[:burst] = 12