Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-storage-ng for 
openSUSE:Factory checked in at 2024-04-26 23:26:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-storage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-storage-ng.new.1880 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-storage-ng"

Fri Apr 26 23:26:32 2024 rev:158 rq:1170162 version:5.0.13

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-storage-ng/yast2-storage-ng.changes        
2024-04-18 22:10:16.536342602 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-storage-ng.new.1880/yast2-storage-ng.changes  
    2024-04-26 23:26:38.479567657 +0200
@@ -1,0 +2,9 @@
+Wed Apr 24 07:48:08 UTC 2024 - Ancor Gonzalez Sosa <an...@suse.com>
+
+- GuidedProposal: refine the :bigger_resize SpaceMaker strategy
+  (gh#openSUSE/agama#1164).
+- Fixed a bug related to the calculation of partitions required
+  for booting when RAID is involved.
+- 5.0.13
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-storage-ng.spec ++++++
--- /var/tmp/diff_new_pack.SHPLdX/_old  2024-04-26 23:26:39.159592478 +0200
+++ /var/tmp/diff_new_pack.SHPLdX/_new  2024-04-26 23:26:39.159592478 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-storage-ng
-Version:        5.0.12
+Version:        5.0.13
 Release:        0
 Summary:        YaST2 - Storage Configuration
 License:        GPL-2.0-only OR GPL-3.0-only

++++++ yast2-storage-ng-5.0.12.tar.bz2 -> yast2-storage-ng-5.0.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.12/package/yast2-storage-ng.changes 
new/yast2-storage-ng-5.0.13/package/yast2-storage-ng.changes
--- old/yast2-storage-ng-5.0.12/package/yast2-storage-ng.changes        
2024-04-18 14:02:13.000000000 +0200
+++ new/yast2-storage-ng-5.0.13/package/yast2-storage-ng.changes        
2024-04-25 16:28:38.000000000 +0200
@@ -1,4 +1,13 @@
 -------------------------------------------------------------------
+Wed Apr 24 07:48:08 UTC 2024 - Ancor Gonzalez Sosa <an...@suse.com>
+
+- GuidedProposal: refine the :bigger_resize SpaceMaker strategy
+  (gh#openSUSE/agama#1164).
+- Fixed a bug related to the calculation of partitions required
+  for booting when RAID is involved.
+- 5.0.13
+
+-------------------------------------------------------------------
 Wed Apr 17 15:56:25 UTC 2024 - Ladislav Slezák <lsle...@suse.com>
 
 - Optionally add the encryption status in the device description
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.12/package/yast2-storage-ng.spec 
new/yast2-storage-ng-5.0.13/package/yast2-storage-ng.spec
--- old/yast2-storage-ng-5.0.12/package/yast2-storage-ng.spec   2024-04-18 
14:02:13.000000000 +0200
+++ new/yast2-storage-ng-5.0.13/package/yast2-storage-ng.spec   2024-04-25 
16:28:38.000000000 +0200
@@ -16,7 +16,7 @@
 #
 
 Name:           yast2-storage-ng
-Version:        5.0.12
+Version:        5.0.13
 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-5.0.12/src/lib/y2storage/boot_requirements_strategies/analyzer.rb
 
new/yast2-storage-ng-5.0.13/src/lib/y2storage/boot_requirements_strategies/analyzer.rb
--- 
old/yast2-storage-ng-5.0.12/src/lib/y2storage/boot_requirements_strategies/analyzer.rb
      2024-04-18 14:02:13.000000000 +0200
+++ 
new/yast2-storage-ng-5.0.13/src/lib/y2storage/boot_requirements_strategies/analyzer.rb
      2024-04-25 16:28:38.000000000 +0200
@@ -85,6 +85,8 @@
         return @boot_disk if @boot_disk
 
         @boot_disk = devicegraph.find_by_name(boot_disk_name) if boot_disk_name
+        # If the disk was explicitly chosen via boot_disk_name, we are all set
+        return @boot_disk if @boot_disk
 
         @boot_disk ||= boot_disk_from_planned_dev
         @boot_disk ||= boot_disk_from_devicegraph
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.12/src/lib/y2storage/proposal/space_maker_actions/bigger_resize_strategy.rb
 
new/yast2-storage-ng-5.0.13/src/lib/y2storage/proposal/space_maker_actions/bigger_resize_strategy.rb
--- 
old/yast2-storage-ng-5.0.12/src/lib/y2storage/proposal/space_maker_actions/bigger_resize_strategy.rb
        2024-04-18 14:02:13.000000000 +0200
+++ 
new/yast2-storage-ng-5.0.13/src/lib/y2storage/proposal/space_maker_actions/bigger_resize_strategy.rb
        2024-04-25 16:28:38.000000000 +0200
@@ -34,18 +34,21 @@
           @settings = settings
           @to_delete_mandatory = []
           @to_delete_optional = []
+          @to_wipe = []
           @to_resize = []
         end
 
         # @param disk [Disk] see {List}
         def add_mandatory_actions(disk)
-          devices = disk.partition_table? ? partitions(disk) : [disk]
-          devices.select! { |d| configured?(d, :force_delete) }
+          return unless disk.partition_table?
+
+          devices = partitions(disk).select { |p| configured?(p, 
:force_delete) }
           to_delete_mandatory.concat(devices)
         end
 
         # @param disk [Disk] see {List}
         def add_optional_actions(disk, _lvm_helper)
+          add_wipe(disk)
           add_resize(disk)
           add_optional_delete(disk)
         end
@@ -57,8 +60,9 @@
           return unless dev
 
           return Shrink.new(dev) if source == :to_resize
+          return Wipe.new(dev) if source == :to_wipe
 
-          dev.is?(:partition) ? Delete.new(dev, related_partitions: false) : 
Wipe.new(dev)
+          Delete.new(dev, related_partitions: false)
         end
 
         # @param deleted_sids [Array<Integer>] see {List}
@@ -74,15 +78,26 @@
         # @return [ProposalSpaceSettings] proposal settings for making space
         attr_reader :settings
 
-        # @return [Array<BlkDevice>] list of devices to be deleted or emptied 
(mandatory)
+        # @return [Array<BlkDevice>] list of devices to be deleted (mandatory)
         attr_reader :to_delete_mandatory
 
-        # @return [Array<BlkDevice>] list of devices to be deleted or emptied 
(optionally)
+        # @return [Array<BlkDevice>] list of devices to be deleted (optionally)
         attr_reader :to_delete_optional
 
         # @return [Array<Partition>] list of partitions to be shrunk
         attr_reader :to_resize
 
+        # @return [Array<BlkDevice>] list of disks to be emptied if needed
+        attr_reader :to_wipe
+
+        # @see #add_optional_actions
+        # @param disk [Disk]
+        def add_wipe(disk)
+          return if disk.partition_table?
+
+          to_wipe << disk
+        end
+
         # @see #add_optional_actions
         # @param disk [Disk]
         def add_resize(disk)
@@ -110,12 +125,10 @@
         #
         # @param disk [Disk]
         def add_optional_delete(disk)
-          if disk.partition_table?
-            partitions = partitions(disk).select { |p| configured?(p, :delete) 
}
-            to_delete_optional.concat(partitions.sort { |a, b| 
preferred_delete(a, b) })
-          elsif configured?(disk, :delete)
-            to_delete_optional << disk
-          end
+          return unless disk.partition_table?
+
+          partitions = partitions(disk).select { |p| configured?(p, :delete) }
+          to_delete_optional.concat(partitions.sort { |a, b| 
preferred_delete(a, b) })
         end
 
         # Compares two partitions to decide which one should be deleted first
@@ -152,6 +165,8 @@
         def source_for_next
           if to_delete_mandatory.any?
             :to_delete_mandatory
+          elsif to_wipe.any?
+            :to_wipe
           elsif to_resize.any?
             :to_resize
           else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.12/src/lib/y2storage/proposal_space_settings.rb 
new/yast2-storage-ng-5.0.13/src/lib/y2storage/proposal_space_settings.rb
--- old/yast2-storage-ng-5.0.12/src/lib/y2storage/proposal_space_settings.rb    
2024-04-18 14:02:13.000000000 +0200
+++ new/yast2-storage-ng-5.0.13/src/lib/y2storage/proposal_space_settings.rb    
2024-04-25 16:28:38.000000000 +0200
@@ -82,13 +82,12 @@
     # @return [Boolean]
     attr_accessor :delete_resize_configurable
 
-    # What to do with existing partitions and disks if they are involved in 
the process of making
-    # space.
+    # What to do with existing partitions if they are involved in the process 
of making space.
     #
     # Keys are device names (like in BlkDevice#name, no alternative names) 
that correspond to a
-    # partition or to a disk with no partitions.
+    # partition.
     #
-    # The value for each key specifies what to do with the corresponding 
device if the storage
+    # The value for each key specifies what to do with the corresponding 
partition if the storage
     # proposal needs to process the corresponding disk. If the device is not 
explicitly mentioned,
     # nothing will be done. Possible values are :resize, :delete and 
:force_delete.
     #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.12/test/y2storage/proposal/space_maker_bigger_resize_test.rb
 
new/yast2-storage-ng-5.0.13/test/y2storage/proposal/space_maker_bigger_resize_test.rb
--- 
old/yast2-storage-ng-5.0.12/test/y2storage/proposal/space_maker_bigger_resize_test.rb
       2024-04-18 14:02:13.000000000 +0200
+++ 
new/yast2-storage-ng-5.0.13/test/y2storage/proposal/space_maker_bigger_resize_test.rb
       2024-04-25 16:28:38.000000000 +0200
@@ -56,6 +56,7 @@
       end
     end
 
+    # :force_delete for disks should be ignored, actions only make sense for 
partitions and LVs
     context "if :force_delete is specified for a disk that contains 
partitions" do
       let(:settings_actions) { { "/dev/sda" => :force_delete } }
 
@@ -79,6 +80,7 @@
       end
     end
 
+    # :force_delete for disks should be ignored, actions only make sense for 
partitions and LVs
     context "if :force_delete is specified for a directly formatted disk (no 
partition table)" do
       let(:scenario) { "multipath-formatted.xml" }
 
@@ -88,13 +90,15 @@
         settings.root_device = "/dev/mapper/0QEMU_QEMU_HARDDISK_mpath1"
       end
 
-      it "empties the device deleting the filesystem" do
-        expect(fake_devicegraph.filesystems.size).to eq 1
+      it "does not modify the content of the disk" do
+        original_filesystems = fake_devicegraph.filesystems
+        expect(original_filesystems.size).to eq 1
 
         result = maker.prepare_devicegraph(fake_devicegraph)
-        disk = result.disk_devices.first
-        expect(disk.has_children?).to eq false
-        expect(result.filesystems).to be_empty
+        filesystems = result.filesystems
+        expect(filesystems.size).to eq 1
+        device = filesystems.first.blk_devices.first
+        expect(device.name).to eq "/dev/mapper/0QEMU_QEMU_HARDDISK_mpath1"
       end
     end
 
@@ -185,36 +189,23 @@
       let(:scenario) { "lvm-disk-as-pv.xml" }
       let(:vol1) { planned_vol(mount_point: "/1", type: :ext4, min: 5.GiB) }
 
-      context "and the disk is not mentioned in the settings" do
-        let(:settings_actions) { { "/dev/sda1" => :delete } }
+      it "empties the disk deleting the LVM VG" do
+        expect(fake_devicegraph.lvm_vgs.size).to eq 1
+
+        result = maker.provide_space(fake_devicegraph, volumes, lvm_helper)
+        disk = result[:devicegraph].disks.first
+        expect(disk.has_children?).to eq false
+        expect(result[:devicegraph].lvm_vgs).to be_empty
+      end
+
+      it "assumes a (future) GPT partition table" do
+        gpt_size = 1.MiB
+        # The final 16.5 KiB are reserved by GPT
+        gpt_final_space = 16.5.KiB
 
-        it "raises an Error exception" do
-          expect { maker.provide_space(fake_devicegraph, volumes, lvm_helper) }
-            .to raise_error Y2Storage::Error
-        end
-      end
-
-      context "and the disk is marked to be deleted" do
-        let(:settings_actions) { { "/dev/sda" => :delete } }
-
-        it "empties the disk deleting the LVM VG" do
-          expect(fake_devicegraph.lvm_vgs.size).to eq 1
-
-          result = maker.provide_space(fake_devicegraph, volumes, lvm_helper)
-          disk = result[:devicegraph].disks.first
-          expect(disk.has_children?).to eq false
-          expect(result[:devicegraph].lvm_vgs).to be_empty
-        end
-
-        it "assumes a (future) GPT partition table" do
-          gpt_size = 1.MiB
-          # The final 16.5 KiB are reserved by GPT
-          gpt_final_space = 16.5.KiB
-
-          result = maker.provide_space(fake_devicegraph, volumes, lvm_helper)
-          space = result[:partitions_distribution].spaces.first
-          expect(space.disk_size).to eq(space.disk.size - gpt_size - 
gpt_final_space)
-        end
+        result = maker.provide_space(fake_devicegraph, volumes, lvm_helper)
+        space = result[:partitions_distribution].spaces.first
+        expect(space.disk_size).to eq(space.disk.size - gpt_size - 
gpt_final_space)
       end
     end
 
@@ -227,36 +218,23 @@
         settings.root_device = "/dev/mapper/0QEMU_QEMU_HARDDISK_mpath1"
       end
 
-      context "and the device is not mentioned in the settings" do
-        let(:settings_actions) { {} }
+      it "empties the device deleting the filesystem" do
+        expect(fake_devicegraph.filesystems.size).to eq 1
+
+        result = maker.provide_space(fake_devicegraph, volumes, lvm_helper)
+        disk = result[:devicegraph].disk_devices.first
+        expect(disk.has_children?).to eq false
+        expect(result[:devicegraph].filesystems).to be_empty
+      end
+
+      it "assumes a (future) GPT partition table" do
+        gpt_size = 1.MiB
+        # The final 16.5 KiB are reserved by GPT
+        gpt_final_space = 16.5.KiB
 
-        it "raises an Error exception" do
-          expect { maker.provide_space(fake_devicegraph, volumes, lvm_helper) }
-            .to raise_error Y2Storage::Error
-        end
-      end
-
-      context "and the disk is marked to be deleted" do
-        let(:settings_actions) { { "/dev/mapper/0QEMU_QEMU_HARDDISK_mpath1" => 
:delete } }
-
-        it "empties the device deleting the filesystem" do
-          expect(fake_devicegraph.filesystems.size).to eq 1
-
-          result = maker.provide_space(fake_devicegraph, volumes, lvm_helper)
-          disk = result[:devicegraph].disk_devices.first
-          expect(disk.has_children?).to eq false
-          expect(result[:devicegraph].filesystems).to be_empty
-        end
-
-        it "assumes a (future) GPT partition table" do
-          gpt_size = 1.MiB
-          # The final 16.5 KiB are reserved by GPT
-          gpt_final_space = 16.5.KiB
-
-          result = maker.provide_space(fake_devicegraph, volumes, lvm_helper)
-          space = result[:partitions_distribution].spaces.first
-          expect(space.disk_size).to eq(space.disk.size - gpt_size - 
gpt_final_space)
-        end
+        result = maker.provide_space(fake_devicegraph, volumes, lvm_helper)
+        space = result[:partitions_distribution].spaces.first
+        expect(space.disk_size).to eq(space.disk.size - gpt_size - 
gpt_final_space)
       end
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.12/test/y2storage/proposal_agama_advanced_test.rb 
new/yast2-storage-ng-5.0.13/test/y2storage/proposal_agama_advanced_test.rb
--- old/yast2-storage-ng-5.0.12/test/y2storage/proposal_agama_advanced_test.rb  
2024-04-18 14:02:13.000000000 +0200
+++ new/yast2-storage-ng-5.0.13/test/y2storage/proposal_agama_advanced_test.rb  
2024-04-25 16:28:38.000000000 +0200
@@ -52,6 +52,7 @@
       fake_devicegraph.mount_points.each { |i| 
i.parents.first.remove_mount_point }
 
       settings.space_settings.strategy = :bigger_resize
+      settings.lvm_vg_reuse = false
       # Agama uses homogeneous weights for all volumes
       settings.volumes.each { |v| v.weight = 100 }
       # Activate support for separate LVM VGs
@@ -80,5 +81,98 @@
         expect { proposal.propose }.to_not raise_error
       end
     end
+
+    context "with one disk containing partitions and another directly 
formatted" do
+      let(:scenario) { "gpt_msdos_and_empty" }
+
+      let(:lvm) { true }
+
+      before do
+        settings.candidate_devices = ["/dev/sdc", "/dev/sdf"]
+        settings.root_device = "/dev/sdc"
+      end
+
+      let(:volumes) { [{ "mount_point" => "/", "fs_type" => "xfs", "min_size" 
=> size }] }
+
+      context "if there is no need to use the formatted disk (everything fits 
in the other)" do
+        let(:size) { "200 GiB" }
+
+        it "does not modify the formatted disk" do
+          proposal.propose
+          disk = proposal.devices.find_by_name("/dev/sdf")
+          expect(disk.filesystem.type.is?(:xfs)).to eq true
+          expect(disk.partitions).to be_empty
+        end
+      end
+
+      context "if the formatted disk needs to be used" do
+        let(:size) { "970 GiB" }
+
+        it "empties the disk deleting the filesystem" do
+          proposal.propose
+          disk = proposal.devices.find_by_name("/dev/sdf")
+          expect(disk.filesystem).to be_nil
+          expect(disk.partitions).to_not be_empty
+        end
+      end
+
+      context "if non-mandatory actions are possible to make space" do
+        let(:size) { "100 GiB" }
+
+        before do
+          settings.candidate_devices = ["/dev/sda", "/dev/sdf"]
+          settings.root_device = "/dev/sda"
+        end
+
+        it "tries to use the formatted disk before trying an optional delete" 
do
+          sda1_sid = fake_devicegraph.find_by_name("/dev/sda1").sid
+
+          settings.space_settings.actions = { "/dev/sda1" => :delete }
+          proposal.propose
+          expect(proposal.failed?).to eq false
+
+          disk = proposal.devices.find_by_name("/dev/sdf")
+          expect(disk.filesystem).to be_nil
+          expect(disk.partitions).to_not be_empty
+
+          expect(proposal.devices.find_by_name("/dev/sda1").sid).to eq sda1_sid
+        end
+
+        it "tries to use the formatted disk before trying an optional resize" 
do
+          orig_sda1 = fake_devicegraph.find_by_name("/dev/sda1")
+
+          settings.space_settings.actions = { "/dev/sda1" => :resize }
+          proposal.propose
+          expect(proposal.failed?).to eq false
+
+          disk = proposal.devices.find_by_name("/dev/sdf")
+          expect(disk.filesystem).to be_nil
+          expect(disk.partitions).to_not be_empty
+
+          sda1 = proposal.devices.find_by_name("/dev/sda1")
+          expect(sda1.sid).to eq orig_sda1.sid
+          expect(sda1.size).to eq orig_sda1.size
+        end
+      end
+    end
+
+    context "when installing on a disk that previously contained a RAID1" do
+      let(:scenario) { "windows-pc-raid1.xml" }
+
+      before do
+        settings.candidate_devices = ["/dev/sda"]
+        settings.root_device = "/dev/sda"
+        # Let's ensure a bios_boot partition is needed
+        allow(storage_arch).to receive(:efiboot?).and_return(false)
+      end
+
+      # In the past, the pre-existing RAID1 was considered to be the booting 
disk due to some
+      # false asumptions made by the BootRequirementsChecker.
+      it "creates the partitions needed for booting in the correct disk" do
+        proposal.propose
+        disk = proposal.devices.find_by_name("/dev/sda")
+        expect(disk.partitions.map(&:id)).to include 
Y2Storage::PartitionId::BIOS_BOOT
+      end
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.12/test/y2storage/proposal_agama_reuse_test.rb 
new/yast2-storage-ng-5.0.13/test/y2storage/proposal_agama_reuse_test.rb
--- old/yast2-storage-ng-5.0.12/test/y2storage/proposal_agama_reuse_test.rb     
2024-04-18 14:02:13.000000000 +0200
+++ new/yast2-storage-ng-5.0.13/test/y2storage/proposal_agama_reuse_test.rb     
2024-04-25 16:28:38.000000000 +0200
@@ -221,22 +221,12 @@
         settings.root_device = "/dev/sdc"
       end
 
