Skip to content

Commit

Permalink
Merge pull request #1219 from yast/sw_51
Browse files Browse the repository at this point in the history
ensure mount options are not doubled (bsc#1186298)
  • Loading branch information
wfeldt committed Jun 4, 2021
2 parents a108a51 + 73826fa commit c2e7556
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 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 @@
-------------------------------------------------------------------
Fri Jun 4 09:51:58 UTC 2021 - Steffen Winterfeldt <snwint@suse.com>

- ensure mount options are not doubled (bsc#1186298)
- 4.2.117

-------------------------------------------------------------------
Fri May 21 10:50:11 UTC 2021 - Steffen Winterfeldt <snwint@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.2.116
Version: 4.2.117
Release: 0
Summary: YaST2 - Storage Configuration
License: GPL-2.0-only OR GPL-3.0-only
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2storage/planned/can_be_formatted.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def fstab_options_for(mount_point)
[]
end
options.push("ro") if read_only && !options.include?("rw")
options
options.uniq
end

# Creates subvolumes in the previously created filesystem that is placed
Expand Down
15 changes: 13 additions & 2 deletions test/y2storage/planned/can_be_formatted_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,20 @@ def reuse!(devicegraph)
planned.read_only = true
end

it "sets the 'ro' option" do
it "sets the 'ro' option exactly once" do
planned.format!(blk_device)
expect(blk_device.filesystem.mount_options).to include("ro")
expect(blk_device.filesystem.mount_options.count { |x| x == "ro" }).to eq(1)
end

context "and fstab options also include the 'ro' flag" do
before do
planned.fstab_options = ["ro"]
end

it "sets the 'ro' option exactly once" do
planned.format!(blk_device)
expect(blk_device.filesystem.mount_options.count { |x| x == "ro" }).to eq(1)
end
end

context "but fstab options include the 'rw' flag" do
Expand Down

0 comments on commit c2e7556

Please sign in to comment.