summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-08-24 16:22:58 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-08-24 16:22:58 -0700
commit43074c197acd5e73cc0f47fd1516c6e6851e70ad (patch)
tree9818172accccc81f8196111d55c4acdbfe860dfc
parentc0d8144530e1319cd2a9274a17d9de4503ac6380 (diff)
downloadchef-lcg/linux-user-check-lock.tar.gz
add check for the centos why-run buglcg/linux-user-check-lock
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/support/shared/unit/provider/useradd_based_user_provider.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/support/shared/unit/provider/useradd_based_user_provider.rb b/spec/support/shared/unit/provider/useradd_based_user_provider.rb
index 9392c95e95..86076122a4 100644
--- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb
+++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb
@@ -317,6 +317,9 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
expect(provider).to receive(:shell_out).
with("passwd", "-S", @new_resource.username, { :returns => [0, 1] }).
and_return(passwd_status)
+ # ubuntu returns 252 on user-does-not-exist so will raise if #error! is called or if
+ # shell_out! is used
+ allow(passwd_status).to receive(:error!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
Chef::Config[:why_run] = true
end