-      # FIXME: this should change when we implement 
https://trello.com/c/88lh9u52/
-      context "if there is no space action to delete the content of the disk" 
do
-        it "fails to make a proposal" do
-          proposal.propose
-          expect(proposal.failed?).to eq true
-        end
-      end
-
-      context "if there is a space action to delete the content of the disk" do
-        let(:space_actions) { { "/dev/sdc" => :delete } }
-
-        it "makes the expected proposal" do
-          expect(proposal.propose).to eq true
-          disk = proposal.devices.find_by_name(settings.root_device)
-          expect(disk.partitions.size).to eq 4
-        end
+      # In the past, a delete action on the disk was requested. We later 
decided that actions
+      # only make sense for partitions and LVs
+      it "makes the expected proposal" do
+        expect(proposal.propose).to eq true
+        disk = proposal.devices.find_by_name(settings.root_device)
+        expect(disk.partitions.size).to eq 4
       end
     end
 
@@ -249,7 +239,7 @@
           srv.reuse_name = "/dev/sdc"
         end
 
-        # No space action needed for sdc
+        # No space action needed for sdc, see above
         it "formats the disk and assigns the mount point" do
           proposal.propose
           filesystem = proposal.devices.filesystems.find { |i| i.mount_path == 
"/srv" }
@@ -264,29 +254,19 @@
           srv.reuse_name = "/dev/sdb"
         end
 
