Skip to content

Commit

Permalink
Merge b7fb805 into 15a222b
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Aug 16, 2022
2 parents 15a222b + b7fb805 commit f0de534
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
7 changes: 7 additions & 0 deletions package/yast2-storage-ng.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Aug 16 17:42:49 UTC 2022 - Josef Reidinger <jreidinger@suse.com>

- Adapt to new types of mount by in libstorage-ng. Skipped by now
as there is no request to support it. (bsc#1202225)
- 4.5.8

-------------------------------------------------------------------
Tue May 31 13:04:11 UTC 2022 - Stefan Hundhammer <shundhammer@suse.com>

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

Name: yast2-storage-ng
Version: 4.5.7
Version: 4.5.8
Release: 0
Summary: YaST2 - Storage Configuration
License: GPL-2.0-only OR GPL-3.0-only
Expand Down
8 changes: 8 additions & 0 deletions src/lib/y2storage/filesystems/mount_by_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ def udev_name(value)
end

class << self


# Supported types

def all_supported
all.reject { |t| t == PARTUUID || t == PARTLABEL }
end

# Type corresponding to the given fstab spec
#
# @param spec [String] content of the first column of an /etc/fstab entry
Expand Down
3 changes: 3 additions & 0 deletions src/lib/y2storage/mount_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ def mount_point_for_suitable(graph)
def filter_mount_bys(candidates, label, uuid)
candidates.delete(Filesystems::MountByType::LABEL) unless label
candidates.delete(Filesystems::MountByType::UUID) unless uuid
# filter out yast unsupported partuuid and partlabel
candidates.delete(Filesystems::MountByType::PARTLABEL)
candidates.delete(Filesystems::MountByType::PARTUUID)
end
end
end
36 changes: 18 additions & 18 deletions test/y2storage/mount_point_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@
context "and the filesystem has a label" do
before { filesystem.label = "something" }

it "returns all the existing types" do
it "returns all the supported types" do
expect(mount_point.suitable_mount_bys(label: label))
.to contain_exactly(*Y2Storage::Filesystems::MountByType.all)
.to contain_exactly(*Y2Storage::Filesystems::MountByType.all_supported)
end
end

context "and the filesystem has no label" do
it "returns all the existing types except LABEL" do
types = Y2Storage::Filesystems::MountByType.all.reject { |t| t.is?(:label) }
it "returns all the supported types except LABEL" do
types = Y2Storage::Filesystems::MountByType.all_supported.reject { |t| t.is?(:label) }
expect(mount_point.suitable_mount_bys(label: label)).to contain_exactly(*types)
end
end
Expand All @@ -198,16 +198,16 @@
context "and the filesystem has a label" do
before { filesystem.label = "something" }

it "returns all the existing types" do
it "returns all the supported types" do
expect(mount_point.suitable_mount_bys(label: label))
.to contain_exactly(*Y2Storage::Filesystems::MountByType.all)
.to contain_exactly(*Y2Storage::Filesystems::MountByType.all_supported)
end
end

context "and the filesystem has no label" do
it "returns all the existing types" do
it "returns all the supported types" do
expect(mount_point.suitable_mount_bys(label: label))
.to contain_exactly(*Y2Storage::Filesystems::MountByType.all)
.to contain_exactly(*Y2Storage::Filesystems::MountByType.all_supported)
end
end
end
Expand Down Expand Up @@ -288,8 +288,8 @@
context "and the filesystem has a label" do
before { filesystem.label = "something" }

it "returns all the existing types except the ones associated to udev links" do
types = Y2Storage::Filesystems::MountByType.all.reject { |t| t.is?(:id, :path) }
it "returns all the supported types except the ones associated to udev links" do
types = Y2Storage::Filesystems::MountByType.all_supported.reject { |t| t.is?(:id, :path) }
expect(mount_point.suitable_mount_bys(label: label)).to contain_exactly(*types)
end
end
Expand All @@ -309,15 +309,15 @@
context "and the filesystem has a label" do
before { filesystem.label = "something" }

it "returns all the existing types except the ones associated to udev links" do
types = Y2Storage::Filesystems::MountByType.all.reject { |t| t.is?(:id, :path) }
it "returns all the supported types except the ones associated to udev links" do
types = Y2Storage::Filesystems::MountByType.all_supported.reject { |t| t.is?(:id, :path) }
expect(mount_point.suitable_mount_bys(label: label)).to contain_exactly(*types)
end
end

context "although the filesystem has no label" do
it "returns all the existing types except the ones associated to udev links" do
types = Y2Storage::Filesystems::MountByType.all.reject { |t| t.is?(:id, :path) }
it "returns all the supported types except the ones associated to udev links" do
types = Y2Storage::Filesystems::MountByType.all_supported.reject { |t| t.is?(:id, :path) }
expect(mount_point.suitable_mount_bys(label: label)).to contain_exactly(*types)
end
end
Expand All @@ -329,15 +329,15 @@
context "and the filesystem has a label" do
before { filesystem.label = "something" }

it "returns all the existing types" do
it "returns all the supported types" do
expect(mount_point.suitable_mount_bys(encryption: encryption))
.to contain_exactly(*Y2Storage::Filesystems::MountByType.all)
.to contain_exactly(*Y2Storage::Filesystems::MountByType.all_supported)
end
end

context "and the filesystem has no label" do
it "returns all the existing types except LABEL" do
types = Y2Storage::Filesystems::MountByType.all.reject { |t| t.is?(:label) }
it "returns all the supported types except LABEL" do
types = Y2Storage::Filesystems::MountByType.all_supported.reject { |t| t.is?(:label) }
expect(mount_point.suitable_mount_bys(encryption: encryption)).to contain_exactly(*types)
end
end
Expand Down

0 comments on commit f0de534

Please sign in to comment.