summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremiah Snapp <jeremiah@chef.io>2021-12-30 14:17:14 -0500
committerJeremiah Snapp <jeremiah@chef.io>2021-12-30 14:58:43 -0500
commit06db3d210d9cf17622138023d08499711c935f15 (patch)
tree131bc885ab235740293b38660fe7fb2292677e40
parentbb6116d12fbc75dbb3d1daa36b8413b1bc6638d1 (diff)
downloadchef-06db3d210d9cf17622138023d08499711c935f15.tar.gz
skip tests on >= freebsd 12.3
Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>
-rw-r--r--knife/spec/support/platform_helpers.rb4
-rw-r--r--spec/spec_helper.rb1
-rw-r--r--spec/support/platform_helpers.rb4
-rw-r--r--spec/support/shared/functional/securable_resource_with_reporting.rb4
4 files changed, 11 insertions, 2 deletions
diff --git a/knife/spec/support/platform_helpers.rb b/knife/spec/support/platform_helpers.rb
index a3fb95e069..c6d14281f8 100644
--- a/knife/spec/support/platform_helpers.rb
+++ b/knife/spec/support/platform_helpers.rb
@@ -127,6 +127,10 @@ def freebsd?
RUBY_PLATFORM.include?("freebsd")
end
+def freebsd_gte_12_3?
+ RUBY_PLATFORM.include?("freebsd") && !!(ohai[:platform_version].to_f >= 12.3)
+end
+
def intel_64bit?
!!(ohai[:kernel][:machine] == "x86_64")
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 60b608e4ff..6cabab3614 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -144,6 +144,7 @@ RSpec.configure do |config|
config.filter_run_excluding macos_only: true unless macos?
config.filter_run_excluding not_macos_gte_11: true if macos_gte_11?
config.filter_run_excluding not_supported_on_aix: true if aix?
+ config.filter_run_excluding not_supported_on_freebsd_gte_12_3: true if freebsd_gte_12_3?
config.filter_run_excluding not_supported_on_solaris: true if solaris?
config.filter_run_excluding not_supported_on_gce: true if gce?
config.filter_run_excluding win2012r2_only: true unless windows_2012r2?
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index 1538a4eb34..e256c7355c 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -127,6 +127,10 @@ def freebsd?
RUBY_PLATFORM.include?("freebsd")
end
+def freebsd_gte_12_3?
+ RUBY_PLATFORM.include?("freebsd") && !!(ohai[:platform_version].to_f >= 12.3)
+end
+
def intel_64bit?
!!(ohai[:kernel][:machine] == "x86_64")
end
diff --git a/spec/support/shared/functional/securable_resource_with_reporting.rb b/spec/support/shared/functional/securable_resource_with_reporting.rb
index 6f816265bf..02fd3e6cb7 100644
--- a/spec/support/shared/functional/securable_resource_with_reporting.rb
+++ b/spec/support/shared/functional/securable_resource_with_reporting.rb
@@ -112,7 +112,7 @@ shared_examples_for "a securable resource with reporting" do
end
end
- context "and group is specified with a String (group name)", requires_root: true do
+ context "and group is specified with a String (group name)", :not_supported_on_freebsd_gte_12_3, requires_root: true do
let(:expected_group_name) { Etc.getgrent.name }
@@ -127,7 +127,7 @@ shared_examples_for "a securable resource with reporting" do
end
- context "and group is specified with an Integer (gid)", requires_root: true do
+ context "and group is specified with an Integer (gid)", :not_supported_on_freebsd_gte_12_3, requires_root: true do
let(:expected_gid) { Etc.getgrent.gid }
before do