diff options
author | kaustubh-d <kaustubh@clogeny.com> | 2014-08-19 15:45:46 +0530 |
---|---|---|
committer | Julian C. Dunn <jdunn@getchef.com> | 2014-08-27 13:13:14 -0400 |
commit | 3b389790688adb1007b33476ec2e2b6111e26d76 (patch) | |
tree | 230f505bfdc3daa704966db8ef2c342111d994fb /spec/mixlib/shellout_spec.rb | |
parent | 7070c0b3807a68cf56b0f38b21f7e0600d972dfb (diff) | |
download | mixlib-shellout-3b389790688adb1007b33476ec2e2b6111e26d76.tar.gz |
aix does not allow resetting real uid once the euid is changed to non-root.
Diffstat (limited to 'spec/mixlib/shellout_spec.rb')
-rw-r--r-- | spec/mixlib/shellout_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index dca66ae..e009dd8 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -1319,4 +1319,25 @@ describe Mixlib::ShellOut do end end end + + context "when running under *nix", :requires_root, :unix_only do + let(:cmd) { 'whoami' } + let(:running_user) { shell_cmd.run_command.stdout.chomp } + + context "when no user is set" do + it "should run as current user" do + running_user.should eql(ENV["USER"]) + end + end + + context "when user is specified" do + let(:user) { 'nobody' } + + let(:options) { { :user => user } } + + it "should run as specified user" do + running_user.should eql("#{user}") + end + end + end end |