From c3b7d62cc5271d3cd263e7e2b5728fac0c3fe0f2 Mon Sep 17 00:00:00 2001 From: luke Date: Mon, 3 Apr 2006 19:46:01 +0000 Subject: 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 --- test/other/config.rb | 6 ++++-- test/puppettest.rb | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'test') 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 -- cgit