diff options
| author | Markus Roberts <Markus@reality.com> | 2010-06-09 17:47:39 -0700 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | 2396ebac9021eaa4a2983e60902c04cc9e0db0ee (patch) | |
| tree | 05015dc5d67aca35dd235a6229fb360ecb6b68e9 /test | |
| parent | 8128311690a25d864087a7aee31b233a459345fd (diff) | |
Use the 'root' feature rather than directly checking the uid
Jesse fixed all these but David and others moved them and introduced some more so...
Diffstat (limited to 'test')
| -rwxr-xr-x | test/puppet/defaults.rb | 2 | ||||
| -rwxr-xr-x | test/ral/providers/group.rb | 2 | ||||
| -rwxr-xr-x | test/ral/providers/user.rb | 2 | ||||
| -rwxr-xr-x | test/ral/type/exec.rb | 2 | ||||
| -rwxr-xr-x | test/ral/type/file.rb | 2 | ||||
| -rwxr-xr-x | test/util/settings.rb | 8 |
6 files changed, 9 insertions, 9 deletions
diff --git a/test/puppet/defaults.rb b/test/puppet/defaults.rb index d53c23217..bab6644d2 100755 --- a/test/puppet/defaults.rb +++ b/test/puppet/defaults.rb @@ -40,7 +40,7 @@ class TestPuppetDefaults < Test::Unit::TestCase # we don't want user defaults in /, or root defaults in ~ def testDefaultsInCorrectRoots notval = nil - if Puppet::Util::SUIDManager.uid == 0 + if Puppet.features.root? notval = Regexp.new(File.expand_path("~")) else notval = /^\/var|^\/etc/ diff --git a/test/ral/providers/group.rb b/test/ral/providers/group.rb index 8e62d7b1e..cedbf137c 100755 --- a/test/ral/providers/group.rb +++ b/test/ral/providers/group.rb @@ -179,7 +179,7 @@ class TestGroupProvider < Test::Unit::TestCase } end - if Puppet::Util::SUIDManager.uid == 0 + if Puppet.features.root? def test_mkgroup gobj = nil comp = nil diff --git a/test/ral/providers/user.rb b/test/ral/providers/user.rb index 03e3ec892..9abf850ad 100755 --- a/test/ral/providers/user.rb +++ b/test/ral/providers/user.rb @@ -418,7 +418,7 @@ class TestUserProvider < Test::Unit::TestCase assert_equal(main.sort, list.sort, "Group list is not equal") end - if Puppet::Util::SUIDManager.uid == 0 + if Puppet.features.root? def test_simpleuser name = "pptest" diff --git a/test/ral/type/exec.rb b/test/ral/type/exec.rb index 27a3de4d1..98d111444 100755 --- a/test/ral/type/exec.rb +++ b/test/ral/type/exec.rb @@ -294,7 +294,7 @@ class TestExec < Test::Unit::TestCase assert_events([:executed_command], comp) end - if Puppet::Util::SUIDManager.uid == 0 + if Puppet.features.root? # Verify that we can execute commands as a special user def mknverify(file, user, group = nil, id = true) File.umask(0022) diff --git a/test/ral/type/file.rb b/test/ral/type/file.rb index 462e8f8eb..431a302ab 100755 --- a/test/ral/type/file.rb +++ b/test/ral/type/file.rb @@ -109,7 +109,7 @@ class TestFile < Test::Unit::TestCase end end - if Puppet::Util::SUIDManager.uid == 0 + if Puppet.features.root? def test_createasuser dir = tmpdir() diff --git a/test/util/settings.rb b/test/util/settings.rb index e94778e2a..272ced9f5 100755 --- a/test/util/settings.rb +++ b/test/util/settings.rb @@ -359,7 +359,7 @@ yay = /a/path user = nonrootuser() group = nonrootgroup() - if Puppet::Util::SUIDManager.uid == 0 + if Puppet.features.root? args[:owner] = user.name args[:group] = group.name end @@ -375,7 +375,7 @@ yay = /a/path assert_equal(mode, filemode(path), "Modes are not equal") # OS X is broken in how it chgrps files - if Puppet::Util::SUIDManager.uid == 0 + if Puppet.features.root? assert_equal(user.uid, File.stat(path).uid, "UIDS are not equal") case Facter["operatingsystem"].value @@ -399,7 +399,7 @@ yay = /a/path user = nonrootuser() group = nonrootgroup() - if Puppet::Util::SUIDManager.uid == 0 + if Puppet.features.root? args[:owner] = user.name args[:group] = group.name end @@ -414,7 +414,7 @@ yay = /a/path # OS X and *BSD is broken in how it chgrps files - if Puppet::Util::SUIDManager.uid == 0 + if Puppet.features.root? assert_equal(user.uid, File.stat(path).uid, "UIDS are not equal") case Facter["operatingsystem"].value |
