[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5rc1-120-g2247c80

Daniel Pittman daniel at rimspace.net
Mon Feb 7 06:41:39 UTC 2011


The following commit has been merged in the upstream branch:
commit bf44e72b19187dbb4bc696ba8e1b3bc872c32d46
Author: Daniel Pittman <daniel at rimspace.net>
Date:   Fri Jan 28 14:52:04 2011 -0800

    Bug #6061 -- verify that negative {min,max}_password_age are accepted.
    
    Setting the age value to -1 will disable the specific aging value; we should
    accept that, but continue to reject null or empty values as invalid.
    
    Add tests to verify that this code enforces as expected.

diff --git a/spec/unit/type/user_spec.rb b/spec/unit/type/user_spec.rb
index 0c3e2ab..2971344 100755
--- a/spec/unit/type/user_spec.rb
+++ b/spec/unit/type/user_spec.rb
@@ -245,6 +245,34 @@ describe user do
     end
   end
 
+  describe "when managing minimum password age" do
+    before do
+      @age = user.attrclass(:password_min_age).new(:resource => @resource)
+    end
+
+    it "should accept a negative minimum age" do
+      expect { @age.should = -1 }.should_not raise_error
+    end
+
+    it "should fail with an empty minimum age" do
+      expect { @age.should = '' }.should raise_error(Puppet::Error)
+    end
+  end
+
+  describe "when managing maximum password age" do
+    before do
+      @age = user.attrclass(:password_max_age).new(:resource => @resource)
+    end
+
+    it "should accept a negative maximum age" do
+      expect { @age.should = -1 }.should_not raise_error
+    end
+
+    it "should fail with an empty maximum age" do
+      expect { @age.should = '' }.should raise_error(Puppet::Error)
+    end
+  end
+
   describe "when managing passwords" do
     before do
       @password = user.attrclass(:password).new(:resource => @resource, :should => "mypass")

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list