Skip to content

Commit

Permalink
Merge pull request #1210 from joseivanlopez/fix-missing-label
Browse files Browse the repository at this point in the history
Partitioner: allow to define the filesystem label
  • Loading branch information
joseivanlopez committed Mar 10, 2021
2 parents df79cec + 0c5cddf commit 3d851b5
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
6 changes: 6 additions & 0 deletions package/yast2-storage-ng.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Mar 9 16:40:38 UTC 2021 - José Iván López González <jlopez@suse.com>

- Partitioner: allow to define the file system label (bsc#1183220).
- 4.3.47

-------------------------------------------------------------------
Wed Feb 25 16:26:55 UTC 2021 - Ancor Gonzalez Sosa <ancor@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.3.46
Version: 4.3.47
Release: 0
Summary: YaST2 - Storage Configuration
License: GPL-2.0-only OR GPL-3.0-only
Expand Down
6 changes: 2 additions & 4 deletions src/lib/y2partitioner/widgets/fstab_options.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) [2017-2020] SUSE LLC
# Copyright (c) [2017-2021] SUSE LLC
#
# All Rights Reserved.
#
Expand Down Expand Up @@ -259,9 +259,7 @@ def initialize(controller, parent_widget)
#
# @return [Boolean]
def supported_by_filesystem?
return false unless filesystem.supports_label?

super
filesystem.supports_label?
end

# @macro seeAbstractWidget
Expand Down
27 changes: 26 additions & 1 deletion test/y2partitioner/widgets/fstab_options_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env rspec
# Copyright (c) [2017-2020] SUSE LLC

# Copyright (c) [2017-2021] SUSE LLC
#
# All Rights Reserved.
#
Expand Down Expand Up @@ -101,6 +102,30 @@

include_examples "InputField"

describe "#supported_by_filesystem?" do
before do
filesystem = device.filesystem
allow(controller).to receive(:filesystem).and_return(filesystem)
allow(filesystem).to receive(:supports_label?).and_return(supported)
end

context "when the filesystem supports a label" do
let(:supported) { true }

it "returns true" do
expect(subject.supported_by_filesystem?).to eq(true)
end
end

context "when the filesystem does not support a label" do
let(:supported) { false }

it "returns false" do
expect(subject.supported_by_filesystem?).to eq(false)
end
end
end

describe "#validate" do
RSpec.shared_examples "given_label" do
context "and a label is given" do
Expand Down

0 comments on commit 3d851b5

Please sign in to comment.