-        context "and there are no space actions to delete all the partitions" 
do
-          # sdb2 is not deleted
-          let(:space_actions) { { "/dev/sdb1" => :delete } }
-
-          # FIXME: this should change when we implement 
https://trello.com/c/88lh9u52/
-          # the proposal should fail if deleting sdb2 is not allowed
-          it "formats the disk and assigns the mount point" do
-            proposal.propose
-            filesystem = proposal.devices.filesystems.find { |i| i.mount_path 
== "/srv" }
-            expect(filesystem.blk_devices.first.name).to eq "/dev/sdb"
-            expect(filesystem.type.is?(:xfs)).to eq true
-          end
-        end
-
-        context "and there are space actions to delete all the partitions" do
-          let(:space_actions) { { "/dev/sdb1" => :delete, "/dev/sdb2" => 
:delete } }
-
-          it "formats the disk and assigns the mount point" do
-            proposal.propose
-            filesystem = proposal.devices.filesystems.find { |i| i.mount_path 
== "/srv" }
-            expect(filesystem.blk_devices.first.name).to eq "/dev/sdb"
-            expect(filesystem.type.is?(:xfs)).to eq true
-          end
+        # In the past, delete actions were requested for the partitions. We 
later decided
+        # they were not necessary for disks being explicitly reused for a 
volume.
+        it "deletes the disk partitions even if there are no space actions 
about them" do
+          proposal.propose
+          disk = proposal.devices.find_by_name("/dev/sdb")
+          expect(disk.partitions).to be_empty
+        end
+
+        it "formats the disk and assigns the mount point" do
+          proposal.propose
+          filesystem = proposal.devices.filesystems.find { |i| i.mount_path == 
"/srv" }
+          expect(filesystem.blk_devices.first.name).to eq "/dev/sdb"
+          expect(filesystem.type.is?(:xfs)).to eq true
         end
       end
     end
