Hello community,

here is the log from the commit of package yast2-storage-ng for 
openSUSE:Factory checked in at 2020-08-14 13:07:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-storage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-storage-ng.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-storage-ng"

Fri Aug 14 13:07:21 2020 rev:87 rq:824819 version:4.3.14

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-storage-ng/yast2-storage-ng.changes        
2020-07-09 13:16:27.744718696 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-storage-ng.new.3399/yast2-storage-ng.changes  
    2020-08-14 13:07:23.981166094 +0200
@@ -1,0 +2,20 @@
+Thu Aug  6 12:00:08 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- AutoinstProposal now properly reports the proposal as failed when
+  it fails to find the disks (bsc#1174469)
+- 4.3.14
+
+-------------------------------------------------------------------
+Wed Aug  5 15:06:26 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- Proposal: fixed detection of shadowed subvolumes for roles using
+  separate LVM volume groups for each filesystem (bsc#1174475).
+- 4.3.13
+
+-------------------------------------------------------------------
+Fri Jul 17 11:44:48 UTC 2020 - David Diaz <[email protected]>
+
+- Partitioner: fix stripes size reported for thin LVs.
+- Partitioner: do not show stripes size when its value is zero.
+
+-------------------------------------------------------------------

Old:
----
  yast2-storage-ng-4.3.12.tar.bz2

New:
----
  yast2-storage-ng-4.3.14.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-storage-ng.spec ++++++
--- /var/tmp/diff_new_pack.xtVYeP/_old  2020-08-14 13:07:24.889166440 +0200
+++ /var/tmp/diff_new_pack.xtVYeP/_new  2020-08-14 13:07:24.893166441 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-storage-ng
-Version:        4.3.12
+Version:        4.3.14
 Release:        0
 Summary:        YaST2 - Storage Configuration
 License:        GPL-2.0-only OR GPL-3.0-only

++++++ yast2-storage-ng-4.3.12.tar.bz2 -> yast2-storage-ng-4.3.14.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-storage-ng-4.3.12/doc/lvm.md 
new/yast2-storage-ng-4.3.14/doc/lvm.md
--- old/yast2-storage-ng-4.3.12/doc/lvm.md      2020-07-07 14:06:51.000000000 
+0200
+++ new/yast2-storage-ng-4.3.14/doc/lvm.md      2020-08-07 10:12:49.000000000 
+0200
@@ -4,13 +4,33 @@
 like RAID, snapshots, thin provisioning and whatsnot that often result in 
special types of logical
 volumes being present in the system.
 
-This document summarizes how well YaST deals with systems that contain such 
advanced LVM setups.
+This document summarizes how the very last version of YaST (that is, the one 
available in openSUSE
+Tumbleweed) deals with systems that contain such advanced LVM setups.
+
+## The Proposal (Guided Setup)
+
+The partitioning proposal will never create logical volumes of any special 
type beyond normal ones.
+
+In some cases, the proposal may decide to reuse an existing volume group but, 
even in that case, the
+existence of logical volumes of special types will have no negative impact in 
the proposal since:
+
+- The proposal never reuses existing logical volumes, as proven by [these unit
+tests](https://github.com/yast/yast-storage-ng/blob/2315bb6998/test/y2storage/proposal/devices_planner_strategies/ng_test.rb).
+- If the proposal decides to delete existing logical volumes, the dependencies 
between them will
+  be honored (see [pull 
request#1106](https://github.com/yast/yast-storage-ng/pull/1106)).
+- When calculating the space available in an existing volume group after each 
tentative operation,
+  the proposal relies on libstorage-ng, which should be able to deal with all 
kind of LVs.
+
+## The Offline Upgrade Process
+
+Since YaST is able to recognize filesystems on top of any kind of logical 
volume, it allows to
+upgrade any system installed over LVM, including RAID, cache, thin-provisioned 
volumes, etc.
+It even allows to select a snapshot as the system to be upgraded.
 
 ## The Partitioner
 
 This section describes how the Expert Partitioner represent the different LVM 
technologies and what
-operations it allows for each type of logical volume. At the current stage, 
some operations show an
-unexpected behavior and, in most cases, would need to be adjusted. That is 
represented in bold text.
+operations it allows for each type of logical volume.
 
 Note that, unlike RAID0, striped LVs are not really a separate type. Many 
types of LVs can be
 striped.
@@ -29,11 +49,10 @@
 
 - Only the thin pool and its thin LVs are displayed. No trace of the hidden 
LVs used to store the
   data and the metadata of each thin LV or to store the spare metadata of the 
VG.
-- Due to a bug, **nothing in the UI identifies the displayed LVs as being 
special**. They basically
-  look like normal LVs, although `BlkDevicesTable::DEVICE_LABELS` contains 
entries for both thin
-  pools and thin LVs.
+- Thin pools and thin LVs are identified as such in the tables. On the other 
hand, the description
+  page of a thin pool or a thin LV looks just like the one of a normal LV.
 - In LVM is not possible to define striping for thin LVs, they use the 
striping defined for their thin
-  pools. The partitioner UI **reports 0 stripes for all thin LVs**.
+  pools.
 
 #### What can be done?
 
@@ -44,8 +63,8 @@
   - Delete: it works. Note it deletes the pool, all its thin volumes and the 
associated hidden LVs.
 
 - For thin LVs
-  - Create: it works. The **widgets for defining striping are disabled and set 
to the default values**.
-    Maybe it would be better to show them disabled but with the pool values. 
Or to not show them at all.
+  - Create: it works. The widgets for defining striping are disabled and set 
to the values of the
+    corresponding thin pool.
   - Edit (format/mount): just as a normal LV.
   - Resize: it works.
   - Delete: it works. Note it deletes the thin volume and all the associated 
hidden LVs.
@@ -56,8 +75,8 @@
 
 - Only the cache LV is displayed. No trace of the hidden LVs (origin LV, cache 
pool, cache data LV
   nor cache metadata LV).
-- **Nothing in the UI identifies the cache LV as being so**, it basically 
looks like a normal LV
-  (eg. there is no entry for cache LV at `BlkDevicesTable::DEVICE_LABELS`)
+- The cache LVs are identified as such in the tables. On the other hand, the 
description page of a
+  cache LV looks just like the one of a normal LV.
 
 #### What can be done?
 
@@ -72,24 +91,25 @@
 #### How is it displayed?
 
 - Only the cache LV is displayed. No trace of the hidden cache volume.
-- **Nothing in the UI identifies the cache LV as being so**, just like the 
previous case.
+- The cache LV is identified as such in the tables but not in its description 
page, just like the
+  previous case.
 
 #### What can be done?
 
 - Create: not possible.
 - Edit (format/mount): just as a normal LV.
 - Resize: not allowed ("_Resizing of this type of LVM logical volumes is not 
supported_").
-- Delete: it works. It only deletes the cache LV, the LV used as cache 
survives (it becomes a
-  normal LV) **but is not visible immediately**. A reprobing after the commit 
phase is needed.
-  The root cause is an inconsistent behavior of `lvremove` compared to other 
cases, reported
-  as [bsc#1171907](https://bugzilla.suse.com/show_bug.cgi?id=1171907).
+- Delete: it works. Note it deletes the cache LV and also its cache volume, as 
long as the `lvm2`
+  package includes the fix for 
[bsc#1171907](https://bugzilla.suse.com/show_bug.cgi?id=1171907)
+  (which is the case for Tumbleweed and for a fully up-to-date SLE 15-SP2).
 
 ### Unused Cache Pool
 
 #### How is it displayed?
 
 - Only the cache pool is displayed. No trace of the hidden LVs (cache data LV 
and cache metadata LV).
-- **Nothing in the UI identifies the cache pool as being so**, just like the 
previous cases.
+- The cache pool is identified as such in the tables but not in its 
description page, just like the
+  previous case.
 
 #### What can be done?
 
@@ -103,8 +123,8 @@
 #### How is it displayed?
 
 - Only the RAID LV is displayed. No trace of the so-called subLVs.
-- **Nothing in the UI identifies the RAID LV as being so**, it basically looks 
like a normal LV
-  (eg. there is no entry for the RAID types at 
`BlkDevicesTable::DEVICE_LABELS`)
+- The RAID LVs are identified as such in the tables. On the other hand, the 
description page of a
+  RAID LV looks just like the one of a normal LV.
 
 #### What can be done?
 
@@ -118,8 +138,8 @@
 #### How is it displayed?
 
 - Only the mirror LV is displayed. No trace of the hidden mirrors used for its 
images and metadata.
-- **Nothing in the UI identifies the mirror LV as being so**, it basically 
looks like a normal LV
-  (eg. there is no entry for the RAID types at 
`BlkDevicesTable::DEVICE_LABELS`)
+- The mirror LVs are identified as such in the tables. On the other hand, the 
description page of a
+  mirror LV looks just like the one of a normal LV.
 
 #### What can be done?
 
@@ -132,33 +152,38 @@
 
 #### How is it displayed?
 
-- The snapshot LV is displayed as a normal LV. **Nothing in the UI says its 
type is `snapshot`**
-  (eg. there is no entry for snapshots at `BlkDevicesTable::DEVICE_LABELS`).
-- There is **no information in the UI about the relationship with its origin** 
LV.
+- The snapshot LV is identified as such in the tables, including the name of 
its origin LV.
+- The description page of any LV that serves as origin contains a list of all 
its snapshots.
+  On the other hand, the description pages of the snapshots look like normal 
LVs, with no
+  reference to the origin LVs.
 
 #### What can be done?
 
 - Create: not possible.
-- Edit (format/mount): **just as a normal LV**. May not be strictly wrong but 
is weird at least.
+- Edit (format/mount): It's allowed but a warning is displayed beforehand 
("_The device is an
+  LVM snapshot volume of x. Do you really want to edit it?_").
 - Resize: not allowed ("_Resizing of this type of LVM logical volumes is not 
supported_").
 - Delete: it works.
-- Delete the origin LV: the corresponding snapshots are deleted during the 
commit phase, but
-  **not immediately in the devicegraph in memory**. Moreover, the Partitioner 
**does not warn**
-  about the snapshots that are going to be deleted.
+- Delete the origin LV: the corresponding snapshots are deleted right away, 
since they cannot
+  survive their origin. The Partitioner warns beforehand about the snapshots 
that are going to
+  be deleted.
 
 ### Thin LVM Snapshots
 
 #### How is it displayed?
 
-- The snapshot LV **is displayed in the UI as a normal LV**, although it's 
type in the devicegraph
-  is `thin-pool`. That's due to a bug already commented in the section about 
thin provisioning.
-- There is **no information in the UI about the relationship with its origin** 
LV.
+- The thin snapshot is identified as such in the tables, including the name of 
its origin LV.
+- The description page of any LV that serves as origin contains a list of all 
its snapshots,
+  including the thin ones. On the other hand, the description pages of the 
thin snapshots look
+  like normal LVs, with no reference to the origin LVs.
 
 #### What can be done?
 
 - Create: not possible.
-- Edit (format/mount): **just as a normal LV**. May not be strictly wrong but 
is weird at least.
-- Resize: **it works** since this is just a thin LV. Again, maybe not wrong 
but weird.
+- Edit (format/mount): It's allowed but a warning is displayed beforehand 
("_The device is an
+  LVM snapshot volume of x. Do you really want to edit it?_").
+- Resize: It works but a warning is displayed beforehand ("_Selected device is 
an LVM Thin Snapshot.
+  Do you really want to resize it?_").
 - Delete: it works.
 - Delete the origin LV: it works. The snapshots are not affected.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.3.12/package/yast2-storage-ng.changes 
new/yast2-storage-ng-4.3.14/package/yast2-storage-ng.changes
--- old/yast2-storage-ng-4.3.12/package/yast2-storage-ng.changes        
2020-07-07 14:06:51.000000000 +0200
+++ new/yast2-storage-ng-4.3.14/package/yast2-storage-ng.changes        
2020-08-07 10:12:49.000000000 +0200
@@ -1,4 +1,24 @@
 -------------------------------------------------------------------
+Thu Aug  6 12:00:08 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- AutoinstProposal now properly reports the proposal as failed when
+  it fails to find the disks (bsc#1174469)
+- 4.3.14
+
+-------------------------------------------------------------------
+Wed Aug  5 15:06:26 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- Proposal: fixed detection of shadowed subvolumes for roles using
+  separate LVM volume groups for each filesystem (bsc#1174475).
+- 4.3.13
+
+-------------------------------------------------------------------
+Fri Jul 17 11:44:48 UTC 2020 - David Diaz <[email protected]>
+
+- Partitioner: fix stripes size reported for thin LVs.
+- Partitioner: do not show stripes size when its value is zero.
+
+-------------------------------------------------------------------
 Tue Jul  7 10:57:59 UTC 2020 - David Diaz <[email protected]>
 
 - Partitioner: fix and improve the information shown for each
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.3.12/package/yast2-storage-ng.spec 
new/yast2-storage-ng-4.3.14/package/yast2-storage-ng.spec
--- old/yast2-storage-ng-4.3.12/package/yast2-storage-ng.spec   2020-07-07 
14:06:51.000000000 +0200
+++ new/yast2-storage-ng-4.3.14/package/yast2-storage-ng.spec   2020-08-07 
10:12:49.000000000 +0200
@@ -16,7 +16,7 @@
 #
 
 Name:           yast2-storage-ng
-Version:        4.3.12
+Version:        4.3.14
 Release:        0
 Summary:        YaST2 - Storage Configuration
 License:        GPL-2.0-only OR GPL-3.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.3.12/src/lib/y2partitioner/widgets/lvm_lv_attributes.rb 
new/yast2-storage-ng-4.3.14/src/lib/y2partitioner/widgets/lvm_lv_attributes.rb
--- 
old/yast2-storage-ng-4.3.12/src/lib/y2partitioner/widgets/lvm_lv_attributes.rb  
    2020-07-07 14:06:51.000000000 +0200
+++ 
new/yast2-storage-ng-4.3.14/src/lib/y2partitioner/widgets/lvm_lv_attributes.rb  
    2020-08-07 10:12:49.000000000 +0200
@@ -44,7 +44,7 @@
 
       # @return [String]
       def stripes_info(lvm_lv)
-        if lvm_lv.stripes <= 1
+        if lvm_lv.stripe_size.zero?
           lvm_lv.stripes.to_i
         else
           format(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.3.12/src/lib/y2storage/autoinst_proposal.rb 
new/yast2-storage-ng-4.3.14/src/lib/y2storage/autoinst_proposal.rb
--- old/yast2-storage-ng-4.3.12/src/lib/y2storage/autoinst_proposal.rb  
2020-07-07 14:06:51.000000000 +0200
+++ new/yast2-storage-ng-4.3.14/src/lib/y2storage/autoinst_proposal.rb  
2020-08-07 10:12:49.000000000 +0200
@@ -75,7 +75,7 @@
     def calculate_proposal
       drives = Proposal::AutoinstDrivesMap.new(initial_devicegraph, 
partitioning, issues_list)
       if issues_list.fatal?
-        @devices = []
+        @devices = nil
         return @devices
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-storage-ng-4.3.12/src/lib/y2storage/lvm_lv.rb 
new/yast2-storage-ng-4.3.14/src/lib/y2storage/lvm_lv.rb
--- old/yast2-storage-ng-4.3.12/src/lib/y2storage/lvm_lv.rb     2020-07-07 
14:06:51.000000000 +0200
+++ new/yast2-storage-ng-4.3.14/src/lib/y2storage/lvm_lv.rb     2020-08-07 
10:12:49.000000000 +0200
@@ -67,10 +67,14 @@
     #     (i.e., bigger than 128)
     storage_forward :stripes=
 
-    # @!attribute stripe_size
-    #   Size of a stripe. DiskSize.zero if the LV is not striped.
-    #   @return [DiskSize]
-    storage_forward :stripe_size, as: "DiskSize"
+    # @see #stripe_size
+    storage_forward :storage_stripe_size, to: :stripe_size, as: "DiskSize"
+    private :storage_stripe_size
+
+    # @!method stripe_size=(stripe_size)
+    #   Sets the size of a stripe
+    #
+    #   @param stripe_size [DiskSize, Integer]
     storage_forward :stripe_size=
 
     # @!method max_size_for_lvm_lv(lv_type)
@@ -139,6 +143,16 @@
       thin_pool ? thin_pool.stripes : storage_stripes
     end
 
+    # Size of a stripe
+    #
+    # @note it returns the value of Storage::LvmLv#stripe_size, except for 
thin volumes that are
+    #   going to report the striping size defined for their thin pools.
+    #
+    # @return [DiskSize]
+    def stripe_size
+      thin_pool ? thin_pool.stripe_size : storage_stripe_size
+    end
+
     # Whether the thin pool is overcommitted
     #
     # @note Overcommitting means that a thin pool has not enough size to cover
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.3.12/src/lib/y2storage/planned/can_be_formatted.rb 
new/yast2-storage-ng-4.3.14/src/lib/y2storage/planned/can_be_formatted.rb
--- old/yast2-storage-ng-4.3.12/src/lib/y2storage/planned/can_be_formatted.rb   
2020-07-07 14:06:51.000000000 +0200
+++ new/yast2-storage-ng-4.3.14/src/lib/y2storage/planned/can_be_formatted.rb   
2020-08-07 10:12:49.000000000 +0200
@@ -137,7 +137,7 @@
         return [] if subvolumes.nil?
 
         other_devices = all_devices - [self]
-        other_mount_points = other_devices.map { |dev| mount_point_for(dev) 
}.compact
+        other_mount_points = other_devices.flat_map { |dev| 
mount_points_for(dev) }
         subvolumes.select { |s| s.shadowed?(mount_point, other_mount_points) }
       end
 
@@ -255,6 +255,18 @@
       end
 
       # @param device [Planned::Device]
+      def mount_points_for(device)
+        points =
+          if device.is_a?(LvmVg)
+            device.lvs.map { |lv| mount_point_for(lv) }
+          else
+            [mount_point_for(device)]
+          end
+
+        points.compact
+      end
+
+      # @param device [Planned::Device]
       def mount_point_for(device)
         return nil unless device.respond_to?(:mount_point)
         return nil if device.mount_point.nil? || device.mount_point.empty?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.3.12/src/lib/y2storage/proposal/base.rb 
new/yast2-storage-ng-4.3.14/src/lib/y2storage/proposal/base.rb
--- old/yast2-storage-ng-4.3.12/src/lib/y2storage/proposal/base.rb      
2020-07-07 14:06:51.000000000 +0200
+++ new/yast2-storage-ng-4.3.14/src/lib/y2storage/proposal/base.rb      
2020-08-07 10:12:49.000000000 +0200
@@ -39,7 +39,9 @@
       attr_reader :planned_devices
 
       # Proposed layout of devices, nil if the proposal has not been 
calculated yet
-      # @return [Devicegraph]
+      # or if it was impossible to calculate one
+      #
+      # @return [Devicegraph, nil]
       attr_reader :devices
 
       # If this proposal was generated via {GuidedProposal.initial}, this
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.3.12/test/y2storage/autoinst_proposal_test.rb 
new/yast2-storage-ng-4.3.14/test/y2storage/autoinst_proposal_test.rb
--- old/yast2-storage-ng-4.3.12/test/y2storage/autoinst_proposal_test.rb        
2020-07-07 14:06:51.000000000 +0200
+++ new/yast2-storage-ng-4.3.14/test/y2storage/autoinst_proposal_test.rb        
2020-08-07 10:12:49.000000000 +0200
@@ -730,6 +730,11 @@
           end
           expect(issue).to_not be_nil
         end
+
+        it "marks the proposal as failed" do
+          proposal.propose
+          expect(proposal.failed?).to eq true
+        end
       end
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.3.12/test/y2storage/lvm_lv_test.rb 
new/yast2-storage-ng-4.3.14/test/y2storage/lvm_lv_test.rb
--- old/yast2-storage-ng-4.3.12/test/y2storage/lvm_lv_test.rb   2020-07-07 
14:06:51.000000000 +0200
+++ new/yast2-storage-ng-4.3.14/test/y2storage/lvm_lv_test.rb   2020-08-07 
10:12:49.000000000 +0200
@@ -175,6 +175,25 @@
     end
   end
 
+  describe "#stripe_size" do
+    context "when volume is a thin LV" do
+      let(:thin_pool) { fake_devicegraph.find_by_name("/dev/vg0/thinpool0") }
+      let(:device_name) { "/dev/vg0/thinvol1" }
+
+      it "returns the stripe size defined by its thin pool" do
+        expect(subject.stripe_size).to eq(thin_pool.stripe_size)
+      end
+    end
+
+    context "when volume is not a thin LV" do
+      let(:device_name) { "/dev/vg0/striped1" }
+
+      it "returns its stripping value" do
+        expect(subject.stripe_size).to eq(4.KiB)
+      end
+    end
+  end
+
   describe "#origin" do
     context "when called over a snapshot volume" do
       let(:original_volume) { 
fake_devicegraph.find_by_name("/dev/vg0/normal1") }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.3.12/test/y2storage/proposal_separate_vgs_test.rb 
new/yast2-storage-ng-4.3.14/test/y2storage/proposal_separate_vgs_test.rb
--- old/yast2-storage-ng-4.3.12/test/y2storage/proposal_separate_vgs_test.rb    
2020-07-07 14:06:51.000000000 +0200
+++ new/yast2-storage-ng-4.3.14/test/y2storage/proposal_separate_vgs_test.rb    
2020-08-07 10:12:49.000000000 +0200
@@ -33,10 +33,46 @@
     let(:settings_format) { :ng }
     let(:control_file) { "separate_vgs.xml" }
     let(:scenario) { "empty_disks" }
-    before { settings.separate_vgs = separate_vgs }
+    before do
+      settings.separate_vgs = separate_vgs
+
+      root_vol = settings.volumes.find { |vol| vol.mount_point == "/" }
+      root_vol.fs_type = Y2Storage::Filesystems::Type::BTRFS
+      root_vol.subvolumes = [
+        Y2Storage::SubvolSpecification.new("home"), 
Y2Storage::SubvolSpecification.new("srv")
+      ]
+    end
 
     let(:mounted_devices) do
-      Y2Storage::MountPoint.all(proposal.devices).map { |i| 
i.filesystem.blk_devices.first }
+      Y2Storage::MountPoint.all(proposal.devices).map { |i| 
i.filesystem.blk_devices.first }.uniq
+    end
+
+    let(:root_fs) do
+      Y2Storage::MountPoint.find_by_path(proposal.devices, 
"/").first.filesystem
+    end
+
+    let(:subvol_specs) { proposal.settings.volumes.flat_map(&:subvolumes) }
+    let(:subvols) { root_fs.btrfs_subvolumes.reject { |s| s.path.empty? } }
+
+    RSpec.shared_examples "duplicated mount paths" do
+      it "does not duplicate mount points" do
+        proposal.propose
+
+        mount_paths = Y2Storage::MountPoint.all(proposal.devices).map(&:path)
+        expect(mount_paths.size).to eq mount_paths.uniq.size
+      end
+    end
+
+    RSpec.shared_examples "shadowed subvolumes" do
+      it "does not create subvolumes that are shadowed" do
+        proposal.propose
+
+        expect(subvols.size).to be < subvol_specs.size
+        expect(subvol_specs.map(&:path)).to include "srv"
+        expect(subvols.map(&:path)).to_not include "srv"
+      end
+
+      include_examples "duplicated mount paths"
     end
 
     context "when ProposalSettings#lvm is set to true" do
@@ -53,6 +89,24 @@
           is_lv = mounted_devices.map { |i| i.is?(:lvm_lv) }
           expect(is_lv).to all(eq(true))
         end
+
+        # Regression tests for bug#1174475, the /srv subvol was created despite
+        # being shadowed by the volume created in a separate LVM VG
+        include_examples "shadowed subvolumes"
+
+        # Just to make sure subvolumes are not considered as shadowed when 
they are not
+        context "but the separate volumes are disabled" do
+          before do
+            settings.volumes.each { |vol| vol.proposed = !vol.separate_vg? }
+          end
+
+          it "creates all the subvolumes" do
+            proposal.propose
+            expect(subvols.size).to eq subvol_specs.size
+          end
+
+          include_examples "duplicated mount paths"
+        end
       end
 
       context "but ProposalSettings#separate_vgs is set to false" do
@@ -67,6 +121,8 @@
           is_lv = mounted_devices.map { |i| i.is?(:lvm_lv) }
           expect(is_lv).to all(eq(true))
         end
+
+        include_examples "shadowed subvolumes"
       end
     end
 
@@ -86,6 +142,8 @@
           expect(lvs.size).to eq 2
           expect(partitions.size).to eq 2
         end
+
+        include_examples "shadowed subvolumes"
       end
 
       context "and ProposalSettings#separate_vgs is set to false" do
@@ -99,6 +157,8 @@
           is_partition = mounted_devices.map { |i| i.is?(:partition) }
           expect(is_partition).to all(eq(true))
         end
+
+        include_examples "shadowed subvolumes"
       end
     end
   end


Reply via email to