diff options
| author | Luke Kanies <luke@madstop.com> | 2007-10-03 16:32:48 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-10-03 16:32:48 -0500 |
| commit | b727a95aa4b72ce057653101cf1f50fa49c4b0a8 (patch) | |
| tree | 20f3bbf772f8e22a606937ff24d2896403d7d4ee /test/lib | |
| parent | b45a7ca82d9c59d577c2eedb18531f64e55813d1 (diff) | |
| parent | f1ec23a0e29f3e1fe7809c19139e324f2c525d2d (diff) | |
Merge branch 'master' of ssh://reductivelabs.com/opt/rl/git/puppet
Diffstat (limited to 'test/lib')
| -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$ |
