Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-registration for 
openSUSE:Factory checked in at 2021-11-20 02:38:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-registration.new.1895 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-registration"

Sat Nov 20 02:38:13 2021 rev:76 rq:931580 version:4.4.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes    
2021-10-20 20:23:07.669335242 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-registration.new.1895/yast2-registration.changes
  2021-11-20 02:38:36.568885227 +0100
@@ -0,0 +1,8 @@
+-------------------------------------------------------------------
+Fri Nov 12 14:51:45 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Adapt to the ProductSpec API (bsc#1192626).
+- Report properly that no product is selected in autoinstallation
+  instead of nil crash (bsc#1188211, Josef Reidinger
+  <jreidin...@suse.com>).
+- 4.4.5

Old:
----
  yast2-registration-4.4.4.tar.bz2

New:
----
  yast2-registration-4.4.5.tar.bz2

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

Other differences:
------------------
++++++ yast2-registration.spec ++++++
--- /var/tmp/diff_new_pack.mRuh5c/_old  2021-11-20 02:38:36.992883828 +0100
+++ /var/tmp/diff_new_pack.mRuh5c/_new  2021-11-20 02:38:36.996883815 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-registration
-Version:        4.4.4
+Version:        4.4.5
 Release:        0
 Summary:        YaST2 - Registration Module
 License:        GPL-2.0-only
@@ -27,19 +27,19 @@
 Source0:        %{name}-%{version}.tar.bz2
 
 BuildRequires:  update-desktop-files
-# Installation::InstallationInfo
-BuildRequires:  yast2 >= 4.4.4
+# ProductSpec API
+BuildRequires:  yast2 >= 4.4.21
 BuildRequires:  yast2-devtools >= 4.2.2
 BuildRequires:  yast2-slp >= 3.1.9
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:rspec)
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:suse-connect) >= 0.3.11
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:yast-rake) >= 0.2.5
-# Y2Packager::MediumType.type=
-BuildRequires:  yast2-packager >= 4.2.37
+# ProductSpec API
+BuildRequires:  yast2-packager >= 4.4.13
 BuildRequires:  yast2-update >= 3.1.36
 
-# Installation::InstallationInfo
-Requires:       yast2 >= 4.4.4
+# ProductSpec API
+Requires:       yast2 >= 4.4.21
 # "dupAllowVendorChange" option in Pkg.SetSolverFlags()
 Requires:       yast2-pkg-bindings >= 3.1.34
 # N_() method
@@ -54,8 +54,8 @@
 Requires:       SUSEConnect >= 0.2.37
 Requires:       yast2-add-on >= 3.1.8
 Requires:       yast2-slp >= 3.1.9
-# Y2Packager::MediumType
-Requires:       yast2-packager >= 4.2.27
+# ProductSpec API
+Requires:       yast2-packager >= 4.4.13
 Requires:       yast2-update >= 3.1.36
 
 # new calls in AutoinstGeneral

++++++ yast2-registration-4.4.4.tar.bz2 -> yast2-registration-4.4.5.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-registration-4.4.4/.github/workflows/ci.yml 
new/yast2-registration-4.4.5/.github/workflows/ci.yml
--- old/yast2-registration-4.4.4/.github/workflows/ci.yml       2021-10-12 
14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/.github/workflows/ci.yml       2021-11-15 
15:53:38.000000000 +0100
@@ -10,7 +10,6 @@
     runs-on: ubuntu-latest
     container:
       image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
-      options: --privileged
 
     steps:
 
@@ -37,7 +36,6 @@
     runs-on: ubuntu-latest
     container:
       image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
-      options: --privileged
 
     steps:
 
@@ -51,7 +49,6 @@
     runs-on: ubuntu-latest
     container:
       image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
-      options: --privileged
 
     steps:
 
@@ -65,7 +62,6 @@
     runs-on: ubuntu-latest
     container:
       image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
-      options: --privileged
 
     steps:
 
@@ -81,7 +77,6 @@
     runs-on: ubuntu-latest
     container:
       image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
-      options: --privileged
 
     steps:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/package/yast2-registration.changes 
new/yast2-registration-4.4.5/package/yast2-registration.changes
--- old/yast2-registration-4.4.4/package/yast2-registration.changes     
2021-10-12 14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/package/yast2-registration.changes     
2021-11-15 15:53:38.000000000 +0100
@@ -1,3 +1,11 @@
+-------------------------------------------------------------------
+Fri Nov 12 14:51:45 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Adapt to the ProductSpec API (bsc#1192626).
+- Report properly that no product is selected in autoinstallation
+  instead of nil crash (bsc#1188211, Josef Reidinger
+  <jreidin...@suse.com>).
+- 4.4.5
 
 -------------------------------------------------------------------
 Tue Oct 12 08:30:59 UTC 2021 - Ladislav Slez??k <lsle...@suse.cz>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/package/yast2-registration.spec 
new/yast2-registration-4.4.5/package/yast2-registration.spec
--- old/yast2-registration-4.4.4/package/yast2-registration.spec        
2021-10-12 14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/package/yast2-registration.spec        
2021-11-15 15:53:38.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-registration
-Version:        4.4.4
+Version:        4.4.5
 Release:        0
 Summary:        YaST2 - Registration Module
 License:        GPL-2.0-only
@@ -27,19 +27,19 @@
 Source0:        %{name}-%{version}.tar.bz2
 
 BuildRequires:  update-desktop-files
-# Installation::InstallationInfo
-BuildRequires:  yast2 >= 4.4.4
+# ProductSpec API
+BuildRequires:  yast2 >= 4.4.21
 BuildRequires:  yast2-devtools >= 4.2.2
 BuildRequires:  yast2-slp >= 3.1.9
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:rspec)
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:suse-connect) >= 0.3.11
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:yast-rake) >= 0.2.5
-# Y2Packager::MediumType.type=
-BuildRequires:  yast2-packager >= 4.2.37
+# ProductSpec API
+BuildRequires:  yast2-packager >= 4.4.13
 BuildRequires:  yast2-update >= 3.1.36
 
-# Installation::InstallationInfo
-Requires:       yast2 >= 4.4.4
+# ProductSpec API
+Requires:       yast2 >= 4.4.21
 # "dupAllowVendorChange" option in Pkg.SetSolverFlags()
 Requires:       yast2-pkg-bindings >= 3.1.34
 # N_() method
@@ -54,8 +54,8 @@
 Requires:       SUSEConnect >= 0.2.37
 Requires:       yast2-add-on >= 3.1.8
 Requires:       yast2-slp >= 3.1.9
-# Y2Packager::MediumType
-Requires:       yast2-packager >= 4.2.27
+# ProductSpec API
+Requires:       yast2-packager >= 4.4.13
 Requires:       yast2-update >= 3.1.36
 
 # new calls in AutoinstGeneral
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/src/lib/registration/autoyast_addons.rb 
new/yast2-registration-4.4.5/src/lib/registration/autoyast_addons.rb
--- old/yast2-registration-4.4.4/src/lib/registration/autoyast_addons.rb        
2021-10-12 14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/src/lib/registration/autoyast_addons.rb        
2021-11-15 15:53:38.000000000 +0100
@@ -12,11 +12,11 @@
 #
 
 require "yast"
-require "y2packager/product_control_product"
 
 module Registration
   # This class handles the AutoYaST addons
   class AutoyastAddons
+    include Yast::Logger
     include Yast::I18n
 
     attr_accessor :requested_addons, :selected_addons
@@ -68,9 +68,7 @@
       # select the requested addons from the AY profile
       requested_addons.each do |addon|
         # Set architecture if it is not defined in the requested addon
-        requested_arch = addon["arch"] ||
-          Y2Packager::ProductControlProduct::REG_ARCH[Yast::Arch.architecture] 
||
-          Yast::Arch.architecture
+        requested_arch = addon["arch"] || Yast::Arch.rpm_arch
 
         log.info("Select addon: #{addon.inspect}")
         server_addons = all_addons.select do |a|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/src/lib/registration/clients/inst_scc.rb 
new/yast2-registration-4.4.5/src/lib/registration/clients/inst_scc.rb
--- old/yast2-registration-4.4.4/src/lib/registration/clients/inst_scc.rb       
2021-10-12 14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/src/lib/registration/clients/inst_scc.rb       
2021-11-15 15:53:38.000000000 +0100
@@ -55,11 +55,6 @@
     CONTACTING_MESSAGE = N_("Contacting the Registration Server")
 
     def main
-      if Y2Packager::MediumType.skip_step?
-        log.info "Skipping the client on the #{Y2Packager::MediumType.type} 
medium"
-        return :auto
-      end
-
       textdomain "registration"
       import_modules
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/src/lib/registration/clients/scc_auto.rb 
new/yast2-registration-4.4.5/src/lib/registration/clients/scc_auto.rb
--- old/yast2-registration-4.4.4/src/lib/registration/clients/scc_auto.rb       
2021-10-12 14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/src/lib/registration/clients/scc_auto.rb       
2021-11-15 15:53:38.000000000 +0100
@@ -38,7 +38,7 @@
 require "registration/ui/autoyast_config_workflow"
 require "registration/ui/offline_migration_workflow"
 require "registration/erb_renderer.rb"
-require "y2packager/product_control_product"
+require "y2packager/product_spec"
 require "y2packager/medium_type"
 
 Yast.import "UI"
@@ -198,20 +198,15 @@
         # import the GPG keys before refreshing the repositories
         Yast::Packages.ImportGPGKeys
 
-        products = Y2Packager::ProductControlProduct.products
+        products = Y2Packager::ProductSpec.base_products
 
         # Lazy load it as registration does not depend on ay, but scc_auto is 
run only in ay context
         Yast.import "AutoinstFunctions"
 
         selected_product = Yast::AutoinstFunctions.selected_product
         log.info "selected product #{selected_product.inspect}"
-        ay_product = if selected_product.respond_to?(:name)
-          selected_product.name
-        else
-          selected_product.details.product
-        end
 
-        if !ay_product
+        if !selected_product
           # TRANSLATORS: error message, %s is the XML path, e.g. 
