diff options
author | Jeremiah Snapp <jeremiah@chef.io> | 2017-11-02 14:02:11 -0400 |
---|---|---|
committer | Jeremiah Snapp <jeremiah@chef.io> | 2017-11-13 10:51:10 -0500 |
commit | d93e264af13810883c564b596f983b0792b5e06e (patch) | |
tree | f8cfaa0d0757402c61d7b845004b1f924d664119 | |
parent | d1bcbb3d04159c320f58ed526455ab96cf596ac7 (diff) | |
download | chef-d93e264af13810883c564b596f983b0792b5e06e.tar.gz |
Change a useradd_spec test for RHEL >= 6.8 and >= 7.3
RHEL 6.8 and 7.3 ship with a fixed `usermod` command.
Reference: https://access.redhat.com/errata/RHBA-2016:0864
Reference: https://access.redhat.com/errata/RHBA-2016:2322
Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>
-rw-r--r-- | spec/functional/resource/user/useradd_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/functional/resource/user/useradd_spec.rb b/spec/functional/resource/user/useradd_spec.rb index e783356c9f..86a5d943de 100644 --- a/spec/functional/resource/user/useradd_spec.rb +++ b/spec/functional/resource/user/useradd_spec.rb @@ -646,10 +646,10 @@ describe Chef::Provider::User::Useradd, metadata do 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. + (OHAI_SYSTEM["platform_version"].to_f >= 6.8 || OHAI_SYSTEM["platform_version"].to_f >= 7.3) + # RHEL 6.8 and 7.3 ship with a fixed `usermod` command + # Reference: https://access.redhat.com/errata/RHBA-2016:0864 + # Reference: https://access.redhat.com/errata/RHBA-2016:2322 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") |