Skip to content

Commit

Permalink
Merge pull request #1333 from ancorgs/bsc1209588_sp5
Browse files Browse the repository at this point in the history
Guided Setup: display a hint for disks with sensible transports
  • Loading branch information
ancorgs committed Apr 24, 2023
2 parents 4af0e59 + cf949f6 commit 7746bc1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
7 changes: 7 additions & 0 deletions package/yast2-storage-ng.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Apr 24 14:47:33 UTC 2023 - Ancor Gonzalez Sosa <ancor@suse.com>

- Guided Setup: display a hint for disks with sensible data
transports like FCoE or NVMe/oF (bsc#1209588).
- 4.5.22

-------------------------------------------------------------------
Tue Apr 18 08:23:44 UTC 2023 - Ancor Gonzalez Sosa <ancor@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-storage-ng.spec
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-storage-ng
Version: 4.5.21
Version: 4.5.22
Release: 0
Summary: YaST2 - Storage Configuration
License: GPL-2.0-only OR GPL-3.0-only
Expand Down
4 changes: 4 additions & 0 deletions src/lib/y2storage/dialogs/guided_setup/helpers/disk.rb
Expand Up @@ -98,6 +98,10 @@ def label_for_transport(transport)
_("USB")
elsif transport.is?(:sbp)
_("IEEE 1394")
# FIXME: Find alternative ways to represent these transports with better support for
# i18n, etc. This implementation is the bare minimum for bsc#1209588.
elsif transport.is?(:iscsi, :fcoe, :tcp, :fc, :rdma)
transport.to_s
else
""
end
Expand Down
28 changes: 19 additions & 9 deletions test/y2storage/dialogs/guided_setup/helpers/disk_test.rb
Expand Up @@ -37,20 +37,14 @@
allow(disk).to receive(:transport).and_return(transport)
allow(disk).to receive(:sd_card?).and_return(sd_card)
allow(disk).to receive(:boss?).and_return(boss)

allow(transport).to receive(:is?).with(:usb).and_return(usb)
allow(transport).to receive(:is?).with(:sbp).and_return(sbp)

allow(analyzer).to receive(:installed_systems).with(disk).and_return(installed_systems)
end

let(:disk) { instance_double(Y2Storage::Disk) }

let(:transport) { instance_double(Y2Storage::DataTransport) }
let(:transport) { Y2Storage::DataTransport::UNKNOWN }

let(:name) { "/dev/sda" }
let(:usb) { false }
let(:sbp) { false }
let(:sd_card) { false }
let(:boss) { false }
let(:installed_systems) { [] }
Expand All @@ -76,21 +70,37 @@
end

context "when the disk transport is usb" do
let(:usb) { true }
let(:transport) { Y2Storage::DataTransport::USB }

it "includes the 'USB' label" do
expect(subject.label(disk)).to match(/USB/)
end
end

context "when the disk transport is sbp" do
let(:sbp) { true }
let(:transport) { Y2Storage::DataTransport::SBP }

it "includes the 'IEEE 1394' label" do
expect(subject.label(disk)).to match(/IEEE 1394/)
end
end

context "when the disk transport is FCoE" do
let(:transport) { Y2Storage::DataTransport::FCOE }

it "includes the raw transport name" do
expect(subject.label(disk)).to match(/fcoe/)
end
end

context "when the disk transport is sata" do
let(:transport) { Y2Storage::DataTransport::SATA }

it "does not include any reference to the transport" do
expect(subject.label(disk)).to_not match(/sata/i)
end
end

context "when the disk contains installed systems" do
let(:installed_systems) { ["Windows", "Linux"] }

Expand Down

0 comments on commit 7746bc1

Please sign in to comment.