"software/products"
           Yast::Report.Error(
             _("Missing product specification in the %s section") % 
"software/products"
@@ -219,6 +214,7 @@
           return false
         end
 
+        ay_product = selected_product.name
         control_product = products.find { |p| p.name == ay_product }
 
         if !control_product
@@ -228,7 +224,7 @@
         end
 
         # mark the control file product as selected
-        Y2Packager::ProductControlProduct.selected = control_product
+        control_product.select
 
         true
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/src/lib/registration/controllers/package_search.rb 
new/yast2-registration-4.4.5/src/lib/registration/controllers/package_search.rb
--- 
old/yast2-registration-4.4.4/src/lib/registration/controllers/package_search.rb 
    2021-10-12 14:54:06.000000000 +0200
+++ 
new/yast2-registration-4.4.5/src/lib/registration/controllers/package_search.rb 
    2021-11-15 15:53:38.000000000 +0100
@@ -27,6 +27,7 @@
   module Controllers
     # Implements the actions and keeps the state for the package search feature
     class PackageSearch
+      include Yast::Logger
       include Yast::I18n
 
       # @return [Array<RemotePackage>] List of selected packages
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/src/lib/registration/ssl_certificate.rb 
new/yast2-registration-4.4.5/src/lib/registration/ssl_certificate.rb
--- old/yast2-registration-4.4.4/src/lib/registration/ssl_certificate.rb        
2021-10-12 14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/src/lib/registration/ssl_certificate.rb        
2021-11-15 15:53:38.000000000 +0100
@@ -9,6 +9,8 @@
   # class handling SSL certificate
   # TODO: move it to yast2 to share it?
   class SslCertificate
+    include Yast::Logger
+
     Yast.import "Stage"
 
     # Path to the registration certificate in the instsys
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/src/lib/registration/sw_mgmt.rb 
new/yast2-registration-4.4.5/src/lib/registration/sw_mgmt.rb
--- old/yast2-registration-4.4.4/src/lib/registration/sw_mgmt.rb        
2021-10-12 14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/src/lib/registration/sw_mgmt.rb        
2021-11-15 15:53:38.000000000 +0100
@@ -34,7 +34,7 @@
 
 require "packager/product_patterns"
 require "y2packager/medium_type"
-require "y2packager/product_control_product"
+require "y2packager/product_spec"
 require "y2packager/product_reader"
 require "yast2/execute"
 require "y2packager/resolvable"
@@ -134,12 +134,9 @@
     # given self_update_id is empty or there is no base product available
     def self.installer_update_base_product(self_update_id)
       return if self_update_id.empty?
+
       # TODO: does offline makes sense for self update?
-      base_product = if Y2Packager::MediumType.online? || 
Y2Packager::MediumType.offline?
-        Y2Packager::ProductControlProduct.products.first
-      else
-        Y2Packager::Product.available_base_products.first
-      end
+      base_product = Y2Packager::ProductSpec.base_products.first
       return unless base_product
 
       # filter out not needed data
@@ -174,13 +171,13 @@
     # @return [Hash] The product
     def self.online_base_product
       if Mode.update
-        prods = Y2Packager::ProductControlProduct.products
+        prods = Y2Packager::ProductSpec.base_products
         installed_names = installed_products.map { |p| p["name"] }
         prod = prods.find { |p| installed_names.include?(p.name) }
         log.info "selecting product from control #{prod}"
         raise "No base product selected from control.xml matching installed 
products!" unless prod
       else
-        prod = Y2Packager::ProductControlProduct.selected
+        prod = Y2Packager::ProductSpec.selected_base
         raise "No base product selected from control.xml!" unless prod
       end
 
@@ -319,9 +316,9 @@
       )
     end
 
-    # remove relase string from version. E.g.: "15-0" --> "15"
-    # @param product [Y2Packager::Product] product
-    # @return [String] version
+    # remove relase string from version. E.g.: "15.3-0" --> "15.3"
+    # @param product [Y2Packager::ProductSpec] Product specification
+    # @return [String] version withouth the "release" part
     def self.version_without_release(product)
       pkg_product = Y2Packager::Resolvable.find(kind: :product,
         name: product.name, version: product.version).first
@@ -737,7 +734,7 @@
     # @return [String] target distribution name or empty string if not found
     def self.target_distribution(destdir)
       if Y2Packager::MediumType.online?
-        control_products = Y2Packager::ProductControlProduct.products
+        control_products = Y2Packager::ProductSpec.base_products
 
         target_distro = if control_products.empty?
           ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/src/lib/registration/ui/migration_repos_workflow.rb
 
new/yast2-registration-4.4.5/src/lib/registration/ui/migration_repos_workflow.rb
--- 
old/yast2-registration-4.4.4/src/lib/registration/ui/migration_repos_workflow.rb
    2021-10-12 14:54:06.000000000 +0200
+++ 
new/yast2-registration-4.4.5/src/lib/registration/ui/migration_repos_workflow.rb
    2021-11-15 15:53:38.000000000 +0100
@@ -17,9 +17,10 @@
 require "yast"
 require "yast2/popup"
 require "y2packager/medium_type"
-require "y2packager/product_location"
+require "y2packager/product_spec"
 require "y2packager/product_upgrade"
 require "y2packager/resolvable"
