From 2a4e4fd9748afc0fbe3e301f141281dd5de403cb Mon Sep 17 00:00:00 2001 From: Ancor Gonzalez Sosa Date: Wed, 18 Oct 2023 14:12:24 +0200 Subject: [PATCH] WIP --- test/spec_helper.rb | 3 +++ test/y2storage/hwinfo_reader_test.rb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/spec_helper.rb b/test/spec_helper.rb index 04c12665e..1891a9ac8 100644 --- a/test/spec_helper.rb +++ b/test/spec_helper.rb @@ -136,6 +136,9 @@ def run; end end end + allow(Y2Storage::HWInfoReader.instance).to receive(:for_device) + .and_return Y2Storage::HWInfoDisk.new + # Bcache is only supported for x86_64 architecture. Probing the devicegraph complains if Bcache is # used with another architecture. Bcache error is avoided here. Otherwise, x86_84 architecture must # to be set for every test using Bcache (which has demonstrated to be quite error prone). diff --git a/test/y2storage/hwinfo_reader_test.rb b/test/y2storage/hwinfo_reader_test.rb index 457dc24be..216121547 100755 --- a/test/y2storage/hwinfo_reader_test.rb +++ b/test/y2storage/hwinfo_reader_test.rb @@ -29,6 +29,9 @@ let(:hwinfo_file) { "hwinfo.txt" } before do + # Disable the global mock that normally prevents calls to hwinfo + allow(reader).to receive(:for_device).and_call_original + allow(Yast::Execute).to receive(:on_target!) .with(/hwinfo/, anything, anything, anything).and_return(hwinfo_output) reader.reset