summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorNigel Kersten <nigelk@google.com>2009-07-24 17:23:00 -0700
committerJames Turnbull <james@lovedthanlost.net>2009-07-29 07:41:54 +1000
commit9825bec3ad612eb3ec980cbae3a80f611b4a70a0 (patch)
treeb3233df857edf6645e9c202b24a2f2e764560a5c /spec/unit
parent450a19c405810358684a47b87ef9eca26589b95f (diff)
downloadpuppet-9825bec3ad612eb3ec980cbae3a80f611b4a70a0.tar.gz
puppet-9825bec3ad612eb3ec980cbae3a80f611b4a70a0.tar.xz
puppet-9825bec3ad612eb3ec980cbae3a80f611b4a70a0.zip
Fixes #2362. Do not validate users/groups when supplied with numeric uid/gids
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/type/file/group.rb5
-rwxr-xr-xspec/unit/type/file/owner.rb5
2 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/type/file/group.rb b/spec/unit/type/file/group.rb
index 856b05b0d..93d09adb4 100755
--- a/spec/unit/type/file/group.rb
+++ b/spec/unit/type/file/group.rb
@@ -70,6 +70,11 @@ describe property do
@group.must be_insync(10)
end
+
+ it "should not validate that groups exist when a group is specified as an integer" do
+ @group.expects(:gid).never
+ @group.validgroup?(10)
+ end
it "should fail if it cannot convert a group name to an integer" do
@group.expects(:gid).with("foo").returns nil
diff --git a/spec/unit/type/file/owner.rb b/spec/unit/type/file/owner.rb
index 743e64054..1ea01cbc7 100755
--- a/spec/unit/type/file/owner.rb
+++ b/spec/unit/type/file/owner.rb
@@ -83,6 +83,11 @@ describe property do
@owner.must be_insync(10)
end
+
+ it "should not validate that users exist when a user is specified as an integer" do
+ @owner.expects(:uid).never
+ @owner.validuser?(10)
+ end
it "should fail if it cannot convert an owner name to an integer" do
@owner.expects(:uid).with("foo").returns nil