summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-04-02 13:42:54 -0700
committerTim Smith <tsmith84@gmail.com>2021-04-02 13:42:54 -0700
commitb8318305f6f02cf5318b7c84b4d884c4f0833b5a (patch)
tree7396d0d1aa74a90137f6d0d8a005541ec6a7f377
parent1b24e25317391db444a4e2fc2e11e01b026ffe2c (diff)
downloadchef-b8318305f6f02cf5318b7c84b4d884c4f0833b5a.tar.gz
Skip the cron tests on macOS 11+
These don't run due to security changes in the OS. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/functional/resource/cron_spec.rb2
-rw-r--r--spec/spec_helper.rb1
-rw-r--r--spec/support/platform_helpers.rb4
3 files changed, 6 insertions, 1 deletions
diff --git a/spec/functional/resource/cron_spec.rb b/spec/functional/resource/cron_spec.rb
index fa53eb08a1..e247dc53cd 100644
--- a/spec/functional/resource/cron_spec.rb
+++ b/spec/functional/resource/cron_spec.rb
@@ -19,7 +19,7 @@
require "spec_helper"
require "chef/mixin/shell_out"
-describe Chef::Resource::Cron, :requires_root, :unix_only do
+describe Chef::Resource::Cron, :requires_root, :unix_only, :not_macos_gte_11 do
include Chef::Mixin::ShellOut
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 2924b2abdb..810a09c11e 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -138,6 +138,7 @@ RSpec.configure do |config|
config.filter_run_excluding not_supported_on_windows: true if windows?
config.filter_run_excluding not_supported_on_macos: true if macos?
config.filter_run_excluding macos_only: true unless macos?
+ config.filter_run_excluding not_macos_gte_11: true unless macos_gte_11?
config.filter_run_excluding not_supported_on_aix: true if aix?
config.filter_run_excluding not_supported_on_solaris: true if solaris?
config.filter_run_excluding not_supported_on_gce: true if gce?
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index 27dc1d77c8..a3fb95e069 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -115,6 +115,10 @@ def macos?
RUBY_PLATFORM.include?("darwin")
end
+def macos_gte_11?
+ macos? && !!(ohai[:platform_version].to_i >= 11)
+end
+
def solaris?
RUBY_PLATFORM.include?("solaris")
end