diff options
author | kaustubh-d <kaustubh@clogeny.com> | 2013-12-05 01:21:02 -0600 |
---|---|---|
committer | adamedx <adamed@opscode.com> | 2013-12-11 20:53:37 -0800 |
commit | e5ca800f6485e7f805597b25432019a6f97b0a42 (patch) | |
tree | 8d7f95164ec49188a5d65f806fa21416e29e265b | |
parent | fa1e843e958cc7399037b3bffa9c305916814426 (diff) | |
download | chef-adamed-oc-9954.tar.gz |
OC-9954 - aix: use 'guest' user for rspec tests instead of 'nobody' user.adamed-oc-9954
-rw-r--r-- | spec/support/shared/functional/securable_resource.rb | 13 | ||||
-rw-r--r-- | spec/support/shared/functional/securable_resource_with_reporting.rb | 15 |
2 files changed, 24 insertions, 4 deletions
diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb index 3952b783dc..4c18a1533a 100644 --- a/spec/support/shared/functional/securable_resource.rb +++ b/spec/support/shared/functional/securable_resource.rb @@ -19,6 +19,7 @@ # require 'etc' +require 'functional/resource/base' shared_context "setup correct permissions" do if windows? @@ -36,7 +37,11 @@ shared_context "setup correct permissions" do # Root only context. before :each, :unix_only, :requires_root do - File.chown(Etc.getpwnam('nobody').uid, 1337, path) + if ohai[:platform] == "aix" + File.chown(Etc.getpwnam('guest').uid, 1337, path) + else + File.chown(Etc.getpwnam('nobody').uid, 1337, path) + end end before :each, :windows_only do @@ -149,7 +154,11 @@ shared_examples_for "a securable resource with existing target" do include_context "diff disabled" context "on Unix", :unix_only do - let(:expected_user_name) { 'nobody' } + if ohai[:platform] == "aix" + let(:expected_user_name) { 'guest' } + else + let(:expected_user_name) { 'nobody' } + end let(:expected_uid) { Etc.getpwnam(expected_user_name).uid } let(:desired_gid) { 1337 } let(:expected_gid) { 1337 } diff --git a/spec/support/shared/functional/securable_resource_with_reporting.rb b/spec/support/shared/functional/securable_resource_with_reporting.rb index 2bfc257731..b02137a06c 100644 --- a/spec/support/shared/functional/securable_resource_with_reporting.rb +++ b/spec/support/shared/functional/securable_resource_with_reporting.rb @@ -1,4 +1,6 @@ +require 'functional/resource/base' + ALL_EXPANDED_PERMISSIONS = ["generic read", "generic write", "generic execute", @@ -72,7 +74,12 @@ shared_examples_for "a securable resource with reporting" do context "and owner is specified with a String (username) in new_resource", :requires_root => true do # TODO/bug: duplicated from the "securable resource" tests - let(:expected_user_name) { 'nobody' } + + if ohai[:platform] == "aix" + let(:expected_user_name) { 'guest' } + else + let(:expected_user_name) { 'nobody' } + end before do resource.owner(expected_user_name) @@ -88,7 +95,11 @@ shared_examples_for "a securable resource with reporting" do context "and owner is specified with an Integer (uid) in new_resource", :requires_root => true do # TODO: duplicated from "securable resource" - let(:expected_user_name) { 'nobody' } + if ohai[:platform] == "aix" + let(:expected_user_name) { 'guest' } + else + let(:expected_user_name) { 'nobody' } + end let(:expected_uid) { Etc.getpwnam(expected_user_name).uid } let(:desired_gid) { 1337 } let(:expected_gid) { 1337 } |