]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Add unit tests for ctdir
authorRaphaël Pinson <raphael.pinson@camptocamp.com>
Mon, 1 Apr 2019 12:43:22 +0000 (14:43 +0200)
committerRaphaël Pinson <raphael.pinson@camptocamp.com>
Wed, 27 Nov 2019 12:51:12 +0000 (13:51 +0100)
lib/puppet/type/firewall.rb
spec/unit/puppet/type/firewall_spec.rb

index 1bc8f83d4ab85ff12bbe5f8917720a5143c65477..b943700c3c01ae27a298ee2aaa1ce3ea0090cbb2 100644 (file)
@@ -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
 
index 6f29602a807083bf268b7b5de9377b8e2a3a3881..f05e68188463b4dcc2b022a76b7e8d8eda616cb6 100755 (executable)
@@ -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