summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaymala Sinha <jsinha@chef.io>2017-01-05 14:07:21 -0500
committerJaymala Sinha <jsinha@chef.io>2017-01-05 18:44:26 -0500
commit8fba7817c10dbac962874a33868fe991b91762be (patch)
tree57ff90f8547fc36b65ff0cc85a919711b77ff206
parent560c95ceb109a4e1b1be0005cc7896df79739ce4 (diff)
downloadchef-jsinha/fix_rhel67_tests.tar.gz
Fix failing useradd test for rhel6 on s390x platformjsinha/fix_rhel67_tests
usermod -U for user with empty password on Rhel6 zlinux systems exits with error message. Updating the test for this behavior Signed-off-by: Jaymala Sinha <jsinha@chef.io>
-rw-r--r--spec/functional/resource/user/useradd_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/functional/resource/user/useradd_spec.rb b/spec/functional/resource/user/useradd_spec.rb
index 268ce5c9d2..497cb0b043 100644
--- a/spec/functional/resource/user/useradd_spec.rb
+++ b/spec/functional/resource/user/useradd_spec.rb
@@ -645,6 +645,15 @@ describe Chef::Provider::User::Useradd, metadata do
expect(@error).to be_a(Mixlib::ShellOut::ShellCommandFailed)
expect(@error.message).to include("Cannot unlock the password")
end
+ elsif %w{rhel}.include?(OHAI_SYSTEM["platform_family"]) &&
+ OHAI_SYSTEM["platform_version"].to_f == 6.8
+ # usermod -U returns following message for rhel68 on s390x platforms
+ # usermod: unlocking the user's password would result in a passwordless account.
+ #You should set a password with usermod -p to unlock this user's password.
+ it "errors out trying to unlock the user" do
+ expect(@error).to be_a(Mixlib::ShellOut::ShellCommandFailed)
+ expect(@error.message).to include("You should set a password")
+ end
else
# borked on all other platforms: