Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-bootloader for 
openSUSE:Factory checked in at 2021-01-18 11:26:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-bootloader.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-bootloader"

Mon Jan 18 11:26:34 2021 rev:300 rq:862948 version:4.3.17

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes        
2020-11-23 16:26:10.504468177 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-bootloader.new.28504/yast2-bootloader.changes 
    2021-01-18 11:26:45.420471699 +0100
@@ -1,0 +2,8 @@
+Tue Jan 12 13:23:46 UTC 2021 - Ancor Gonzalez Sosa <[email protected]>
+
+- The logic for calculating a device udev link is now delegated to
+  the yast2-storage-ng module (jsc#SLE-17081, also related to
+  bsc#1177926 and bsc#1169874).
+- 4.3.17
+
+-------------------------------------------------------------------

Old:
----
  yast2-bootloader-4.3.16.tar.bz2

New:
----
  yast2-bootloader-4.3.17.tar.bz2

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

Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.2ZBGRc/_old  2021-01-18 11:26:45.984472970 +0100
+++ /var/tmp/diff_new_pack.2ZBGRc/_new  2021-01-18 11:26:45.988472979 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-bootloader
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        4.3.16
+Version:        4.3.17
 Release:        0
 Summary:        YaST2 - Bootloader Configuration
 License:        GPL-2.0-or-later
@@ -29,8 +29,8 @@
 BuildRequires:  yast2 >= 4.3.41
 BuildRequires:  yast2-devtools >= 4.2.2
 BuildRequires:  yast2-ruby-bindings >= 1.0.0
-# Y2Storage::Mountable#mount_path
-BuildRequires:  yast2-storage-ng >= 4.0.90
+# BlkDevice#preferred_name and Filesystems::BlkFilesystem#preferred_name
+BuildRequires:  yast2-storage-ng >= 4.3.36
 # lenses needed also for tests
 BuildRequires:  augeas-lenses
 BuildRequires:  update-desktop-files
@@ -46,8 +46,8 @@
 Requires:       yast2-core >= 2.18.7
 Requires:       yast2-packager >= 2.17.24
 Requires:       yast2-pkg-bindings >= 2.17.25
-# Y2Storage::Mountable#mount_path
-Requires:       yast2-storage-ng >= 4.0.90
+# BlkDevice#preferred_name and Filesystems::BlkFilesystem#preferred_name
+Requires:       yast2-storage-ng >= 4.3.36
 # Support for multiple values in GRUB_TERMINAL
 Requires:       rubygem(%rb_default_ruby_abi:cfa_grub2) >= 1.0.1
 # lenses are needed as cfa_grub2 depends only on augeas bindings, but also

++++++ yast2-bootloader-4.3.16.tar.bz2 -> yast2-bootloader-4.3.17.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.3.16/.coveralls.yml 
new/yast2-bootloader-4.3.17/.coveralls.yml
--- old/yast2-bootloader-4.3.16/.coveralls.yml  2020-11-17 23:40:24.000000000 
+0100
+++ new/yast2-bootloader-4.3.17/.coveralls.yml  1970-01-01 01:00:00.000000000 
+0100
@@ -1 +0,0 @@
-service_name: travis-ci
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.3.16/.github/workflows/ci.yml 
new/yast2-bootloader-4.3.17/.github/workflows/ci.yml
--- old/yast2-bootloader-4.3.16/.github/workflows/ci.yml        1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-bootloader-4.3.17/.github/workflows/ci.yml        2021-01-13 
17:24:25.000000000 +0100
@@ -0,0 +1,85 @@
+
+# See 
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
+
+name: CI
+
+on: [push, pull_request]
+
+jobs:
+  Tests:
+    runs-on: ubuntu-latest
+    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+
+    steps:
+
+    - name: Git Checkout
+      uses: actions/checkout@v2
+
+    # just for easier debugging...
+    - name: Inspect Installed Packages
+      run: rpm -qa | sort
+
+    - name: Unit Tests
+      run: rake test:unit
+      # enable code coverage reporting
+      env:
+        COVERAGE: 1
+
+    # send the coverage report to coveralls.io
+    - name: Coveralls Report
+      uses: coverallsapp/github-action@master
+      with:
+        github-token: ${{ secrets.GITHUB_TOKEN }}
+
+  Rubocop:
+    runs-on: ubuntu-latest
+    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+
+    steps:
+
+    - name: Git Checkout
+      uses: actions/checkout@v2
+
+    - name: Rubocop
+      run: rake check:rubocop
+
+  Package:
+    runs-on: ubuntu-latest
+    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+
+    steps:
+
+    - name: Git Checkout
+      uses: actions/checkout@v2
+
+    - name: Package Build
+      run: yast-ci-ruby -o package
+
+  Yardoc:
+    runs-on: ubuntu-latest
+    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+
+    steps:
+
+    - name: Git Checkout
+      uses: actions/checkout@v2
+
+    - name: Yardoc
+      run: rake check:doc
+
+  # downloading the Docker image takes some time so bundling several fast
+  # checks into one job avoids that overhead
+  Checks:
+    runs-on: ubuntu-latest
+    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+
+    steps:
+
+    - name: Git Checkout
+      uses: actions/checkout@v2
+
+    - name: Perl Syntax
+      run: yast-ci-ruby -o perl_syntax
+
+    - name: POT Check
+      run: rake check:pot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.3.16/.travis.yml 
new/yast2-bootloader-4.3.17/.travis.yml
--- old/yast2-bootloader-4.3.16/.travis.yml     2020-11-17 23:40:24.000000000 
+0100
+++ new/yast2-bootloader-4.3.17/.travis.yml     1970-01-01 01:00:00.000000000 
+0100
@@ -1,12 +0,0 @@
-sudo: required
-language: bash
-services:
-  - docker
-
-before_install:
-  - docker build -t yast-bootloader-image .
-script:
-  # the "yast-travis-ruby" script is included in the base yastdevel/ruby image
-  # see https://github.com/yast/docker-yast-ruby/blob/master/yast-travis-ruby
-  - docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" 
yast-bootloader-image yast-travis-ruby
-  - docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" 
yast-bootloader-image rake check:doc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.3.16/Dockerfile 
new/yast2-bootloader-4.3.17/Dockerfile
--- old/yast2-bootloader-4.3.16/Dockerfile      2020-11-17 23:40:24.000000000 
+0100
+++ new/yast2-bootloader-4.3.17/Dockerfile      1970-01-01 01:00:00.000000000 
+0100
@@ -1,2 +0,0 @@
-FROM registry.opensuse.org/yast/head/containers/yast-ruby:latest
-COPY . /usr/src/app
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.3.16/README.md 
new/yast2-bootloader-4.3.17/README.md
--- old/yast2-bootloader-4.3.16/README.md       2020-11-17 23:40:24.000000000 
+0100
+++ new/yast2-bootloader-4.3.17/README.md       2021-01-13 17:24:25.000000000 
+0100
@@ -1,7 +1,9 @@
 # YaST - The Bootloader Module #
 
-[![Travis 
Build](https://travis-ci.org/yast/yast-bootloader.svg?branch=master)](https://travis-ci.org/yast/yast-bootloader)
-[![Jenkins 
Build](http://img.shields.io/jenkins/s/https/ci.opensuse.org/yast-bootloader-master.svg)](https://ci.opensuse.org/view/Yast/job/yast-bootloader-master/)
+[![Workflow 
Status](https://github.com/yast/yast-bootloader/workflows/CI/badge.svg?branch=master)](
+https://github.com/yast/yast-bootloader/actions?query=branch%3Amaster)
+[![Jenkins 
Status](https://ci.opensuse.org/buildStatus/icon?job=yast-yast-bootloader-master)](
+https://ci.opensuse.org/view/Yast/job/yast-yast-bootloader-master/)
 [![Coverage 
Status](https://img.shields.io/coveralls/yast/yast-bootloader.svg)](https://coveralls.io/r/yast/yast-bootloader?branch=master)
 [![inline 
docs](http://inch-ci.org/github/yast/yast-bootloader.svg?branch=master)](http://inch-ci.org/github/yast/yast-bootloader)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.3.16/package/yast2-bootloader.changes 
new/yast2-bootloader-4.3.17/package/yast2-bootloader.changes
--- old/yast2-bootloader-4.3.16/package/yast2-bootloader.changes        
2020-11-17 23:40:24.000000000 +0100
+++ new/yast2-bootloader-4.3.17/package/yast2-bootloader.changes        
2021-01-13 17:24:25.000000000 +0100
@@ -1,4 +1,12 @@
 -------------------------------------------------------------------
+Tue Jan 12 13:23:46 UTC 2021 - Ancor Gonzalez Sosa <[email protected]>
+
+- The logic for calculating a device udev link is now delegated to
+  the yast2-storage-ng module (jsc#SLE-17081, also related to
+  bsc#1177926 and bsc#1169874).
+- 4.3.17
+
+-------------------------------------------------------------------
 Mon Nov 16 16:13:58 UTC 2020 - Josef Reidinger <[email protected]>
 
 - Make wording in summary more consistent
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.3.16/package/yast2-bootloader.spec 
new/yast2-bootloader-4.3.17/package/yast2-bootloader.spec
--- old/yast2-bootloader-4.3.16/package/yast2-bootloader.spec   2020-11-17 
23:40:24.000000000 +0100
+++ new/yast2-bootloader-4.3.17/package/yast2-bootloader.spec   2021-01-13 
17:24:25.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        4.3.16
+Version:        4.3.17
 Release:        0
 Summary:        YaST2 - Bootloader Configuration
 License:        GPL-2.0-or-later
@@ -29,8 +29,8 @@
 BuildRequires:  yast2 >= 4.3.41
 BuildRequires:  yast2-devtools >= 4.2.2
 BuildRequires:  yast2-ruby-bindings >= 1.0.0
-# Y2Storage::Mountable#mount_path
-BuildRequires:  yast2-storage-ng >= 4.0.90
+# BlkDevice#preferred_name and Filesystems::BlkFilesystem#preferred_name
+BuildRequires:  yast2-storage-ng >= 4.3.36
 # lenses needed also for tests
 BuildRequires:  augeas-lenses
 BuildRequires:  rubygem(%rb_default_ruby_abi:cfa_grub2) >= 1.0.1
@@ -46,8 +46,8 @@
 Requires:       yast2-core >= 2.18.7
 Requires:       yast2-packager >= 2.17.24
 Requires:       yast2-pkg-bindings >= 2.17.25
-# Y2Storage::Mountable#mount_path
-Requires:       yast2-storage-ng >= 4.0.90
+# BlkDevice#preferred_name and Filesystems::BlkFilesystem#preferred_name
+Requires:       yast2-storage-ng >= 4.3.36
 # Support for multiple values in GRUB_TERMINAL
 Requires:       rubygem(%rb_default_ruby_abi:cfa_grub2) >= 1.0.1
 # lenses are needed as cfa_grub2 depends only on augeas bindings, but also
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.3.16/src/lib/bootloader/udev_mapping.rb 
new/yast2-bootloader-4.3.17/src/lib/bootloader/udev_mapping.rb
--- old/yast2-bootloader-4.3.16/src/lib/bootloader/udev_mapping.rb      
2020-11-17 23:40:24.000000000 +0100
+++ new/yast2-bootloader-4.3.17/src/lib/bootloader/udev_mapping.rb      
2021-01-13 17:24:25.000000000 +0100
@@ -38,26 +38,10 @@
 
     # Converts udev or kernel device (disk or partition) to udev name that 
fits best.
     #
-    # Here is description of strategy for finding the best possible udev 
persistent name.
-    # There are three scenarios we consider:
-    # S1. disk with boot configuration is moved to different PC
-    # S2. disk dies and its content is loaded to new disk from backup
-    # S3. path to disk dies and disk is moved to different one
-    #
-    # Strategy is:
-    #
-    # 1. if device have filesystem and it have its mount_by, then respect it
-    # 2. if there is by-label use it, as it allows to handle S1, S2 and S3 
just with using same
-    #    label
-    # 3. if there is by-uuid then use it as it can also handle S1, S2 and S3 
as uuid can be
-    #    changed, but it is harder to do
-    # 4. if there is by-id use it, as it can handle S3 in some scenarios, but 
not always.
-    # 5. if there is by-path use it as it is last supported udev symlink that 
at least prevent
-    #    change of kernel device during boot
-    # 6. as fallback use kernel name
+    # The strategy to discover the best udev name is delegated to storage-ng, 
see
+    # Y2Storage::Filesystems::BlkFilesystem#preferred_name
     #
     # @param dev [String] device udev or kernel one like /dev/disk/by-id/blabla
-    # @raise when device have udev format but do not exists
     # @return [String] udev name
     def to_mountby_device(dev)
       kernel_dev = to_kernel_device(dev)
@@ -92,6 +76,14 @@
       device.name
     end
 
+    # Udev name for the device
+    #
+    # The selected udev name depends on the mount by option. In case of an 
unmounted device,
+    # storage-ng has logic to discover the preferred mount by option.
+    #
+    # @see #to_mountby_device
+    #
+    # @return [String]
     def kernel_to_udev(dev)
       device = Y2Storage::BlkDevice.find_by_name(staging, dev)
       if device.nil?
@@ -108,45 +100,13 @@
     # picks udev name according to strategy
     # @see #to_mountby_device
     def udev_name_for(device)
-      mount_by_udev(device) ||
-        udev_by_label(device) ||
-        udev_by_uuid(device) ||
-        udev_by_id(device) ||
-        udev_by_path(device) ||
-        device.name
-    end
-
-    def mount_by_udev(device)
-      filesystem = device.filesystem
-      return nil unless filesystem
-      # mount_by is nil, so not mounted and we need to use our own strategy
-      return nil if filesystem.mount_by.nil?
-
-      case filesystem.mount_by.to_sym
-      when :device then device.name
-      when :uuid then udev_by_uuid(device)
-      when :label then udev_by_label(device)
-      when :id then udev_by_id(device)
-      when :path then udev_by_path(device)
+      if device.filesystem
+        log.info "udev_name_for: using the preferred name for the filesystem"
+        device.filesystem.preferred_name
       else
-        raise "Unknown mount by option #{filesystem.mount_by.inspect} for 
#{filesystem.inspect}"
+        log.info "udev_name_for: using the preferred name for the block device"
+        device.preferred_name
       end
     end
-
-    def udev_by_uuid(device)
-      device.udev_full_uuid
-    end
-
-    def udev_by_label(device)
-      device.udev_full_label
-    end
-
-    def udev_by_id(device)
-      device.udev_full_ids.first
-    end
-
-    def udev_by_path(device)
-      device.udev_full_paths.first
-    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.3.16/test/data/bug_1166096.xml 
new/yast2-bootloader-4.3.17/test/data/bug_1166096.xml
--- old/yast2-bootloader-4.3.16/test/data/bug_1166096.xml       1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-bootloader-4.3.17/test/data/bug_1166096.xml       2021-01-13 
17:24:25.000000000 +0100
@@ -0,0 +1,342 @@
+<?xml version="1.0"?>
+<!-- generated by libstorage-ng version 4.2.65, install, 2020-03-03 06:00:31 
GMT -->
+<Devicegraph>
+  <Devices>
+    <Disk>
+      <sid>43</sid>
+      <name>/dev/vda</name>
+      <sysfs-name>vda</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:06.0/virtio3/block/vda</sysfs-path>
+      <region>
+        <length>41943040</length>
+        <block-size>512</block-size>
+      </region>
+      <topology/>
+      <udev-path>pci-0000:00:06.0</udev-path>
+      <range>256</range>
+      <rotational>true</rotational>
+    </Disk>
+    <Gpt>
+      <sid>51</sid>
+    </Gpt>
+    <Partition>
+      <sid>52</sid>
+      <name>/dev/vda1</name>
+      <sysfs-name>vda1</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:06.0/virtio3/block/vda/vda1</sysfs-path>
+      <region>
+        <start>2048</start>
+        <length>16384</length>
+        <block-size>512</block-size>
+      </region>
+      <topology/>
+      <udev-path>pci-0000:00:06.0-part1</udev-path>
+      <type>primary</type>
+      <id>65</id>
+    </Partition>
+    <Partition>
+      <sid>53</sid>
+      <name>/dev/vda2</name>
+      <sysfs-name>vda2</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:06.0/virtio3/block/vda/vda2</sysfs-path>
+      <region>
+        <start>18432</start>
+        <length>39047168</length>
+        <block-size>512</block-size>
+      </region>
+      <topology/>
+      <udev-path>pci-0000:00:06.0-part2</udev-path>
+      <type>primary</type>
+      <id>131</id>
+    </Partition>
+    <Btrfs>
+      <sid>54</sid>
+      <metadata-raid-level>DEFAULT</metadata-raid-level>
+      <data-raid-level>DEFAULT</data-raid-level>
+    </Btrfs>
+    <BtrfsSubvolume>
+      <sid>55</sid>
+      <id>5</id>
+      <path></path>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>56</sid>
+      <path>/</path>
+      <mount-by>uuid</mount-by>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+    <BtrfsSubvolume>
+      <sid>57</sid>
+      <id>-1</id>
+      <path>@</path>
+      <default-btrfs-subvolume>true</default-btrfs-subvolume>
+    </BtrfsSubvolume>
+    <BtrfsSubvolume>
+      <sid>58</sid>
+      <id>-1</id>
+      <path>@/boot/grub2/powerpc-ieee1275</path>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>59</sid>
+      <path>/boot/grub2/powerpc-ieee1275</path>
+      <mount-by>uuid</mount-by>
+      <mount-options>subvol=/@/boot/grub2/powerpc-ieee1275</mount-options>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+    <BtrfsSubvolume>
+      <sid>60</sid>
+      <id>-1</id>
+      <path>@/home</path>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>61</sid>
+      <path>/home</path>
+      <mount-by>uuid</mount-by>
+      <mount-options>subvol=/@/home</mount-options>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+    <BtrfsSubvolume>
+      <sid>62</sid>
+      <id>-1</id>
+      <path>@/opt</path>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>63</sid>
+      <path>/opt</path>
+      <mount-by>uuid</mount-by>
+      <mount-options>subvol=/@/opt</mount-options>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+    <BtrfsSubvolume>
+      <sid>64</sid>
+      <id>-1</id>
+      <path>@/root</path>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>65</sid>
+      <path>/root</path>
+      <mount-by>uuid</mount-by>
+      <mount-options>subvol=/@/root</mount-options>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+    <BtrfsSubvolume>
+      <sid>66</sid>
+      <id>-1</id>
+      <path>@/srv</path>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>67</sid>
+      <path>/srv</path>
+      <mount-by>uuid</mount-by>
+      <mount-options>subvol=/@/srv</mount-options>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+    <BtrfsSubvolume>
+      <sid>68</sid>
+      <id>-1</id>
+      <path>@/tmp</path>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>69</sid>
+      <path>/tmp</path>
+      <mount-by>uuid</mount-by>
+      <mount-options>subvol=/@/tmp</mount-options>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+    <BtrfsSubvolume>
+      <sid>70</sid>
+      <id>-1</id>
+      <path>@/usr/local</path>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>71</sid>
+      <path>/usr/local</path>
+      <mount-by>uuid</mount-by>
+      <mount-options>subvol=/@/usr/local</mount-options>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+    <BtrfsSubvolume>
+      <sid>72</sid>
+      <id>-1</id>
+      <path>@/var</path>
+      <nocow>true</nocow>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>73</sid>
+      <path>/var</path>
+      <mount-by>uuid</mount-by>
+      <mount-options>subvol=/@/var</mount-options>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+    <Partition>
+      <sid>74</sid>
+      <name>/dev/vda3</name>
+      <sysfs-name>vda3</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:06.0/virtio3/block/vda/vda3</sysfs-path>
+      <region>
+        <start>39065600</start>
+        <length>2877407</length>
+        <block-size>512</block-size>
+      </region>
+      <topology/>
+      <udev-path>pci-0000:00:06.0-part3</udev-path>
+      <type>primary</type>
+      <id>130</id>
+    </Partition>
+    <Swap>
+      <sid>75</sid>
+    </Swap>
+    <MountPoint>
+      <sid>76</sid>
+      <path>swap</path>
+      <mount-by>uuid</mount-by>
+      <mount-type>swap</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+  </Devices>
+  <Holders>
+    <User>
+      <source-sid>43</source-sid>
+      <target-sid>51</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>51</source-sid>
+      <target-sid>52</target-sid>
+    </Subdevice>
+    <Subdevice>
+      <source-sid>51</source-sid>
+      <target-sid>53</target-sid>
+    </Subdevice>
+    <Subdevice>
+      <source-sid>54</source-sid>
+      <target-sid>55</target-sid>
+    </Subdevice>
+    <FilesystemUser>
+      <source-sid>53</source-sid>
+      <target-sid>54</target-sid>
+    </FilesystemUser>
+    <User>
+      <source-sid>54</source-sid>
+      <target-sid>56</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>55</source-sid>
+      <target-sid>57</target-sid>
+    </Subdevice>
+    <Subdevice>
+      <source-sid>57</source-sid>
+      <target-sid>58</target-sid>
+    </Subdevice>
+    <User>
+      <source-sid>58</source-sid>
+      <target-sid>59</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>57</source-sid>
+      <target-sid>60</target-sid>
+    </Subdevice>
+    <User>
+      <source-sid>60</source-sid>
+      <target-sid>61</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>57</source-sid>
+      <target-sid>62</target-sid>
+    </Subdevice>
+    <User>
+      <source-sid>62</source-sid>
+      <target-sid>63</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>57</source-sid>
+      <target-sid>64</target-sid>
+    </Subdevice>
+    <User>
+      <source-sid>64</source-sid>
+      <target-sid>65</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>57</source-sid>
+      <target-sid>66</target-sid>
+    </Subdevice>
+    <User>
+      <source-sid>66</source-sid>
+      <target-sid>67</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>57</source-sid>
+      <target-sid>68</target-sid>
+    </Subdevice>
+    <User>
+      <source-sid>68</source-sid>
+      <target-sid>69</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>57</source-sid>
+      <target-sid>70</target-sid>
+    </Subdevice>
+    <User>
+      <source-sid>70</source-sid>
+      <target-sid>71</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>57</source-sid>
+      <target-sid>72</target-sid>
+    </Subdevice>
+    <User>
+      <source-sid>72</source-sid>
+      <target-sid>73</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>51</source-sid>
+      <target-sid>74</target-sid>
+    </Subdevice>
+    <FilesystemUser>
+      <source-sid>74</source-sid>
+      <target-sid>75</target-sid>
+    </FilesystemUser>
+    <User>
+      <source-sid>75</source-sid>
+      <target-sid>76</target-sid>
+    </User>
+  </Holders>
+</Devicegraph>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.3.16/test/data/trivial.xml 
new/yast2-bootloader-4.3.17/test/data/trivial.xml
--- old/yast2-bootloader-4.3.16/test/data/trivial.xml   1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-bootloader-4.3.17/test/data/trivial.xml   2021-01-13 
17:24:25.000000000 +0100
@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<!-- generated by libstorage-ng version 4.3.75, 2021-01-11 14:36:49 GMT -->
+<!--
+  This is equivalent to trivial.yml, but using the XML format to make possible 
to
+  specify udev paths and ids in a way that is understood by libstorage-ng
+-->
+<Devicegraph>
+  <Devices>
+    <Disk>
+      <sid>227</sid>
+      <name>/dev/sda</name>
+      <region>
+        <length>16777216</length>
+        <block-size>512</block-size>
+      </region>
+      <range>256</range>
+      <udev-path>pci-1234:56:78.9-ata-1.0</udev-path>
+    </Disk>
+    <Gpt>
+      <sid>228</sid>
+    </Gpt>
+    <Partition>
+      <sid>229</sid>
+      <name>/dev/sda1</name>
+      <region>
+        <start>2048</start>
+        <length>2048</length>
+        <block-size>512</block-size>
+      </region>
+      <type>primary</type>
+      <id>257</id>
+      <udev-path>pci-1234:56:78.9-ata-1.0-part1</udev-path>
+    </Partition>
+    <Vfat>
+      <sid>230</sid>
+      <uuid>3de29985-8cc6-4c9d-8562-2ede26b0c5b7</uuid>
+    </Vfat>
+    <Partition>
+      <sid>231</sid>
+      <name>/dev/sda2</name>
+      <region>
+        <start>4096</start>
+        <length>2052096</length>
+        <block-size>512</block-size>
+      </region>
+      <type>primary</type>
+      <id>130</id>
+      <udev-path>pci-1234:56:78.9-ata-1.0-part2</udev-path>
+    </Partition>
+    <Swap>
+      <sid>232</sid>
+      <uuid>ec8e9948-ca5f-4b18-a863-ac999365e4a9</uuid>
+    </Swap>
+    <MountPoint>
+      <sid>233</sid>
+      <path>swap</path>
+      <mount-by>uuid</mount-by>
+      <mount-type>swap</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+    <Partition>
+      <sid>234</sid>
+      <name>/dev/sda3</name>
+      <region>
+        <start>2056192</start>
+        <length>14720991</length>
+        <block-size>512</block-size>
+      </region>
+      <type>primary</type>
+      <id>131</id>
+      <udev-path>pci-1234:56:78.9-ata-1.0-part3</udev-path>
+    </Partition>
+    <Btrfs>
+      <sid>235</sid>
+      <metadata-raid-level>DEFAULT</metadata-raid-level>
+      <data-raid-level>DEFAULT</data-raid-level>
+      <uuid>3de29985-8cc6-4c9d-8562-2ede26b0c5b6</uuid>
+      <label>DATA</label>
+    </Btrfs>
+    <BtrfsSubvolume>
+      <sid>236</sid>
+      <id>5</id>
+      <path></path>
+      <default-btrfs-subvolume>true</default-btrfs-subvolume>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>237</sid>
+      <path>/</path>
+      <mount-by>uuid</mount-by>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
+  </Devices>
+  <Holders>
+    <User>
+      <source-sid>227</source-sid>
+      <target-sid>228</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>228</source-sid>
+      <target-sid>229</target-sid>
+    </Subdevice>
+    <FilesystemUser>
+      <source-sid>229</source-sid>
+      <target-sid>230</target-sid>
+    </FilesystemUser>
+    <Subdevice>
+      <source-sid>228</source-sid>
+      <target-sid>231</target-sid>
+    </Subdevice>
+    <FilesystemUser>
+      <source-sid>231</source-sid>
+      <target-sid>232</target-sid>
+    </FilesystemUser>
+    <User>
+      <source-sid>232</source-sid>
+      <target-sid>233</target-sid>
+    </User>
+    <Subdevice>
+      <source-sid>228</source-sid>
+      <target-sid>234</target-sid>
+    </Subdevice>
+    <Subdevice>
+      <source-sid>235</source-sid>
+      <target-sid>236</target-sid>
+    </Subdevice>
+    <FilesystemUser>
+      <source-sid>234</source-sid>
+      <target-sid>235</target-sid>
+    </FilesystemUser>
+    <User>
+      <source-sid>235</source-sid>
+      <target-sid>237</target-sid>
+    </User>
+  </Holders>
+</Devicegraph>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.3.16/test/test_helper.rb 
new/yast2-bootloader-4.3.17/test/test_helper.rb
--- old/yast2-bootloader-4.3.16/test/test_helper.rb     2020-11-17 
23:40:24.000000000 +0100
+++ new/yast2-bootloader-4.3.17/test/test_helper.rb     2021-01-13 
17:24:25.000000000 +0100
@@ -35,12 +35,20 @@
   # track all ruby files under src
   SimpleCov.track_files("#{src_location}/**/*.rb")
 
-  # use coveralls for on-line code coverage reporting at Travis CI
-  if ENV["TRAVIS"]
-    require "coveralls"
+  # additionally use the LCOV format for on-line code coverage reporting at CI
+  if ENV["CI"] || ENV["COVERAGE_LCOV"]
+    require "simplecov-lcov"
+
+    SimpleCov::Formatter::LcovFormatter.config do |c|
+      c.report_with_single_file = true
+      # this is the default Coveralls GitHub Action location
+      # https://github.com/marketplace/actions/coveralls-github-action
+      c.single_report_path = "coverage/lcov.info"
+    end
+
     SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
       SimpleCov::Formatter::HTMLFormatter,
-      Coveralls::SimpleCov::Formatter
+      SimpleCov::Formatter::LcovFormatter
     ]
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.3.16/test/udev_mapping_test.rb 
new/yast2-bootloader-4.3.17/test/udev_mapping_test.rb
--- old/yast2-bootloader-4.3.16/test/udev_mapping_test.rb       2020-11-17 
23:40:24.000000000 +0100
+++ new/yast2-bootloader-4.3.17/test/udev_mapping_test.rb       2021-01-13 
17:24:25.000000000 +0100
@@ -41,57 +41,140 @@
     end
   end
 
+  # NOTE: these tests go a bit further of the scope of unit testing, since 
they rely on
+  # functionality from yast2-storage-ng without mocking it. That's justified 
because three
+  # bugs have been reported about the topic (bsc#1151075, bsc#1166096 and 
bsc#1167779).
   describe ".to_mountby_device" do
-    let(:device) { find_device("/dev/sda3") }
+    # This mock is not needed, so let's explicitly remove it for clarity
+    let(:mount_by) { nil }
 
     before do
-      # find by name creates always new instance, so to make mocking easier, 
mock it to return always same instance
-      allow(Y2Storage::BlkDevice).to receive(:find_by_name).and_return(device)
-    end
-
-    it "returns udev link in same format as used to its mounting" do
-      device.filesystem.mount_point.mount_by = 
Y2Storage::Filesystems::MountByType.new(:uuid)
-
-      expect(subject.to_mountby_device(device.name)).to eq 
"/dev/disk/by-uuid/3de29985-8cc6-4c9d-8562-2ede26b0c5b6"
-    end
-
-    it "returns udev link by label if defined" do
-      device.filesystem.remove_mount_point
-
-      expect(subject.to_mountby_device(device.name)).to eq 
"/dev/disk/by-label/DATA"
-    end
+      devicegraph_stub("trivial.xml")
 
-    it "returns udev link by uuid if defined" do
-      device.filesystem.remove_mount_point
-      allow(device).to receive(:udev_full_label).and_return(nil)
-
-      expect(subject.to_mountby_device(device.name)).to eq 
"/dev/disk/by-uuid/3de29985-8cc6-4c9d-8562-2ede26b0c5b6"
-    end
-
-    it "returns first udev link by id if defined" do
-      device.filesystem.remove_mount_point
-      allow(device).to receive(:udev_full_label).and_return(nil)
-      allow(device).to receive(:udev_full_uuid).and_return(nil)
-      allow(device).to receive(:udev_ids).and_return(["abc", "cde"])
-
-      expect(subject.to_mountby_device(device.name)).to eq 
"/dev/disk/by-id/abc"
-    end
-
-    it "returns first udev link by path if defined" do
-      device.filesystem.remove_mount_point
-      allow(device).to receive(:udev_full_label).and_return(nil)
-      allow(device).to receive(:udev_full_uuid).and_return(nil)
-      allow(device).to receive(:udev_paths).and_return(["abc", "cde"])
-
-      expect(subject.to_mountby_device(device.name)).to eq 
"/dev/disk/by-path/abc"
+      # find by name creates always new instance, so to make mocking easier, 
mock it to
+      # return always same instance
+      allow(Y2Storage::BlkDevice).to receive(:find_by_name).and_return(device)
     end
 
-    it "returns kernel name as last fallback" do
-      device.filesystem.remove_mount_point
-      allow(device).to receive(:udev_full_label).and_return(nil)
-      allow(device).to receive(:udev_full_uuid).and_return(nil)
+    let(:device) { find_device("/dev/sda3") }
+    let(:storage_conf) { Y2Storage::StorageManager.instance.configuration }
 
-      expect(subject.to_mountby_device(device.name)).to eq device.name
+    context "when the device is formatted" do
+      before do
+        # The libstorage-ng bindings constantly create new instances of the 
storage objects.
+        # To make mocking easier, mock it to return always the same instances
+        allow(device).to receive(:filesystem).and_return(device.filesystem)
+      end
+
+      context "and mounted (or marked to be mounted)" do
+        context "and the udev name is available for the mount_by option in the 
mount point" do
+          it "returns the udev name according to the mount_by option in the 
mount point" do
+            expect(subject.to_mountby_device(device.name))
+              .to eq "/dev/disk/by-uuid/#{device.filesystem.uuid}"
+
+            device.filesystem.mount_point.mount_by = 
Y2Storage::Filesystems::MountByType::LABEL
+            expect(subject.to_mountby_device(device.name))
+              .to eq "/dev/disk/by-label/#{device.filesystem.label}"
+          end
+        end
+
+        context "and the udev name is not available for the mount by option in 
the mount point" do
+          before do
+            device.filesystem.uuid = ""
+          end
+
+          it "returns a reasonable fallback name" do
+            expect(subject.to_mountby_device(device.name))
+              .to eq "/dev/disk/by-label/#{device.filesystem.label}"
+
+            # Even without label
+            device.filesystem.label = ""
+            expect(subject.to_mountby_device(device.name))
+              .to eq "/dev/disk/by-path/pci-1234:56:78.9-ata-1.0-part3"
+          end
+        end
+      end
+
+      context "but not mounted" do
+        before { device.filesystem&.remove_mount_point }
+
+        context "and the udev name is available for the default mount_by" do
+          before do
+            storage_conf.default_mount_by = 
Y2Storage::Filesystems::MountByType::UUID
+          end
+
+          it "returns the preferred udev name for the filesystem" do
+            expect(subject.to_mountby_device(device.name))
+              .to eq "/dev/disk/by-uuid/#{device.filesystem.uuid}"
+
+            storage_conf.default_mount_by = 
Y2Storage::Filesystems::MountByType::PATH
+            expect(subject.to_mountby_device(device.name))
+              .to eq "/dev/disk/by-path/pci-1234:56:78.9-ata-1.0-part3"
+          end
+        end
+
+        context "and there is no udev name available honoring the default 
mount_by" do
+          before do
+            storage_conf.default_mount_by = 
Y2Storage::Filesystems::MountByType::ID
+          end
+
+          it "returns a reasonable fallback name" do
+            expect(subject.to_mountby_device(device.name))
+              .to eq "/dev/disk/by-uuid/#{device.filesystem.uuid}"
+
+            # Even without UUID
+            device.filesystem.uuid = ""
+            expect(subject.to_mountby_device(device.name))
+              .to eq "/dev/disk/by-label/DATA"
+          end
+        end
+      end
+    end
+
+    context "when the device is not formatted" do
+      before { device.remove_descendants }
+
+      context "and the udev name is available for the default mount_by" do
+        before do
+          storage_conf.default_mount_by = 
Y2Storage::Filesystems::MountByType::PATH
+        end
+
+        it "returns the preferred udev name for the block device" do
+          expect(subject.to_mountby_device(device.name))
+            .to eq "/dev/disk/by-path/pci-1234:56:78.9-ata-1.0-part3"
+        end
+      end
+
+      context "and there is no udev name available honoring the default 
mount_by" do
+        before do
+          storage_conf.default_mount_by = 
Y2Storage::Filesystems::MountByType::UUID
+        end
+
+        it "returns a reasonable fallback name" do
+          expect(subject.to_mountby_device(device.name))
+            .to eq "/dev/disk/by-path/pci-1234:56:78.9-ata-1.0-part3"
+        end
+      end
+    end
+
+    # Regression test for bsc#1166096
+    context "for a regular PReP partition (contains no filesystem and is not 
mounted)" do
+      before do
+        # First, disable the general mocking
+        allow(Y2Storage::BlkDevice).to receive(:find_by_name).and_call_original
+
+        # Then, just stub the whole devicegraph to reproduce the scenario
+        devicegraph_stub("bug_1166096.xml")
+      end
+
+      # These mocks are not needed
+      let(:device) { nil }
+      let(:mount_by) { nil }
+
+      it "returns an udev link if there is any available" do
+        expect(subject.to_mountby_device("/dev/vda1"))
+          .to eq "/dev/disk/by-path/pci-0000:00:06.0-part1"
+      end
     end
   end
 end

Reply via email to