summaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
authorRick Bradley <rick@rickbradley.com>2007-10-02 14:41:11 -0500
committerRick Bradley <rick@rickbradley.com>2007-10-02 14:41:11 -0500
commit7fe18e3ffba0d8f206b0e7aef2dd6684a98802b6 (patch)
treeadee5ee0838529d849edee60a2d538bc0528924d /test/lib
parentfa643e61c7451c2c46623d2c801a42c6c7640e1e (diff)
downloadpuppet-7fe18e3ffba0d8f206b0e7aef2dd6684a98802b6.tar.gz
puppet-7fe18e3ffba0d8f206b0e7aef2dd6684a98802b6.tar.xz
puppet-7fe18e3ffba0d8f206b0e7aef2dd6684a98802b6.zip
Fixed a test which was secretly sneaking off and pulling certs from ~ if they were there: Added set_mygroup method, removed duplicate setme method. Included PuppetTest in the XMLRPC servlect test.
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/puppettest/support/utils.rb24
1 files changed, 11 insertions, 13 deletions
diff --git a/test/lib/puppettest/support/utils.rb b/test/lib/puppettest/support/utils.rb
index 7f4260e31..b5189202f 100644
--- a/test/lib/puppettest/support/utils.rb
+++ b/test/lib/puppettest/support/utils.rb
@@ -50,6 +50,7 @@ module PuppetTest
# TODO: rewrite this to use the 'etc' module.
+ # Define a variable that contains the name of my user.
def setme
# retrieve the user name
id = %x{id}.chomp
@@ -63,6 +64,16 @@ module PuppetTest
end
end
+ # Define a variable that contains a group I'm in.
+ def set_mygroup
+ # retrieve the user name
+ group = %x{groups}.chomp.split(/ /)[0]
+ unless group
+ raise "Could not find group to set in @mygroup"
+ end
+ @mygroup = group
+ end
+
def run_events(type, trans, events, msg)
case type
when :evaluate, :rollback: # things are hunky-dory
@@ -158,19 +169,6 @@ module PuppetTest
return config
end
-
- def setme
- # retrieve the user name
- id = %x{id}.chomp
- if id =~ /uid=\d+\(([^\)]+)\)/
- @me = $1
- else
- puts id
- end
- unless defined? @me
- raise "Could not retrieve user name; 'id' did not work"
- end
- end
end
# $Id$