summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-03 19:46:01 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-03 19:46:01 +0000
commitc3b7d62cc5271d3cd263e7e2b5728fac0c3fe0f2 (patch)
tree750471e3b82f46198a4c62cd29ac01c9fcc6b102 /test
parentcaaa331906ca224bd356d2f90d68b06c5ec0828f (diff)
downloadpuppet-c3b7d62cc5271d3cd263e7e2b5728fac0c3fe0f2.tar.gz
puppet-c3b7d62cc5271d3cd263e7e2b5728fac0c3fe0f2.tar.xz
puppet-c3b7d62cc5271d3cd263e7e2b5728fac0c3fe0f2.zip
Bugfixes for OS X. I had to do some shenanigans on type/file/ensure.rb -- it was testing whether the parent dir was writeable on object creation, and if not it was not setting ownership and such, so i added some post-creation checks that will fix ownership if it was not set correctly at creation time.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1058 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/other/config.rb6
-rw-r--r--test/puppettest.rb7
2 files changed, 11 insertions, 2 deletions
diff --git a/test/other/config.rb b/test/other/config.rb
index 23c0e2725..a101bcd16 100755
--- a/test/other/config.rb
+++ b/test/other/config.rb
@@ -546,7 +546,8 @@ yay = /a/path
assert_equal(mode, filemode(path), "Modes are not equal")
- if Process.uid == 0
+ # OS X is broken in how it chgrps files
+ if Process.uid == 0 and Facter["operatingsystem"].value != "Darwin"
assert_equal(user.uid, File.stat(path).uid, "UIDS are not equal")
assert_equal(group.gid, File.stat(path).gid, "GIDS are not equal")
end
@@ -576,7 +577,8 @@ yay = /a/path
assert_equal(mode, filemode(path), "Modes are not equal")
- if Process.uid == 0
+ # OS X is broken in how it chgrps files
+ if Process.uid == 0 and Facter["operatingsystem"].value != "Darwin"
assert_equal(user.uid, File.stat(path).uid, "UIDS are not equal")
assert_equal(group.gid, File.stat(path).gid, "GIDS are not equal")
end
diff --git a/test/puppettest.rb b/test/puppettest.rb
index bcc51cb8a..cb3606e61 100644
--- a/test/puppettest.rb
+++ b/test/puppettest.rb
@@ -34,6 +34,13 @@ module TestPuppet
self.class.to_s + "configdir" + @@testcount.to_s + "/"
)
+ unless defined? $user and $group
+ $user = nonrootuser().uid.to_s
+ $group = nonrootgroup().gid.to_s
+ end
+ Puppet[:user] = $user
+ Puppet[:group] = $group
+
Puppet[:confdir] = @configpath
Puppet[:vardir] = @configpath