diff options
author | Tom Duffield <tom@chef.io> | 2016-10-19 13:54:23 -0500 |
---|---|---|
committer | Tom Duffield <tom@chef.io> | 2016-10-20 13:49:36 -0500 |
commit | 20cc4626599063e7a8f284fd6dc89e127d360d15 (patch) | |
tree | 0e6b9eb2e404e5117e8e9a72f529edac5907e0a9 /spec/functional | |
parent | 5e907c90ed9bcfac69b6511fe0f521ae46bb76a5 (diff) | |
download | chef-20cc4626599063e7a8f284fd6dc89e127d360d15.tar.gz |
Update useradd test to account for new SUSE 12.1 behavior
The `usermod` binary in SUSE 12.1 no longer throws an error if you
attempt to unlock a user account that has no password.
Signed-off-by: Tom Duffield <tom@chef.io>
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/resource/user/useradd_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/functional/resource/user/useradd_spec.rb b/spec/functional/resource/user/useradd_spec.rb index 79d62436f5..874155c107 100644 --- a/spec/functional/resource/user/useradd_spec.rb +++ b/spec/functional/resource/user/useradd_spec.rb @@ -637,8 +637,10 @@ describe Chef::Provider::User::Useradd, metadata do context "and has no password" do # TODO: platform_family should be setup in spec_helper w/ tags - if %w{suse opensuse}.include?(OHAI_SYSTEM["platform_family"]) - # suse gets this right: + if %w{opensuse}.include?(OHAI_SYSTEM["platform_family"]) || + (%w{suse}.include?(OHAI_SYSTEM["platform_family"]) && + OHAI_SYSTEM["platform_version"].to_f < 12.1) + # suse 11.x gets this right: it "errors out trying to unlock the user" do expect(@error).to be_a(Mixlib::ShellOut::ShellCommandFailed) expect(@error.message).to include("Cannot unlock the password") |