summaryrefslogtreecommitdiffstats
path: root/test/puppet
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-07 23:56:59 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-07 23:56:59 +0000
commit6d8068eddd0d29ec53f62557eb53f6ebb8e40591 (patch)
tree8c93181b9325fee95d7ecdc6e79341ff6d3604b0 /test/puppet
parent162602323406117444ce4375ead91d8f92f2b31a (diff)
downloadpuppet-6d8068eddd0d29ec53f62557eb53f6ebb8e40591.tar.gz
puppet-6d8068eddd0d29ec53f62557eb53f6ebb8e40591.tar.xz
puppet-6d8068eddd0d29ec53f62557eb53f6ebb8e40591.zip
Moving some of the stand-alone classes into the util/ subdirectory, to clean up the top-level namespace a bit. This is a lot of file modifications, but most of them just change class names and file paths.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2178 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/puppet')
-rwxr-xr-xtest/puppet/conffiles.rb5
-rwxr-xr-xtest/puppet/defaults.rb2
-rwxr-xr-xtest/puppet/tc_suidmanager.rb24
3 files changed, 15 insertions, 16 deletions
diff --git a/test/puppet/conffiles.rb b/test/puppet/conffiles.rb
index 201ecc5e6..6336968aa 100755
--- a/test/puppet/conffiles.rb
+++ b/test/puppet/conffiles.rb
@@ -2,9 +2,8 @@
$:.unshift("../lib").unshift("../../lib") if __FILE__ =~ /\.rb$/
-require 'puppet'
-require 'puppet/config'
require 'puppettest'
+require 'puppet/util/config'
class TestConfFiles < Test::Unit::TestCase
include PuppetTest
@@ -73,7 +72,7 @@ class TestConfFiles < Test::Unit::TestCase
path = tempfile()
sampledata { |data|
- config = Puppet::Config.new
+ config = Puppet::Util::Config.new
data.each { |section, hash|
hash.each { |param, value|
config.setdefaults(section, param => [value, value])
diff --git a/test/puppet/defaults.rb b/test/puppet/defaults.rb
index 033fb71bc..19db3fe05 100755
--- a/test/puppet/defaults.rb
+++ b/test/puppet/defaults.rb
@@ -67,7 +67,7 @@ class TestPuppetDefaults < Test::Unit::TestCase
# we don't want user defaults in /, or root defaults in ~
def testDefaultsInCorrectRoots
notval = nil
- if Puppet::SUIDManager.uid == 0
+ if Puppet::Util::SUIDManager.uid == 0
notval = Regexp.new(File.expand_path("~"))
else
notval = /^\/var|^\/etc/
diff --git a/test/puppet/tc_suidmanager.rb b/test/puppet/tc_suidmanager.rb
index 5561992e3..b90261f44 100755
--- a/test/puppet/tc_suidmanager.rb
+++ b/test/puppet/tc_suidmanager.rb
@@ -25,8 +25,8 @@ class TestSUIDManager < Test::Unit::TestCase
# modification of a closure. Should the bug rear itself again, this
# test will fail.
assert_nothing_raised do
- Puppet::SUIDManager.uid
- Puppet::SUIDManager.uid
+ Puppet::Util::SUIDManager.uid
+ Puppet::Util::SUIDManager.uid
end
end
@@ -34,16 +34,16 @@ class TestSUIDManager < Test::Unit::TestCase
if @run
user = nonrootuser
assert_nothing_raised do
- Puppet::SUIDManager.egid = user.gid
- Puppet::SUIDManager.euid = user.uid
+ Puppet::Util::SUIDManager.egid = user.gid
+ Puppet::Util::SUIDManager.euid = user.uid
end
- assert_equal(Puppet::SUIDManager.euid, Process.euid)
- assert_equal(Puppet::SUIDManager.egid, Process.egid)
+ assert_equal(Puppet::Util::SUIDManager.euid, Process.euid)
+ assert_equal(Puppet::Util::SUIDManager.egid, Process.egid)
assert_nothing_raised do
- Puppet::SUIDManager.euid = 0
- Puppet::SUIDManager.egid = 0
+ Puppet::Util::SUIDManager.euid = 0
+ Puppet::Util::SUIDManager.egid = 0
end
end
end
@@ -61,7 +61,7 @@ class TestSUIDManager < Test::Unit::TestCase
uid, gid = [nil, nil]
assert_nothing_raised do
- Puppet::SUIDManager.asuser(user.uid, user.gid) do
+ Puppet::Util::SUIDManager.asuser(user.uid, user.gid) do
uid = Process.euid
gid = Process.egid
end
@@ -75,7 +75,7 @@ class TestSUIDManager < Test::Unit::TestCase
# NOTE: not sure what shells this will work on..
if @run
user = nonrootuser
- status = Puppet::SUIDManager.system("exit $EUID", user.uid, user.gid)
+ status = Puppet::Util::SUIDManager.system("exit $EUID", user.uid, user.gid)
assert_equal(user.uid, status.exitstatus)
end
end
@@ -90,7 +90,7 @@ class TestSUIDManager < Test::Unit::TestCase
# way that run_and_capture works.
user = nil
uid = nil
- if Puppet::SUIDManager.uid == 0
+ if Puppet::Util::SUIDManager.uid == 0
userobj = nonrootuser()
user = userobj.name
uid = userobj.uid
@@ -98,7 +98,7 @@ class TestSUIDManager < Test::Unit::TestCase
uid = Process.uid
end
cmd = [%{/bin/echo $EUID}]
- output = Puppet::SUIDManager.run_and_capture(cmd, uid)[0].chomp
+ output = Puppet::Util::SUIDManager.run_and_capture(cmd, uid)[0].chomp
assert_equal(uid.to_s, output)
end
end