diff options
author | Michael V. O'Brien <michael@reductivelabs.com> | 2007-10-02 16:13:21 -0500 |
---|---|---|
committer | Michael V. O'Brien <michael@reductivelabs.com> | 2007-10-02 16:13:21 -0500 |
commit | 0b67d79d1e006f0ba88090fa711bb75d2850f6f5 (patch) | |
tree | 05ba2ae0d62a1de0230f75d5f6fa6e351d6fae61 /test/lib/puppettest/support/utils.rb | |
parent | 93f64885100eecb4c235d08e1f9cd266e6d789ad (diff) | |
parent | 1174d99acb5505b8de577b7f71cee0d32a4cf05f (diff) | |
download | puppet-0b67d79d1e006f0ba88090fa711bb75d2850f6f5.tar.gz puppet-0b67d79d1e006f0ba88090fa711bb75d2850f6f5.tar.xz puppet-0b67d79d1e006f0ba88090fa711bb75d2850f6f5.zip |
Merge branch 'master' of git://reductivelabs.com/puppet
Diffstat (limited to 'test/lib/puppettest/support/utils.rb')
-rw-r--r-- | test/lib/puppettest/support/utils.rb | 24 |
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$ |