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 2021-10-23 00:50:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-storage-ng (Old) and /work/SRC/openSUSE:Factory/.yast2-storage-ng.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-storage-ng" Sat Oct 23 00:50:30 2021 rev:107 rq:926870 version:4.4.11 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-storage-ng/yast2-storage-ng.changes 2021-10-04 18:39:42.862033099 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-storage-ng.new.1890/yast2-storage-ng.changes 2021-10-23 00:50:50.289127717 +0200 @@ -1,0 +2,23 @@ +Thu Oct 21 11:50:04 UTC 2021 - Ancor Gonzalez Sosa <an...@suse.com> + +- Install by default to any available Dell BOSS drive and identify + such drives more clearly in the Guided Setup (jsc#SLE-17578). +- Try to avoid by default to install into SD Cards if a fixed disk + is available (bsc#1187438). +- 4.4.11 + +------------------------------------------------------------------- +Tue Oct 19 11:22:52 UTC 2021 - Ancor Gonzalez Sosa <an...@suse.com> + +- Do not force the same mount_by method in fstab and in crypttab + (needed for jsc#SLE-20416 and bsc#1181196) +- 4.4.10 + +------------------------------------------------------------------- +Thu Oct 14 14:19:03 UTC 2021 - David Diaz <dgonza...@suse.com> + +- Fix (un)masking systemd units by using the systemctl --plain + flag for getting an output without status glyphs (bsc#1191347). +- 4.4.9 + +------------------------------------------------------------------- Old: ---- yast2-storage-ng-4.4.8.tar.bz2 New: ---- yast2-storage-ng-4.4.11.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-storage-ng.spec ++++++ --- /var/tmp/diff_new_pack.DHN6tS/_old 2021-10-23 00:50:50.757127823 +0200 +++ /var/tmp/diff_new_pack.DHN6tS/_new 2021-10-23 00:50:50.757127823 +0200 @@ -17,7 +17,7 @@ Name: yast2-storage-ng -Version: 4.4.8 +Version: 4.4.11 Release: 0 Summary: YaST2 - Storage Configuration License: GPL-2.0-only OR GPL-3.0-only ++++++ yast2-storage-ng-4.4.8.tar.bz2 -> yast2-storage-ng-4.4.11.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/package/yast2-storage-ng.changes new/yast2-storage-ng-4.4.11/package/yast2-storage-ng.changes --- old/yast2-storage-ng-4.4.8/package/yast2-storage-ng.changes 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/package/yast2-storage-ng.changes 2021-10-21 15:39:13.000000000 +0200 @@ -1,4 +1,27 @@ ------------------------------------------------------------------- +Thu Oct 21 11:50:04 UTC 2021 - Ancor Gonzalez Sosa <an...@suse.com> + +- Install by default to any available Dell BOSS drive and identify + such drives more clearly in the Guided Setup (jsc#SLE-17578). +- Try to avoid by default to install into SD Cards if a fixed disk + is available (bsc#1187438). +- 4.4.11 + +------------------------------------------------------------------- +Tue Oct 19 11:22:52 UTC 2021 - Ancor Gonzalez Sosa <an...@suse.com> + +- Do not force the same mount_by method in fstab and in crypttab + (needed for jsc#SLE-20416 and bsc#1181196) +- 4.4.10 + +------------------------------------------------------------------- +Thu Oct 14 14:19:03 UTC 2021 - David Diaz <dgonza...@suse.com> + +- Fix (un)masking systemd units by using the systemctl --plain + flag for getting an output without status glyphs (bsc#1191347). +- 4.4.9 + +------------------------------------------------------------------- Thu Sep 30 11:21:19 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com> - Recommend to install libyui-qt-graph package (bsc#1191109) in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/package/yast2-storage-ng.spec new/yast2-storage-ng-4.4.11/package/yast2-storage-ng.spec --- old/yast2-storage-ng-4.4.8/package/yast2-storage-ng.spec 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/package/yast2-storage-ng.spec 2021-10-21 15:39:13.000000000 +0200 @@ -16,7 +16,7 @@ # Name: yast2-storage-ng -Version: 4.4.8 +Version: 4.4.11 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.4.8/src/bin/mask-systemd-units new/yast2-storage-ng-4.4.11/src/bin/mask-systemd-units --- old/yast2-storage-ng-4.4.8/src/bin/mask-systemd-units 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/src/bin/mask-systemd-units 2021-10-21 15:39:13.000000000 +0200 @@ -32,7 +32,7 @@ query_units() { - /usr/bin/systemctl list-units --full --all --type mount,swap --no-legend | while read -r unit dummy ; do + /usr/bin/systemctl list-units --full --all --type mount,swap --no-legend --plain | while read -r unit dummy ; do # skip root and sysroot if [[ $unit == -.mount || $unit == sysroot.mount ]] ; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/src/lib/y2storage/blk_device.rb new/yast2-storage-ng-4.4.11/src/lib/y2storage/blk_device.rb --- old/yast2-storage-ng-4.4.8/src/lib/y2storage/blk_device.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/src/lib/y2storage/blk_device.rb 2021-10-21 15:39:13.000000000 +0200 @@ -580,17 +580,13 @@ # Type of the filesystem, if any # @return [Filesystems::Type, nil] def filesystem_type - return nil unless blk_filesystem - - blk_filesystem.type + blk_filesystem&.type end # Mount point of the filesystem, if any # @return [String, nil] def filesystem_mountpoint - return nil unless blk_filesystem - - blk_filesystem.mount_path + blk_filesystem&.mount_path end # Non encrypted version of this device @@ -668,9 +664,20 @@ # # @return [Array<String>] empty if the driver is unknown def driver - return [] if hwinfo.nil? + hwinfo&.driver || [] + end - hwinfo.driver || [] + # @see #boss? + BOSS_REGEXP = Regexp.new("dellboss", Regexp::IGNORECASE).freeze + private_constant :BOSS_REGEXP + + # Whether this device is a Dell BOSS (Boot Optimized Storage Solution) + # + # See https://jira.suse.com/browse/SLE-17578 + # + # @return [Boolean] + def boss? + !!model&.match?(BOSS_REGEXP) end # Size of the space that could be theoretically reclaimed by shrinking the @@ -703,11 +710,9 @@ # # @return [Boolean] true if this is a network-based disk or depends on one def in_network? - if root_blk_device? - false - else - root_blk_devices.any?(&:in_network?) - end + return false if root_blk_device? + + root_blk_devices.any?(&:in_network?) end # Whether the block device must be considered remote regarding how and when diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/src/lib/y2storage/dialogs/guided_setup/helpers/disk.rb new/yast2-storage-ng-4.4.11/src/lib/y2storage/dialogs/guided_setup/helpers/disk.rb --- old/yast2-storage-ng-4.4.8/src/lib/y2storage/dialogs/guided_setup/helpers/disk.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/src/lib/y2storage/dialogs/guided_setup/helpers/disk.rb 2021-10-21 15:39:13.000000000 +0200 @@ -66,10 +66,25 @@ # @param disk [BlkDevice] # @return [Array<String>] def type_labels(disk) - return [] unless disk.respond_to?(:transport) + [boss_label(disk), sd_label(disk), transport_label(disk)].reject(&:empty?) + end + + def boss_label(disk) + return "" unless disk.boss? + + _("Dell BOSS") + end + + def sd_label(disk) + return "" unless disk.is?(:sd_card) + + _("SD Card") + end + + def transport_label(disk) + return "" unless disk.respond_to?(:transport) - trans = transport_label(disk.transport) - trans.empty? ? [] : [trans] + label_for_transport(disk.transport) end # Label for the given transport to be displayed in the dialogs @@ -78,7 +93,7 @@ # # @param transport [DataTransport] # @return [String] empty string if the transport is not worth mentioning - def transport_label(transport) + def label_for_transport(transport) if transport.is?(:usb) _("USB") elsif transport.is?(:sbp) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/src/lib/y2storage/dialogs/guided_setup/select_disks.rb new/yast2-storage-ng-4.4.11/src/lib/y2storage/dialogs/guided_setup/select_disks.rb --- old/yast2-storage-ng-4.4.8/src/lib/y2storage/dialogs/guided_setup/select_disks.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/src/lib/y2storage/dialogs/guided_setup/select_disks.rb 2021-10-21 15:39:13.000000000 +0200 @@ -118,7 +118,8 @@ end def all_disks - analyzer.candidate_disks + # Let's place the boot-optimized disks at the top of the list + @all_disks ||= analyzer.candidate_disks.partition(&:boss?).flatten end # Widget used to display and select the list of disks diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/src/lib/y2storage/dialogs/proposal.rb new/yast2-storage-ng-4.4.11/src/lib/y2storage/dialogs/proposal.rb --- old/yast2-storage-ng-4.4.8/src/lib/y2storage/dialogs/proposal.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/src/lib/y2storage/dialogs/proposal.rb 2021-10-21 15:39:13.000000000 +0200 @@ -135,8 +135,27 @@ # # @return [String] HTML-formatted text def actions_html - # Reuse the exact string "Changes to partitioning" from the partitioner - actions_source_html + _("<p>Changes to partitioning:</p>") + @actions_presenter.to_html + actions_source_html + + boss_html + + # Reuse the exact string "Changes to partitioning" from the partitioner + _("<p>Changes to partitioning:</p>") + + @actions_presenter.to_html + end + + def boss_html + return "" if boss_devices.empty? + + n_( + # TRANSLATORS: %s is a linux device name (eg. /dev/sda) + "<p>The device %s is a Dell BOSS drive.</p>", + # TRANSLATORS: %s is a list of comma-separated device names (eg. "/dev/sda, /dev/sdb") + "<p>The following devices are Dell BOSS drives: %s.</p>", + boss_devices.size + ) % boss_devices.map(&:name).join(", ") + end + + def boss_devices + @boss_devices ||= devicegraph.blk_devices.select(&:boss?) end # @see #actions_html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/src/lib/y2storage/disk.rb new/yast2-storage-ng-4.4.11/src/lib/y2storage/disk.rb --- old/yast2-storage-ng-4.4.8/src/lib/y2storage/disk.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/src/lib/y2storage/disk.rb 2021-10-21 15:39:13.000000000 +0200 @@ -69,6 +69,13 @@ transport.to_sym == :usb end + # Checks if it's a IEEE 1394 disk + # + # @return [Boolean] + def firewire? + transport.to_sym == :sbp + end + # Checks if it's in network # # @return [Boolean] @@ -106,8 +113,16 @@ protected + # @see #types_for_is + SD_CARD_DRIVER = "mmcblk".freeze + private_constant :SD_CARD_DRIVER + def types_for_is - super << :disk + types = super + types << :disk + # Check whether this is a MMC (MultiMedia Card) or a SD (Secure Digital) card + types << :sd_card if driver&.include?(SD_CARD_DRIVER) + types end # Whether this device can be in general treated like a disk for YaST diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/src/lib/y2storage/encryption.rb new/yast2-storage-ng-4.4.11/src/lib/y2storage/encryption.rb --- old/yast2-storage-ng-4.4.8/src/lib/y2storage/encryption.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/src/lib/y2storage/encryption.rb 2021-10-21 15:39:13.000000000 +0200 @@ -98,6 +98,10 @@ storage_forward :storage_in_etc_crypttab=, to: :in_etc_crypttab= private :storage_in_etc_crypttab= + # @!method set_default_mount_by + # Set the mount-by method to the global default, see Storage::get_default_mount_by() + storage_forward :set_default_mount_by, to: :default_mount_by= + # @see BlkDevice#plain_device def plain_device blk_device @@ -365,6 +369,30 @@ end end + # Sets {#mount_by} to a value that makes sense + # + # Generally, that means simply ensuring a suitable mount_by value. But it also may imply + # correcting the surprising value set by libstorage-ng when probing an already existing + # encryption device. + # + # During probing, libstorage-ng sets Encryption#mount_by for all the found encryption devices. + # If the device is listed in /etc/crypttab, libstorage-ng sets the mount_by value based on the + # value on that file. If that's not the case, libstorage-ng sets Encryption#mount_by to a + # hardcoded value of DEVICE, completely ignoring the default mount_by value that is configured + # for the system. That leads to problems like the one described in bsc#1165702. + # See https://github.com/yast/yast-storage-ng/pull/1095 for more details. + # + # For devices affected by that problem, this method first tries to re-initialize mount_by to + # a value aligned with the storage-ng configuration and, thus, with user expectations. + def adjust_mount_by + # It may be more correct to do this only once (since it's fixing a wrong initialization). + # But since there is no way in the UI or AutoYaST to explicitly modify (even to display) the + # value of Encryption#mount_by, it's safe (even maybe expected) to re-evaluate it. + set_default_mount_by if probed_without_crypttab? + + ensure_suitable_mount_by + end + # @see Device#update_etc_attributes def assign_etc_attribute(value) self.storage_in_etc_crypttab = value @@ -440,6 +468,19 @@ mount_point.path.gsub(/^\/|\/$/, "").gsub("/", "_") end + # Checks whether the initial value of mount_by was forced to DEVICE by libstorage-ng due to lack + # of information or whether is the result of a proper initialization during normal operation + # + # @see #adjust_mount_by + # + # @return [Boolean] + def probed_without_crypttab? + return false unless exists_in_probed? + return !in_etc_crypttab? if in_etc_initial.nil? + + !in_etc_initial + end + class << self # Updates the DeviceMapper name for all encryption devices in the device # that have a name automatically set by YaST. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/src/lib/y2storage/guided_proposal.rb new/yast2-storage-ng-4.4.11/src/lib/y2storage/guided_proposal.rb --- old/yast2-storage-ng-4.4.8/src/lib/y2storage/guided_proposal.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/src/lib/y2storage/guided_proposal.rb 2021-10-21 15:39:13.000000000 +0200 @@ -285,16 +285,19 @@ # Candidate devices to use when the current settings do not specify any, i.e. in the initial # attempt, before the user has had any opportunity to select the candidate devices # - # The possible candidate devices are sorted, placing USB devices at the end. + # The possible candidate devices are sorted, placing boot-optimized devices at the beginning and + # removable devices (like USB) at the end. # # @return [Array<String>] e.g. ["/dev/sda", "/dev/sdc"] def fallback_candidates # NOTE: sort_by it is not being used here because "the result is not guaranteed to be stable" # see https://ruby-doc.org/core-2.5.0/Enumerable.html#method-i-sort_by # In addition, a partition makes more sense here since we only are "grouping" available disks - # in two groups and moving one of them to the end. + # in three groups and arranging those groups. candidates = disk_analyzer.candidate_disks - candidates = candidates.partition { |d| d.respond_to?(:usb?) && !d.usb? }.flatten + high_prio, rest = candidates.partition(&:boss?) + low_prio, rest = rest.partition { |d| maybe_removable?(d) } + candidates = high_prio + rest + low_prio candidates.first(fallback_candidates_size).map(&:name) end @@ -315,6 +318,23 @@ [disks, proposed_volumes_sets.size].max end + # Whether the given device is potentially a removable disk + # + # It's not always possible to detect whether a given device is physically removable or not (eg. + # a fixed device may be connected to the USB bus or an SD card may be internal), but this + # returns true if the device is suspicious enough so it's better to avoid it in the automatic + # proposal if possible. + # + # @param device [BlkDevice] + # @return [boolean] + def maybe_removable?(device) + return true if device.is?(:sd_card) + return true if device.respond_to?(:usb?) && device.usb? + return true if device.respond_to?(:firewire?) && device.firewire? + + false + end + # All proposed volumes sets from the settings # # @return [Array<VolumeSpecificationsSet>] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/src/lib/y2storage/mountable.rb new/yast2-storage-ng-4.4.11/src/lib/y2storage/mountable.rb --- old/yast2-storage-ng-4.4.8/src/lib/y2storage/mountable.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/src/lib/y2storage/mountable.rb 2021-10-21 15:39:13.000000000 +0200 @@ -120,20 +120,10 @@ mp.path = path # Recalculate etc status for the parent devices update_etc_status - # Recalculate the crypt_options for parent encryption devices - adjust_crypt_options + # Recalculate the crypt_options and mount_by for parent encryption devices + adjust_crypt_devices # Ensure the mount_by makes sense mp.ensure_suitable_mount_by - # Adjust mount_by for encryption layer: try to use the same mount_by - # type as for the filesystem - if mp.filesystem.encrypted? - mp.filesystem.blk_devices.each do |dev| - next unless dev.respond_to?(:mount_by) - - dev.mount_by = mp.mount_by - dev.ensure_suitable_mount_by - end - end mp end @@ -142,7 +132,7 @@ # @raise [Storage::Exception] if the mountable has no mount point def remove_mount_point storage_remove_mount_point - adjust_crypt_options + adjust_crypt_devices update_etc_status end @@ -160,6 +150,18 @@ ancestors.select { |d| d.is?(:encryption) }.each(&:adjust_crypt_options) end + # Updates the crypttab options and the mount_by value for all the associated + # encryption devices + # + # @see Encryption#adjust_crypt_options + # @see Encryption#adjust_mount_by + def adjust_crypt_devices + ancestors.select { |d| d.is?(:encryption) }.each do |enc| + enc.adjust_mount_by + enc.adjust_crypt_options + end + end + # Mount options proposed by YaST for mount points associated to this device, # in addition to the ones returned by libstorage-ng # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/test/support/guided_setup_context.rb new/yast2-storage-ng-4.4.11/test/support/guided_setup_context.rb --- old/yast2-storage-ng-4.4.8/test/support/guided_setup_context.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/test/support/guided_setup_context.rb 2021-10-21 15:39:13.000000000 +0200 @@ -36,15 +36,28 @@ (all_disks - disks).each { |d| not_select_widget(d) } end - def disk(name, partitions = {}) - disk = instance_double(Y2Storage::Disk, name: name, size: Y2Storage::DiskSize.new(0)) + # Builds and returns a Disk double + # + # @param name [String] device name of the disk + # @param args [Hash] the key :partitions is turned into a collection of Partition doubles to mock + # Disk#partitions, the rest are passed to the double instance as mocked messages + def disk(name, args = {}) + defaults = { size: Y2Storage::DiskSize.new(0), boss?: false, partitions: {} } + args = defaults.merge(args) + args[:name] = name + + partitions = args.delete(:partitions) parts = if partitions && partitions[name] partitions[name].map { |pname| partition_double(pname) } else [] end + + disk = instance_double(Y2Storage::Disk, **args) allow(disk).to receive(:partitions).and_return parts + allow(disk).to receive(:is?).with(:sd_card).and_return false + disk end @@ -66,9 +79,9 @@ allow(guided_setup).to receive(:settings).and_return(settings) allow(analyzer).to receive(:candidate_disks) - .and_return(all_disks.map { |d| disk(d, partitions) }) + .and_return(all_disks.map { |d| disk(d, partitions: partitions) }) - allow(analyzer).to receive(:device_by_name) { |d| disk(d, partitions) } + allow(analyzer).to receive(:device_by_name) { |d| disk(d, partitions: partitions) } allow(analyzer).to receive(:installed_systems) .and_return(windows_systems + linux_systems) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/test/y2storage/autoinst_profile/skip_list_value_test.rb new/yast2-storage-ng-4.4.11/test/y2storage/autoinst_profile/skip_list_value_test.rb --- old/yast2-storage-ng-4.4.8/test/y2storage/autoinst_profile/skip_list_value_test.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/test/y2storage/autoinst_profile/skip_list_value_test.rb 2021-10-21 15:39:13.000000000 +0200 @@ -178,10 +178,7 @@ let(:hwinfo) { OpenStruct.new(bios_id: "0x80", driver: ["ahci"], unknown: "value") } before do - allow(disk).to receive(:hwinfo).and_return( - bios_id: "0x80", - driver: ["ahci"] - ) + allow(disk).to receive(:hwinfo).and_return hwinfo end it "returns a hash containing supported keys and values" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/test/y2storage/default_mount_by_test.rb new/yast2-storage-ng-4.4.11/test/y2storage/default_mount_by_test.rb --- old/yast2-storage-ng-4.4.8/test/y2storage/default_mount_by_test.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/test/y2storage/default_mount_by_test.rb 2021-10-21 15:39:13.000000000 +0200 @@ -55,9 +55,9 @@ let(:mount_by_type) { Y2Storage::Filesystems::MountByType::UUID } context "mounting an encrypted partition" do - it "mounts by uuid" do + it "mounts by device name" do mp = filesystem.create_mount_point("/foo") - expect(mp.mount_by.is?(:uuid)).to eq true + expect(mp.mount_by.is?(:device)).to eq true end it "uses uuid in crypttab" do @@ -71,9 +71,9 @@ let(:mount_by_type) { Y2Storage::Filesystems::MountByType::LABEL } context "mounting an encrypted partition" do - it "mounts by label" do + it "mounts by device name" do mp = filesystem.create_mount_point("/foo") - expect(mp.mount_by.is?(:label)).to eq true + expect(mp.mount_by.is?(:device)).to eq true end it "uses uuid in crypttab" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/test/y2storage/dialogs/guided_setup/helpers/disk_test.rb new/yast2-storage-ng-4.4.11/test/y2storage/dialogs/guided_setup/helpers/disk_test.rb --- old/yast2-storage-ng-4.4.8/test/y2storage/dialogs/guided_setup/helpers/disk_test.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/test/y2storage/dialogs/guided_setup/helpers/disk_test.rb 2021-10-21 15:39:13.000000000 +0200 @@ -35,6 +35,8 @@ allow(disk).to receive(:respond_to?).with(anything) allow(disk).to receive(:respond_to?).with(:transport).and_return(true) allow(disk).to receive(:transport).and_return(transport) + allow(disk).to receive(:is?).with(:sd_card).and_return(sd_card) + allow(disk).to receive(:boss?).and_return(boss) allow(transport).to receive(:is?).with(:usb).and_return(usb) allow(transport).to receive(:is?).with(:sbp).and_return(sbp) @@ -49,12 +51,30 @@ let(:name) { "/dev/sda" } let(:usb) { false } let(:sbp) { false } + let(:sd_card) { false } + let(:boss) { false } let(:installed_systems) { [] } it "contains the disk name and the size" do expect(subject.label(disk)).to match(/\/dev\/sda, 20.00 GiB/) end + context "when the disk is a MMC/SDCard" do + let(:sd_card) { true } + + it "includes the 'SD Card' label" do + expect(subject.label(disk)).to match(/SD Card/) + end + end + + context "when the disk is a Dell BOSS drive" do + let(:boss) { true } + + it "includes the 'Dell BOSS' label" do + expect(subject.label(disk)).to match(/Dell BOSS/) + end + end + context "when the disk transport is usb" do let(:usb) { true } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/test/y2storage/dialogs/guided_setup/select_disks_test.rb new/yast2-storage-ng-4.4.11/test/y2storage/dialogs/guided_setup/select_disks_test.rb --- old/yast2-storage-ng-4.4.8/test/y2storage/dialogs/guided_setup/select_disks_test.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/test/y2storage/dialogs/guided_setup/select_disks_test.rb 2021-10-21 15:39:13.000000000 +0200 @@ -134,10 +134,10 @@ let(:first_disks) do [ - double("Disk", name: "/dev/sda", size: 10.GiB, transport: usb), - double("Disk", name: "/dev/sdb", size: 20.GiB, transport: sbp), - double("Disk", name: "/dev/sdc", size: 30.GiB, transport: ata), - double("Disk", name: "/dev/sdd", size: 40.GiB) + disk("/dev/sda", size: 10.GiB, transport: usb), + disk("/dev/sdb", size: 20.GiB, transport: sbp), + disk("/dev/sdc", size: 30.GiB, transport: ata), + disk("/dev/sdd", size: 40.GiB) ] end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/test/y2storage/dialogs/proposal_test.rb new/yast2-storage-ng-4.4.11/test/y2storage/dialogs/proposal_test.rb --- old/yast2-storage-ng-4.4.8/test/y2storage/dialogs/proposal_test.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/test/y2storage/dialogs/proposal_test.rb 2021-10-21 15:39:13.000000000 +0200 @@ -36,14 +36,18 @@ let(:excluded_buttons) { [] } describe "#run" do - let(:devicegraph0) { double("Storage::Devicegraph", actiongraph: actiongraph0) } + let(:devicegraph0) do + double("Storage::Devicegraph", actiongraph: actiongraph0, blk_devices: blk_devices) + end let(:actiongraph0) { double("Storage::Actiongraph") } let(:actions_presenter0) do double(Y2Storage::ActionsPresenter, to_html: presenter_content0) end let(:presenter_content0) { "<li>Action 1</li><li>Action 2</li>" } - let(:devicegraph1) { double("Storage::Devicegraph", actiongraph: actiongraph1) } + let(:devicegraph1) do + double("Storage::Devicegraph", actiongraph: actiongraph1, blk_devices: blk_devices) + end let(:actiongraph1) { double("Storage::Actiongraph") } let(:actions_presenter1) do double(Y2Storage::ActionsPresenter, to_html: presenter_content1) @@ -52,6 +56,8 @@ let(:actions_presenter2) { double(Y2Storage::ActionsPresenter, to_html: nil) } + let(:blk_devices) { [] } + before do Y2Storage::StorageManager.create_test_instance @@ -120,6 +126,56 @@ end end + shared_examples "BOSS information" do + context "if there are no BOSS drives in the system" do + let(:blk_devices) do + [ + double("Y2Storage::Disk", boss?: false, name: "/dev/sda"), + double("Y2Storage::Disk", boss?: false, name: "/dev/sdb") + ] + end + + it "displays no information about BOSS" do + expect(Yast::Wizard).to receive(:SetContents) do |_title, content| + expect(content.to_s).to_not include "BOSS" + end + dialog.run + end + end + + context "if there is a BOSS drive in the system" do + let(:blk_devices) do + [ + double("Y2Storage::Disk", boss?: false, name: "/dev/sda"), + double("Y2Storage::Disk", boss?: true, name: "/dev/sdb") + ] + end + + it "displays a note pointing which disk is BOSS" do + expect(Yast::Wizard).to receive(:SetContents) do |_title, content| + expect(content.to_s).to include "device /dev/sdb is a Dell BOSS" + end + dialog.run + end + end + + context "if there are several BOSS drives in the system" do + let(:blk_devices) do + [ + double("Y2Storage::Disk", boss?: true, name: "/dev/sda"), + double("Y2Storage::Disk", boss?: true, name: "/dev/sdb") + ] + end + + it "displays a note enumerating the BOSS drives" do + expect(Yast::Wizard).to receive(:SetContents) do |_title, content| + expect(content.to_s).to include "devices are Dell BOSS drives: /dev/sda, /dev/sdb" + end + dialog.run + end + end + end + context "when Guided Setup button is not excluded" do let(:excluded_buttons) { [] } @@ -194,6 +250,8 @@ dialog.run end + include_examples "BOSS information" + it "sets #proposal to the provided proposal" do dialog.run expect(dialog.proposal).to eq proposal @@ -359,6 +417,8 @@ end end + include_examples "BOSS information" + it "sets #proposal to the provided proposal" do dialog.run expect(dialog.proposal).to eq proposal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.8/test/y2storage/initial_guided_proposal_test.rb new/yast2-storage-ng-4.4.11/test/y2storage/initial_guided_proposal_test.rb --- old/yast2-storage-ng-4.4.8/test/y2storage/initial_guided_proposal_test.rb 2021-10-01 12:54:42.000000000 +0200 +++ new/yast2-storage-ng-4.4.11/test/y2storage/initial_guided_proposal_test.rb 2021-10-21 15:39:13.000000000 +0200 @@ -117,23 +117,48 @@ let(:sda_usb) { true } shared_examples "no candidate devices" do - it "uses the first non USB device to make the proposal" do - proposal.propose + context "and there are no Dell BOSS drives" do + it "uses the first non USB device to make the proposal" do + proposal.propose - expect(used_devices).to contain_exactly("/dev/sdb") - end + expect(used_devices).to contain_exactly("/dev/sdb") + end - context "and a proposal is not possible with the current device" do - before do - # root requires at least 8 GiB and home 10 GiB - sdb.size = 5.GiB + context "and a proposal is not possible with the current device" do + before do + # root requires at least 8 GiB and home 10 GiB + sdb.size = 5.GiB + end + + it "uses the next non USB device to make the proposal" do + proposal.propose + + expect(used_devices).to contain_exactly("/dev/sdc") + end end + end - it "uses the next non USB device to make the proposal" do + context "and there is a Dell BOSS drive" do + before { allow(sdc).to receive(:model).and_return "DELLBOSS-1234" } + + it "uses the BOSS device to make the proposal" do proposal.propose expect(used_devices).to contain_exactly("/dev/sdc") end + + context "and a proposal is not possible in the BOSS drive" do + before do + # root requires at least 8 GiB and home 10 GiB + sdc.size = 5.GiB + end + + it "uses the first non-USB non-BOSS device to make the proposal" do + proposal.propose + + expect(used_devices).to contain_exactly("/dev/sdb") + end + end end end