diff options
author | Lamont Granquist <454857+lamont-granquist@users.noreply.github.com> | 2021-09-23 11:44:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-23 11:44:44 -0700 |
commit | 2ebf3371e6caf688fa88f98ee372be79c0ccf8cb (patch) | |
tree | 202df0717fda995f67b27977e12cf2d1d1a3a9c7 | |
parent | 6679f97944df0a655baff5c2fa07337e2cff2709 (diff) | |
parent | 21a0f21a3231139ca4ca18f7bf4f0fd6f6bcd172 (diff) | |
download | chef-2ebf3371e6caf688fa88f98ee372be79c0ccf8cb.tar.gz |
Merge pull request #12084 from jasonwbarnett/rollback/archive_file-unit
-rw-r--r-- | spec/functional/resource/archive_file_spec.rb | 3 | ||||
-rw-r--r-- | spec/spec_helper.rb | 2 | ||||
-rw-r--r-- | spec/support/platform_helpers.rb | 4 | ||||
-rw-r--r-- | spec/unit/resource/archive_file_spec.rb | 17 |
4 files changed, 22 insertions, 4 deletions
diff --git a/spec/functional/resource/archive_file_spec.rb b/spec/functional/resource/archive_file_spec.rb index 1289bc0fad..27815cb319 100644 --- a/spec/functional/resource/archive_file_spec.rb +++ b/spec/functional/resource/archive_file_spec.rb @@ -18,7 +18,8 @@ require "spec_helper" require "tmpdir" -describe Chef::Resource::ArchiveFile do +# Exclude this test on platforms where ffi-libarchive loading is broken +describe Chef::Resource::ArchiveFile, :libarchive_loading_broken do include RecipeDSLHelper let(:tmp_path) { Dir.mktmpdir } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index afcaf955c5..60b608e4ff 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -187,6 +187,8 @@ RSpec.configure do |config| config.filter_run_excluding not_rhel7: true if rhel7? config.filter_run_excluding not_intel_64bit: true if intel_64bit? + config.filter_run_excluding libarchive_loading_broken: true if aix? || amazon_linux? || rhel7? + # these let us use chef: ">= 13" or ruby: "~> 2.0.0" or any other Gem::Dependency-style constraint config.filter_run_excluding chef: DependencyProc.with(Chef::VERSION) config.filter_run_excluding ruby: DependencyProc.with(RUBY_VERSION) diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index a3fb95e069..1538a4eb34 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -163,6 +163,10 @@ def aix? RUBY_PLATFORM.include?("aix") end +def amazon_linux? + ohai[:platform_family] == "amazon" +end + def wpar? !((ohai[:virtualization] || {})[:wpar_no].nil?) end diff --git a/spec/unit/resource/archive_file_spec.rb b/spec/unit/resource/archive_file_spec.rb index 67fb3dc635..88cbe94629 100644 --- a/spec/unit/resource/archive_file_spec.rb +++ b/spec/unit/resource/archive_file_spec.rb @@ -16,10 +16,21 @@ # require "spec_helper" -require "ffi-libarchive" -# Excluding this test on Windows until CI issues can be addressed. -describe Chef::Resource::ArchiveFile do +begin + require "ffi-libarchive" +rescue LoadError + module Archive + class Reader + def close; end + def each_entry; end + def extract(entry, flags = 0, destination: nil); end + end + end +end + +# Exclude this test on platforms where ffi-libarchive loading is broken +describe Chef::Resource::ArchiveFile, :libarchive_loading_broken do let(:node) { Chef::Node.new } let(:events) { Chef::EventDispatch::Dispatcher.new } let(:run_context) { Chef::RunContext.new(node, {}, events) } |