diff --git a/package/yast2-storage-ng.changes b/package/yast2-storage-ng.changes index 885aa81c38..6a3ee556d8 100644 --- a/package/yast2-storage-ng.changes +++ b/package/yast2-storage-ng.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jan 9 15:36:15 UTC 2018 - lslezak@suse.cz + +- Added Mountable#persistent? (needed for bsc#1073696) +- 4.0.68 + ------------------------------------------------------------------- Mon Jan 8 22:16:30 UTC 2018 - ancor@suse.com diff --git a/package/yast2-storage-ng.spec b/package/yast2-storage-ng.spec index 829711fba4..c742f2313b 100644 --- a/package/yast2-storage-ng.spec +++ b/package/yast2-storage-ng.spec @@ -16,7 +16,7 @@ # Name: yast2-storage-ng -Version: 4.0.67 +Version: 4.0.68 Release: 0 BuildArch: noarch diff --git a/src/lib/y2storage/mountable.rb b/src/lib/y2storage/mountable.rb index c442fcd757..7531950d86 100644 --- a/src/lib/y2storage/mountable.rb +++ b/src/lib/y2storage/mountable.rb @@ -88,6 +88,16 @@ def mountpoint=(path) alias_method :mount_point=, :mountpoint= + # Is the mount persistent? + # + # @return [Boolean] true if the mount point is saved to /etc/fstab + # (and will be mounted at boot again), false otherwise + def persistent? + # TODO: this implementation needs to be adapted after adding the Y2Storage + # wrapper for Storage::MountPoint + to_storage_value.has_mount_point && to_storage_value.mount_point.in_etc_fstab? + end + # Sets the options to use in /etc/fstab for a newly created filesystem. # # @param new_options [Array] diff --git a/test/y2storage/filesystems/blk_filesystem_test.rb b/test/y2storage/filesystems/blk_filesystem_test.rb index 5f680b7f21..14023ad1ba 100644 --- a/test/y2storage/filesystems/blk_filesystem_test.rb +++ b/test/y2storage/filesystems/blk_filesystem_test.rb @@ -50,6 +50,24 @@ end end + describe "#persistent?" do + context "for not mounted filesystem" do + let(:dev_name) { "/dev/sdb3" } + + it "returns false" do + expect(filesystem.persistent?).to eq false + end + + context "after adding a mount point" do + before { filesystem.mount_point = "/mnt/test" } + + it "returns true" do + expect(filesystem.persistent?).to eq true + end + end + end + end + describe "#in_network?" do let(:disk) { Y2Storage::BlkDevice.find_by_name(fake_devicegraph, "/dev/sda") }