+require "y2packager/repo_product_spec"
 
 require "registration/registration"
 require "registration/registration_ui"
@@ -671,23 +672,21 @@
           return
         end
 
-        new_product = new_base.details && new_base.details.product
-        log.info("Upgrading product #{installed_base.name.inspect} to 
#{new_product.inspect}")
+        log.info("Upgrading product #{installed_base.name.inspect} to 
#{new_base.inspect}")
 
-        add_full_medium_repository(new_product, new_base.dir)
+        add_full_medium_repository(new_base.name, new_base.dir)
       end
 
       #
-      # Scan the installation repository and return the found product 
directories.
+      # Scan the installation repository and return the found products
       #
-      # @return [Array<Y2Packager::ProductLocation>] the found product 
directories
+      # This method is called during offline installation, so it is expected 
to return
+      # RepoProductSpec objects only.
+      #
+      # @return [Array<Y2Packager::RepoProductSpec>] the products found in the 
offline medium
       def full_medium_products
-        # in offline upgrade add the repository with the selected base product
-        # FIXME: similar to clients/inst_complex_welcome.rb and 
widgets/product_selector.rb
-        url = Yast::InstURL.installInf2Url("")
-        products = Y2Packager::ProductLocation
-                   .scan(url)
-                   .select { |p| p.details && p.details.base }
+        products = Y2Packager::ProductSpec.base_products
+                                          .select { |p| 
p.is_a?(Y2Packager::RepoProductSpec) }
         log.info("Found base products on the offline medium: 
#{products.pretty_inspect}")
         products
       end
@@ -697,7 +696,7 @@
       # base product.
       #
       # @param installed_base [<Y2Packager::Resolvable>] the installed base 
product
-      # @return [Y2Packager::ProductLocation, nil] The location of the new 
base product on
+      # @return [Y2Packager::ProductSpec, nil] The location of the new base 
product on
       #  the Full installation medium, nil if no suitable upgrade product is 
found
       def full_medium_upgrade_product(installed_base)
         new_base = nil
@@ -709,13 +708,13 @@
         # key in the mapping: list of installed products, value: the new base 
product
         Y2Packager::ProductUpgrade::MAPPING.each do |k, v|
           if (k - installed_names).empty?
-            new_base = base_products.find { |p| p.details && p.details.product 
== v }
+            new_base = base_products.find { |p| p.name == v }
           end
         end
 
         # if no product rename was found then use the 1:1 upgrade
         new_base ||= base_products.find do |p|
-          p.details && p.details.product == installed_base.name
+          p.name == installed_base.name
         end
 
         log.info("Found upgrade product on the full medium: #{new_base}")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/src/lib/registration/widgets/registration_code.rb 
new/yast2-registration-4.4.5/src/lib/registration/widgets/registration_code.rb
--- 
old/yast2-registration-4.4.4/src/lib/registration/widgets/registration_code.rb  
    2021-10-12 14:54:06.000000000 +0200
+++ 
new/yast2-registration-4.4.5/src/lib/registration/widgets/registration_code.rb  
    2021-11-15 15:53:38.000000000 +0100
@@ -28,6 +28,8 @@
 module Registration
   module Widgets
     class RegistrationCode < CWM::InputField
+      include Yast::Logger
+
       VALID_URL_SCHEMES = ["http", "https"].freeze
 
       def initialize
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/test/migration_repos_workflow_spec.rb 
new/yast2-registration-4.4.5/test/migration_repos_workflow_spec.rb
--- old/yast2-registration-4.4.4/test/migration_repos_workflow_spec.rb  
2021-10-12 14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/test/migration_repos_workflow_spec.rb  
2021-11-15 15:53:38.000000000 +0100
@@ -21,6 +21,11 @@
       allow(Y2Packager::MediumType).to receive(:offline?).and_return(false)
       allow(Y2Packager::MediumType).to receive(:online?).and_return(false)
       allow(Yast::Report).to receive(:Error)
+      allow(Y2Packager::ProductSpec).to 
receive(:base_products).and_return([new_product])
+    end
+
+    let(:new_product) do
+      instance_double(Y2Packager::RepoProductSpec, name: "openSUSE", dir: 
"/Leap")
     end
 
     shared_examples "media based upgrade" do |popup_method|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.4/test/registration/clients/scc_auto_test.rb 
new/yast2-registration-4.4.5/test/registration/clients/scc_auto_test.rb
--- old/yast2-registration-4.4.4/test/registration/clients/scc_auto_test.rb     
2021-10-12 14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/test/registration/clients/scc_auto_test.rb     
2021-11-15 15:53:38.000000000 +0100
@@ -88,7 +88,7 @@
   describe "#write" do
     before do
       Y2Packager::MediumType.type = :online
-      allow(Y2Packager::ProductControlProduct).to 
receive(:products).and_return("SLES")
+      allow(Y2Packager::ProductSpec).to receive(:base_products).and_return([])
       # clean cache
       ::Registration::Storage::Cache.instance.addon_services = []
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-registration-4.4.4/test/sw_mgmt_spec.rb 
new/yast2-registration-4.4.5/test/sw_mgmt_spec.rb
--- old/yast2-registration-4.4.4/test/sw_mgmt_spec.rb   2021-10-12 
14:54:06.000000000 +0200
+++ new/yast2-registration-4.4.5/test/sw_mgmt_spec.rb   2021-11-15 
15:53:38.000000000 +0100
@@ -3,6 +3,9 @@
 require_relative "spec_helper"
 require "yaml"
 
+require "y2packager/product_spec"
+require "y2packager/control_product_spec"
+
 describe Registration::SwMgmt do
   subject { Registration::SwMgmt }
 
@@ -121,12 +124,12 @@
 
   describe ".installer_update_base_product" do
     let(:base_product) do
-      instance_double(Y2Packager::Product, name: "dummy", version: "15.0", 
arch: "x86_64")
+      instance_double(Y2Packager::ProductSpec, name: "dummy", version: "15.0", 
arch: "x86_64")
     end
-    let(:available_products) { [base_product] }
+    let(:base_products) { [base_product] }
 
     before do
-      allow(Y2Packager::Product).to 
receive(:available_base_products).and_return(available_products)
+      allow(Y2Packager::ProductSpec).to 
receive(:base_products).and_return(base_products)
       allow(Y2Packager::MediumType).to receive(:online?).and_return(false)
       allow(Y2Packager::MediumType).to receive(:offline?).and_return(false)
     end
@@ -136,10 +139,10 @@
     end
 
     context "when there is no base product available" do
-      let(:available_products) { [] }
+      let(:base_products) { [] }
 
       it "returns nil" do
-        allow(Y2Packager::Product).to 
receive(:available_base_products).and_return([])
+        allow(Y2Packager::ProductSpec).to 
receive(:base_products).and_return([])
         expect(subject.installer_update_base_product("self_update_id")).to 
eq(nil)
       end
     end
@@ -553,17 +556,17 @@
             "version_version" => "15.2"
           }
 
-        selected = Y2Packager::ProductControlProduct.new(
+        selected = Y2Packager::ControlProductSpec.new(
           arch:            data["arch"],
-          label:           data["display_name"],
+          display_name:    data["display_name"],
           license_url:     "",
           name:            data["name"],
           register_target: data["register_target"],
-          version:         data["version_version"]
+          version:         data["version_version"],
+          order:           1
         )
 
-        expect(Y2Packager::ProductControlProduct).to receive(:selected)
-          .and_return(selected)
+        expect(Y2Packager::ProductSpec).to 
receive(:selected_base).and_return(selected)
         expect(subject.find_base_product["name"]).to eq(data["name"])
       end
     end

Reply via email to