summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-03-09 17:16:46 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-03-09 17:16:46 -0700
commit13d257e967c42822106c99ebdacf0b5514cdb2f0 (patch)
tree9b592561c944b1b7a30a82699accccd424c1f61a
parenta18ae8ff2472ca4f678580ac59903b752b0a5ced (diff)
downloadchef-13d257e967c42822106c99ebdacf0b5514cdb2f0.tar.gz
Dont run useradd_spec on osxjdm/osx
-rw-r--r--spec/functional/resource/user/useradd_spec.rb1
-rw-r--r--spec/spec_helper.rb1
-rw-r--r--spec/support/platform_helpers.rb14
3 files changed, 16 insertions, 0 deletions
diff --git a/spec/functional/resource/user/useradd_spec.rb b/spec/functional/resource/user/useradd_spec.rb
index 9ac88d7b60..852f2eb083 100644
--- a/spec/functional/resource/user/useradd_spec.rb
+++ b/spec/functional/resource/user/useradd_spec.rb
@@ -32,6 +32,7 @@ end
metadata = { :unix_only => true,
:requires_root => true,
+ :not_supported_on_mac_osx => true,
:provider => {:user => user_provider_for_platform}
}
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 8888efc424..12b7db55da 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -114,6 +114,7 @@ RSpec.configure do |config|
# Add jruby filters here
config.filter_run_excluding :windows_only => true unless windows?
config.filter_run_excluding :not_supported_on_mac_osx_106 => true if mac_osx_106?
+ config.filter_run_excluding :not_supported_on_mac_osx=> true if mac_osx?
config.filter_run_excluding :not_supported_on_win2k3 => true if windows_win2k3?
config.filter_run_excluding :not_supported_on_solaris => true if solaris?
config.filter_run_excluding :win2k3_only => true unless windows_win2k3?
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index a412fe38e1..da0313758b 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -88,6 +88,20 @@ def mac_osx_106?
false
end
+def mac_osx?
+ if File.exists? "/usr/bin/sw_vers"
+ result = ShellHelpers.shell_out("/usr/bin/sw_vers")
+ result.stdout.each_line do |line|
+ if line =~ /^ProductName:\sMac OS X.*$/
+ return true
+ end
+ end
+ end
+
+ false
+end
+
+
# detects if the hardware is 64-bit (evaluates to true in "WOW64" mode in a 32-bit app on a 64-bit system)
def windows64?
windows? && ( ENV['PROCESSOR_ARCHITECTURE'] == 'AMD64' || ENV['PROCESSOR_ARCHITEW6432'] == 'AMD64' )