From 6b8b56beaff4ccb36e045a4be62ba6c2e8d2c2e1 Mon Sep 17 00:00:00 2001 From: Cas Donoghue Date: Thu, 27 Feb 2025 09:08:35 -0800 Subject: [PATCH] Skip offline pack manager tests when running in fips mode (#17160) This commit introduces a pattern for skipping tests we do not want to run in fips mode. In this case the plugin manager tests rely on using bundler/net-http/openssl which is not configured to be run with bouncycastle fips providers. --- qa/integration/specs/cli/install_spec.rb | 4 ++-- spec/spec_helper.rb | 2 +- spec/unit/plugin_manager/offline_plugin_packager_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qa/integration/specs/cli/install_spec.rb b/qa/integration/specs/cli/install_spec.rb index 89a97973c6e..34aabcb56f6 100644 --- a/qa/integration/specs/cli/install_spec.rb +++ b/qa/integration/specs/cli/install_spec.rb @@ -95,7 +95,7 @@ def gem_in_lock_file?(pattern, lock_file) end end - context "pack" do + context "pack", :skip_fips do context "when the command is run in the `$LOGSTASH_HOME`" do include_examples "install from a pack" end @@ -118,7 +118,7 @@ def gem_in_lock_file?(pattern, lock_file) end end - context "install non bundle plugin" do + context "install non bundle plugin", :skip_fips do let(:plugin_name) { "logstash-input-github" } let(:install_command) { "bin/logstash-plugin install" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0c736aea01b..836b80d4846 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -63,7 +63,7 @@ def puts(payload) Flores::RSpec.configure(c) c.include LogStashHelper c.extend LogStashHelper - + c.filter_run_excluding skip_fips: true if java.lang.System.getProperty("org.bouncycastle.fips.approved_only") == "true" if ENV['COVERAGE'] c.after(:suite) do SimpleCov.result.format! diff --git a/spec/unit/plugin_manager/offline_plugin_packager_spec.rb b/spec/unit/plugin_manager/offline_plugin_packager_spec.rb index c66e7d66deb..785265b1329 100644 --- a/spec/unit/plugin_manager/offline_plugin_packager_spec.rb +++ b/spec/unit/plugin_manager/offline_plugin_packager_spec.rb @@ -79,7 +79,7 @@ def retrieve_dependencies_gems(path) end end - context "when the plugins exist" do + context "when the plugins exist", :skip_fips do before :all do Paquet.ui = Paquet::SilentUI end