diff options
author | tpowell-progress <104777878+tpowell-progress@users.noreply.github.com> | 2022-12-29 14:08:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-29 17:08:28 -0500 |
commit | 5fd467854e55c8e9a5dd2916b5f6d76b0fd4df17 (patch) | |
tree | 505a39de72de2a6a15a46a7ef542fa439fe498f7 | |
parent | 0e1f35a8c1faf7ac3bd7c33b77967ddfb81df17e (diff) | |
download | chef-5fd467854e55c8e9a5dd2916b5f6d76b0fd4df17.tar.gz |
INFC-373 Disable 32-bit Windows for Chef 16 (#13458)
* Add FIPS tests first
* Disable 32-bit windows builds
Signed-off-by: Thomas Powell <powell@progress.com>
-rw-r--r-- | .expeditor/release.omnibus.yml | 2 | ||||
-rw-r--r-- | omnibus/omnibus-test.ps1 | 13 | ||||
-rw-r--r-- | spec/integration/client/fips_spec.rb | 21 | ||||
-rw-r--r-- | spec/spec_helper.rb | 4 | ||||
-rw-r--r-- | spec/support/platform_helpers.rb | 4 |
5 files changed, 39 insertions, 5 deletions
diff --git a/.expeditor/release.omnibus.yml b/.expeditor/release.omnibus.yml index 0ad74cdb55..6d98c9c8c4 100644 --- a/.expeditor/release.omnibus.yml +++ b/.expeditor/release.omnibus.yml @@ -68,8 +68,6 @@ builder-to-testers-map: - ubuntu-16.04-x86_64 - ubuntu-18.04-x86_64 - ubuntu-20.04-x86_64 - windows-2012r2-i386: - - windows-2012r2-i386 windows-2012r2-x86_64: - windows-2012-x86_64 - windows-2012r2-x86_64 diff --git a/omnibus/omnibus-test.ps1 b/omnibus/omnibus-test.ps1 index d9a549f89f..ccbd631ae9 100644 --- a/omnibus/omnibus-test.ps1 +++ b/omnibus/omnibus-test.ps1 @@ -131,17 +131,24 @@ $env:Path = $p # desktop heap exhaustion seems likely (https://docs.microsoft.com/en-us/archive/blogs/ntdebugging/desktop-heap-overview) $exit = 0 -bundle exec rspec -f progress --profile -- ./spec/unit +$format="progress" + +# use $Env:OMNIBUS_TEST_FORMAT if defined +If ($Env:OMNIBUS_TEST_FORMAT) { + $format = $Env:OMNIBUS_TEST_FORMAT +} + +bundle exec rspec -f $format --profile -- ./spec/unit If ($lastexitcode -ne 0) { $exit = 1 } Write-Output "Last exit code: $lastexitcode" Write-Output "" -bundle exec rspec -f progress --profile -- ./spec/functional +bundle exec rspec -f $format --profile -- ./spec/functional If ($lastexitcode -ne 0) { $exit = 1 } Write-Output "Last exit code: $lastexitcode" Write-Output "" -bundle exec rspec -f progress --profile -- ./spec/integration +bundle exec rspec -f $format --profile -- ./spec/integration If ($lastexitcode -ne 0) { $exit = 1 } Write-Output "Last exit code: $lastexitcode" Write-Output "" diff --git a/spec/integration/client/fips_spec.rb b/spec/integration/client/fips_spec.rb new file mode 100644 index 0000000000..7d8bfb2a2f --- /dev/null +++ b/spec/integration/client/fips_spec.rb @@ -0,0 +1,21 @@ +require "spec_helper" + +describe "chef-client fips" do + def enable_fips + OpenSSL.fips_mode = true + end + + # All tests assume fips mode is off at present + after { OpenSSL.fips_mode = false } + + # For non-FIPS OSes/builds of Ruby, enabling FIPS should error + example "Error enabling fips_mode if FIPS not linked", fips_mode: false do + expect { enable_fips }.to raise_error(OpenSSL::OpenSSLError) + end + + # For FIPS OSes/builds of Ruby, enabling FIPS should not error + example "Do not error enabling fips_mode if FIPS linked", fips_mode: true do + expect { enable_fips }.not_to raise_error + end +end + diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 51795fdf59..85b280a1a9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -139,6 +139,10 @@ RSpec.configure do |config| config.filter_run_excluding skip_buildkite: true if ENV["BUILDKITE"] + config.filter_run_excluding fips_mode: !fips_mode_build? unless opensuse? + # RubyDistros OpenSUSE docker images have a broken fips + config.filter_run_excluding :fips_mode if opensuse? + config.filter_run_excluding windows_only: true unless windows? config.filter_run_excluding not_supported_on_windows: true if windows? config.filter_run_excluding not_supported_on_macos: true if macos? diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index 0beea829fd..2fc31cc90d 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -226,6 +226,10 @@ def fips? ENV["CHEF_FIPS"] == "1" end +def fips_mode_build? + OpenSSL::OPENSSL_FIPS +end + class HttpHelper extend Ohai::Mixin::HttpHelper def self.logger |