@@ -360,10 +340,7 @@
           expect(partition).to_not be_nil
         end
 
-        # FIXME: we need to clarify what the expectations regarding the 
partitions of the RAID
-        # Do we need delete actions for them? So far, the only devices for 
which we consider the
-        # partitions in the space policy are the disk_devices. What do we do 
regarding MDs or
-        # bcaches. To be clarified as part of https://trello.com/c/88lh9u52/
+        # Delete actions are not necessary since the MD is being explicitly 
reused by a volume.
         it "deletes the MD partitions even if there are no space actions about 
them" do
           proposal.propose
           partition = proposal.devices.find_by_name("/dev/md0p1")
@@ -375,31 +352,6 @@
           filesystem = proposal.devices.filesystems.find { |i| i.mount_path == 
"/srv" }
           expect(filesystem.blk_devices.first.sid).to eq original_md0.sid
         end
-
-        context "and there are no space actions to delete all the partitions" 
do
-          # sdb2 is not deleted
-          let(:space_actions) { { "/dev/sdb1" => :delete } }
-
-          # FIXME: this should change when we implement 
https://trello.com/c/88lh9u52/
-          # the proposal should fail if deleting sdb2 is not allowed
-          it "formats the RAID and assigns the mount point" do
-            proposal.propose
-            filesystem = proposal.devices.filesystems.find { |i| i.mount_path 
== "/srv" }
-            expect(filesystem.blk_devices.first.name).to eq "/dev/md0"
-            expect(filesystem.type.is?(:xfs)).to eq true
-          end
-        end
-
-        context "and there are space actions to delete all the partitions" do
-          let(:space_actions) { { "/dev/sdb1" => :delete, "/dev/sdb2" => 
:delete } }
-
-          it "formats the RAID and assigns the mount point" do
-            proposal.propose
-            filesystem = proposal.devices.filesystems.find { |i| i.mount_path 
== "/srv" }
-            expect(filesystem.blk_devices.first.name).to eq "/dev/md0"
-            expect(filesystem.type.is?(:xfs)).to eq true
-          end
-        end
       end
     end
 

Reply via email to