summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-08-23 11:33:18 -0700
committerGitHub <noreply@github.com>2016-08-23 11:33:18 -0700
commit18a4a9a0c8183d9135869ed78bbae8a4b6325b89 (patch)
treea50ada2a800f16cba550731bfbc272cc78f5d7af /spec
parentaa2fe50da67734d1e0ae407e40f38c40580b858e (diff)
parent9606b6a27f88249ad525caac92b8417ebc8f9051 (diff)
downloadchef-18a4a9a0c8183d9135869ed78bbae8a4b6325b89.tar.gz
Merge pull request #5236 from chef/lcg/fix-useradd-test-filters
fix the useradd test filters
Diffstat (limited to 'spec')
-rw-r--r--spec/functional/resource/user/useradd_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/functional/resource/user/useradd_spec.rb b/spec/functional/resource/user/useradd_spec.rb
index f13cd95d6f..fb16a2b858 100644
--- a/spec/functional/resource/user/useradd_spec.rb
+++ b/spec/functional/resource/user/useradd_spec.rb
@@ -25,10 +25,22 @@ def resource_for_platform(username, run_context)
Chef::Resource.resource_for_node(:user, node).new(username, run_context)
end
+# ideally we could somehow pass an array of [ ...::Aix, ...::Linux ] to the
+# filter, but we have to pick the right one for the O/S.
+def user_provider_filter
+ case ohai[:os]
+ when "aix"
+ Chef::Provider::User::Aix
+ when "linux"
+ Chef::Provider::User::Linux
+ end
+end
+
metadata = {
:unix_only => true,
:requires_root => true,
:not_supported_on_mac_osx => true,
+ :provider => { :user => user_provider_filter },
}
describe Chef::Provider::User::Useradd, metadata do