Hello community,

here is the log from the commit of package yast2-packager for openSUSE:Factory 
checked in at 2014-07-15 16:25:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-packager.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-packager"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes    
2014-06-26 08:00:53.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes       
2014-07-15 16:26:01.000000000 +0200
@@ -1,0 +2,31 @@
+Fri Jul 11 12:29:40 UTC 2014 - [email protected]
+
+- fixed finding product upgrades (bnc#886621)
+- 3.1.30
+
+-------------------------------------------------------------------
+Thu Jul 10 15:22:01 UTC 2014 - [email protected]
+
+- select "fips" pattern if installation is booted with "fips=1"
+  parameter (bnc#886582)
+- 3.1.29
+
+-------------------------------------------------------------------
+Wed Jul  9 10:01:11 CEST 2014 - [email protected]
+
+- Setting default desktop in autoyast too. (bnc#886367)
+- 3.1.28
+
+-------------------------------------------------------------------
+Fri Jul  4 12:09:55 UTC 2014 - [email protected]
+
+- make product renames updatable from SCC (related to bnc#883206)
+- 3.1.27
+
+-------------------------------------------------------------------
+Fri Jun 27 12:00:38 UTC 2014 - [email protected]
+
+- updated known product renames (bnc#883047)
+- 3.1.26
+
+-------------------------------------------------------------------

Old:
----
  yast2-packager-3.1.25.tar.bz2

New:
----
  yast2-packager-3.1.30.tar.bz2

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

Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.4ceWBl/_old  2014-07-15 16:26:02.000000000 +0200
+++ /var/tmp/diff_new_pack.4ceWBl/_new  2014-07-15 16:26:02.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        3.1.25
+Version:        3.1.30
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-packager-3.1.25.tar.bz2 -> yast2-packager-3.1.30.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.1.25/package/yast2-packager.changes 
new/yast2-packager-3.1.30/package/yast2-packager.changes
--- old/yast2-packager-3.1.25/package/yast2-packager.changes    2014-06-25 
15:34:23.000000000 +0200
+++ new/yast2-packager-3.1.30/package/yast2-packager.changes    2014-07-11 
14:34:33.000000000 +0200
@@ -1,4 +1,35 @@
 -------------------------------------------------------------------
+Fri Jul 11 12:29:40 UTC 2014 - [email protected]
+
+- fixed finding product upgrades (bnc#886621)
+- 3.1.30
+
+-------------------------------------------------------------------
+Thu Jul 10 15:22:01 UTC 2014 - [email protected]
+
+- select "fips" pattern if installation is booted with "fips=1"
+  parameter (bnc#886582)
+- 3.1.29
+
+-------------------------------------------------------------------
+Wed Jul  9 10:01:11 CEST 2014 - [email protected]
+
+- Setting default desktop in autoyast too. (bnc#886367)
+- 3.1.28
+
+-------------------------------------------------------------------
+Fri Jul  4 12:09:55 UTC 2014 - [email protected]
+
+- make product renames updatable from SCC (related to bnc#883206)
+- 3.1.27
+
+-------------------------------------------------------------------
+Fri Jun 27 12:00:38 UTC 2014 - [email protected]
+
+- updated known product renames (bnc#883047)
+- 3.1.26
+
+-------------------------------------------------------------------
 Wed Jun 25 13:18:20 UTC 2014 - [email protected]
 
 - colorize the product removal warning using HTML.Colorize method
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.1.25/package/yast2-packager.spec 
new/yast2-packager-3.1.30/package/yast2-packager.spec
--- old/yast2-packager-3.1.25/package/yast2-packager.spec       2014-06-25 
15:34:23.000000000 +0200
+++ new/yast2-packager-3.1.30/package/yast2-packager.spec       2014-07-11 
14:34:33.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        3.1.25
+Version:        3.1.30
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.1.25/src/modules/AddOnProduct.rb 
new/yast2-packager-3.1.30/src/modules/AddOnProduct.rb
--- old/yast2-packager-3.1.25/src/modules/AddOnProduct.rb       2014-06-25 
15:34:23.000000000 +0200
+++ new/yast2-packager-3.1.30/src/modules/AddOnProduct.rb       2014-07-11 
14:34:33.000000000 +0200
@@ -16,6 +16,8 @@
 
 module Yast
   class AddOnProductClass < Module
+    include Yast::Logger
+
     def main
       Yast.import "UI"
       Yast.import "Pkg"
@@ -125,6 +127,18 @@
       #        ]
       #      ]
       @patterns_preselected_by_addon = {}
+
+      # product renames needed for detecting the product update
+      # this mapping can be updated by SCC registration server,
+      # this is the static default for offline updates
+      # mapping: <old_name> => [ <new_name> ]
+      @product_renames = {
+        "SUSE_SLES"  => [ "SLES" ],
+        # SLED or Workstation extension
+        "SUSE_SLED"  => [ "SLED", "sle-we" ],
+        "sle-haegeo" => [ "sle-ha-geo" ]
+      }
+
     end
 
     # Downloads a requested file, caches it and returns path to that cached 
file.
@@ -872,7 +886,9 @@
       # or check the content file
       if WorkflowManager.WorkflowRequiresRegistration(src_id) || 
Builtins.contains(@addons_requesting_registration, src_id)
         Builtins.y2milestone("Repository ID %1 requests registration", src_id)
-        WFM.CallFunction("inst_suse_register", [])
+        # TODO FIXME: user needs to manually select the addon to register,
+        # pass the addon so it could be pre-selected
+        WFM.CallFunction("inst_scc", [])
       else
         Builtins.y2milestone(
           "Repository ID %1 doesn't need registration",
@@ -2161,6 +2177,19 @@
       nil
     end
 
+    def renamed?(old_name, new_name)
+      @product_renames[old_name] && 
@product_renames[old_name].include?(new_name)
+    end
+
+    def add_rename(old_name, new_name)
+      # already known
+      return if renamed?(old_name, new_name)
+
+      log.info "Adding product rename: '#{old_name}' => '#{new_name}'"
+      @product_renames[old_name] = [] unless @product_renames[old_name]
+      @product_renames[old_name] << new_name
+    end
+
     publish :variable => :add_on_products, :type => "list <map <string, any>>"
     publish :variable => :src_id, :type => "integer"
     publish :variable => :last_ret, :type => "symbol"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.1.25/src/modules/DefaultDesktop.rb 
new/yast2-packager-3.1.30/src/modules/DefaultDesktop.rb
--- old/yast2-packager-3.1.25/src/modules/DefaultDesktop.rb     2014-06-25 
15:34:23.000000000 +0200
+++ new/yast2-packager-3.1.30/src/modules/DefaultDesktop.rb     2014-07-11 
14:34:33.000000000 +0200
@@ -56,7 +56,7 @@
 
     # Initialize default desktop from control file if specified there
     def Init
-      if @initialized == true || Mode.autoinst
+      if @initialized == true
         Builtins.y2debug("Already initialized")
         return
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.1.25/src/modules/Packages.rb 
new/yast2-packager-3.1.30/src/modules/Packages.rb
--- old/yast2-packager-3.1.25/src/modules/Packages.rb   2014-06-25 
15:34:23.000000000 +0200
+++ new/yast2-packager-3.1.30/src/modules/Packages.rb   2014-07-11 
14:34:33.000000000 +0200
@@ -17,13 +17,6 @@
     # All known types of resolvables
     RESOLVABLE_TYPES = [:product, :patch, :package, :pattern, :language]
 
-    # product renames needed for detecting the product update
-    # <old_name> => <new_name>
-    PRODUCT_RENAMES = {
-      "SUSE_SLES" => "SLES",
-      "SUSE_SLED" => "SLED",
-    }
-
     def main
       Yast.import "UI"
       Yast.import "Pkg"
@@ -200,7 +193,7 @@
 
       Builtins.foreach(media_sizes) { |inst_sizes| 
Builtins.foreach(inst_sizes) do |inst_size|
         sz = Ops.add(sz, inst_size)
-      end } 
+      end }
 
 
       Builtins.y2milestone(
@@ -249,7 +242,7 @@
           Builtins.y2milestone("Found remote repository %1: %2", repo, url)
           remote_repos = Builtins.add(remote_repos, repo)
         end
-      end 
+      end
 
 
       # shortcut, no remote repository found
@@ -272,7 +265,7 @@
         Builtins.foreach(repo_media_sizes) do |media_size|
           ret = Ops.add(ret, media_size)
         end
-      end 
+      end
 
 
       Builtins.y2milestone(
@@ -582,7 +575,7 @@
             Ops.set(summary, "warning_level", :warning)
           end
         end
-      end 
+      end
 
 
       Builtins.y2milestone("Proposal summary: %1", summary)
@@ -637,7 +630,7 @@
               partition
             )
             warning = Ops.add(warning, w)
-          end 
+          end
 
 
           if warning != ""
@@ -1104,6 +1097,15 @@
         end
       end
 
+      # select FIPS pattern
+      if (Linuxrc.InstallInf("Cmdline") || "").split.include?("fips=1")
+        fips_pattern = "fips"
+        if !Pkg.ResolvableProperties(fips_pattern, :pattern, "").empty?
+          log.info "fips=1 boot option detected, adding '#{fips_pattern}' 
pattern"
+          pattern_list << fips_pattern
+        end
+      end
+
       # FATE #302116
       # BNC #431580
       required_patterns = PackagesProposal.GetAllResolvables(:pattern)
@@ -1498,7 +1500,7 @@
       # bnc #432668
       # Do not call init
       if Mode.live_installation
-        Builtins.y2milestone("live_installation, not calling Init") 
+        Builtins.y2milestone("live_installation, not calling Init")
         # bnc #427935
         # Initialize the base_source_id first
       else
@@ -1800,7 +1802,7 @@
           sources_set = Builtins.add(sources_set, one_source)
         end
 
-        return Pkg.SourceEditSet(sources_set) 
+        return Pkg.SourceEditSet(sources_set)
         # Bad luck, nothing useful found
       else
         Builtins.y2warning("No name found")
@@ -2658,7 +2660,8 @@
           removed_name = removed_product["name"]
 
           # check the current product names or product renames
-          removed_name == installed_name || PRODUCT_RENAMES[removed_name] == 
installed_name
+          removed_name == installed_name ||
+            AddOnProduct.renamed?(removed_name, installed_name)
         end
 
         updated_products[removed] = installed_product if removed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.1.25/test/Makefile.am 
new/yast2-packager-3.1.30/test/Makefile.am
--- old/yast2-packager-3.1.25/test/Makefile.am  2014-06-25 15:34:23.000000000 
+0200
+++ new/yast2-packager-3.1.30/test/Makefile.am  2014-07-11 14:34:33.000000000 
+0200
@@ -1,4 +1,5 @@
 TESTS = \
+  addon_product_test.rb \
   packages_test.rb
 
 TEST_EXTENSIONS = .rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.1.25/test/addon_product_test.rb 
new/yast2-packager-3.1.30/test/addon_product_test.rb
--- old/yast2-packager-3.1.25/test/addon_product_test.rb        1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-packager-3.1.30/test/addon_product_test.rb        2014-07-11 
14:34:33.000000000 +0200
@@ -0,0 +1,35 @@
+#! /usr/bin/env rspec
+
+require_relative "./test_helper"
+
+Yast.import "AddOnProduct"
+
+describe Yast::AddOnProduct do
+  describe "#renamed?" do
+    it "returns true if product has been renamed" do
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLES", "SLES")).to be_true
+    end
+
+    it "returns false if the product rename is not known" do
+      expect(Yast::AddOnProduct.renamed?("foo", "bar")).to be_false
+    end
+  end
+
+  describe "#add_rename" do
+    it "adds a new product rename" do
+      expect(Yast::AddOnProduct.renamed?("FOO", "BAR")).to be_false
+      Yast::AddOnProduct.add_rename("FOO", "BAR")
+      expect(Yast::AddOnProduct.renamed?("FOO", "BAR")).to be_true
+    end
+
+    it "keeps the existing renames" do
+      # add new rename
+      Yast::AddOnProduct.add_rename("SUSE_SLES", "SLES_NEW")
+      # check the new rename
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLES", "SLES_NEW")).to be_true
+      # check the already known rename
+      expect(Yast::AddOnProduct.renamed?("SUSE_SLES", "SLES")).to be_true
+    end
+  end
+
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-packager-3.1.25/test/data/zypp/products_update2.yml 
new/yast2-packager-3.1.30/test/data/zypp/products_update2.yml
--- old/yast2-packager-3.1.25/test/data/zypp/products_update2.yml       
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-packager-3.1.30/test/data/zypp/products_update2.yml       
2014-07-11 14:34:33.000000000 +0200
@@ -0,0 +1,235 @@
+---
+- arch: x86_64
+  category: addon
+  description: |-
+    SUSE Linux Enterprise offers a comprehensive
+            suite of products built on a single code base.
+            The platform addresses business needs from
+            the smallest thin-client devices to the world's
+            most powerful high-performance computing
+            and mainframe servers. SUSE Linux Enterprise
+            offers common management tools and technology
+            certifications across the platform, and
+            each product is enterprise-class.
+  display_name: SUSE Linux Enterprise Server 12 (RC1)
+  download_size: 0
+  eol: 1420070400
+  flags: []
+  flavor: DVD
+  inst_size: 0
+  license: "SUSE(R) End User License Agreement"
+  license_confirmed: false
+  locked: false
+  medium_nr: 0
+  name: SLES
+  product_file: SLES.prod
+  product_package: sles-release
+  register_release: ''
+  register_target: sle-12-x86_64
+  relnotes_url: 
https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/release-notes-sles.rpm
+  relnotes_urls:
+  - 
https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/release-notes-sles.rpm
+  short_name: SLES12
+  source: 0
+  status: :selected
+  summary: SUSE Linux Enterprise Server 12 (RC1)
+  transact_by: :app_high
+  type: addon
+  update_urls: []
+  vendor: SUSE LLC <https://www.suse.com/>
+  version: 12-0
+- arch: x86_64
+  category: addon
+  description: |-
+    SUSE Linux Enterprise offers a comprehensive
+            suite of products built on a single code base.
+            The platform addresses business needs from
+            the smallest thin-client devices to the world's
+            most powerful high-performance computing
+            and mainframe servers. SUSE Linux Enterprise
+            offers common management tools and technology
+            certifications across the platform, and
+            each product is enterprise-class.
+  display_name: SUSE Linux Enterprise Server 12 (Beta9)
+  download_size: 0
+  eol: 1420070400
+  flags: []
+  flavor: DVD
+  inst_size: 0
+  locked: false
+  medium_nr: 0
+  name: SLES
+  product_file: SLES.prod
+  product_package: sles-release
+  register_release: ''
+  register_target: sle-12-x86_64
+  relnotes_url: 
https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/release-notes-sles.rpm
+  relnotes_urls:
+  - 
https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/release-notes-sles.rpm
+  short_name: SLES12
+  source: 3
+  status: :available
+  summary: SUSE Linux Enterprise Server 12 (Beta9)
+  transact_by: :solver
+  type: addon
+  update_urls: []
+  vendor: SUSE LLC <https://www.suse.com/>
+  version: 12-0
+- arch: x86_64
+  category: addon
+  description: SUSE Linux Enterprise High Availability Extension.
+  display_name: SUSE Linux Enterprise High Availability Extension 11 SP3
+  download_size: 0
+  flags: []
+  flavor: ''
+  inst_size: 0
+  locked: false
+  medium_nr: 0
+  name: sle-hae
+  product_file: "/mnt/etc/products.d/sle-hae.prod"
+  register_release: ''
+  register_target: sle-11-x86_64
+  relnotes_url: 
https://www.suse.com/releasenotes/x86_64/SLE-HA/11-SP3/release-notes-hae.rpm
+  relnotes_urls:
+  - 
https://www.suse.com/releasenotes/x86_64/SLE-HA/11-SP3/release-notes-hae.rpm
+  short_name: sle-hae
+  source: -1
+  status: :removed
+  summary: SUSE Linux Enterprise High Availability Extension 11 SP3
+  transact_by: :solver
+  type: addon
+  update_urls: []
+  upgrades: []
+  vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
+  version: 11.3-1.69
+- arch: x86_64
+  category: addon
+  description: SUSE Linux Enterprise High Availability Extension.
+  display_name: SUSE Linux Enterprise High Availability Extension 12 (RC1)
+  download_size: 0
+  eol: 1420070400
+  flags: []
+  flavor: cd
+  inst_size: 0
+  license: "SUSE(R) End User License Agreement"
+  license_confirmed: false
+  locked: false
+  medium_nr: 0
+  name: sle-hae
+  product_file: sle-hae.prod
+  product_package: sle-hae-release
+  register_release: ''
+  register_target: sle-12-x86_64
+  relnotes_url: 
https://www.suse.com/releasenotes/x86_64/SLE-HA/12/release-notes-hae.rpm
+  relnotes_urls:
+  - https://www.suse.com/releasenotes/x86_64/SLE-HA/12/release-notes-hae.rpm
+  short_name: SLEHA-12
+  source: 7
+  status: :selected
+  summary: SUSE Linux Enterprise High Availability Extension 12 (RC1)
+  transact_by: :app_high
+  type: addon
+  update_urls: []
+  vendor: SUSE LLC <https://www.suse.com/>
+  version: 12-0
+- arch: x86_64
+  category: addon
+  description: This is the SUSE Linux Enterprise Software Development Kit
+  display_name: SUSE Linux Enterprise Software Development Kit 11 SP3
+  download_size: 0
+  flags: []
+  flavor: ''
+  inst_size: 0
+  locked: false
+  medium_nr: 0
+  name: sle-sdk
+  product_file: "/mnt/etc/products.d/sle-sdk.prod"
+  register_release: ''
+  register_target: sle-11-x86_64
+  relnotes_url: ''
+  short_name: sle-sdk
+  source: -1
+  status: :removed
+  summary: SUSE Linux Enterprise Software Development Kit 11 SP3
+  transact_by: :solver
+  type: addon
+  update_urls: []
+  upgrades: []
+  vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
+  version: 11.3-1.69
+- arch: x86_64
+  category: addon
+  description: "<p>\n\tSUSE Linux Enterprise Software Development Kit 12 is 
the Software\n\tDevelopment
+    Kit for the family of SUSE Linux Enterprise products. It is a\n\tfree of 
charge
+    extension for partners and customers working with SUSE\n\tLinux Enterprise 
Server
+    and Desktop and derived products.\n\t</p>\n\t<p>\n\tPackages on the SDK 
are delivered
+    without L3 support; maintenance updates\n\twill be done for  critical 
security
+    and critical non-security issues, and\n\twhere needed to remain in sync 
with packages
+    delivered in the SUSE Linux\n\tEnterprise Server and Desktop 
products.\n\t</p>\n\t<p>\n\tPackages
+    to rebuild SUSE Linux Enterprise Server are not part of the SUSE\n\tLinux 
Enterprise
+    Software Development Kit.\n\t</p>"
+  display_name: SUSE Linux Enterprise Software Development Kit 12
+  download_size: 0
+  eol: 1420070400
+  flags: []
+  flavor: DVD
+  inst_size: 0
+  locked: false
+  medium_nr: 0
+  name: sle-sdk
+  product_file: sle-sdk.prod
+  product_package: sle-sdk-release
+  register_release: ''
+  register_target: sle-12-x86_64
+  relnotes_url: 
https://www.suse.com/releasenotes/x86_64/SLE-SDK/12/release-notes-sdk.rpm
+  relnotes_urls:
+  - https://www.suse.com/releasenotes/x86_64/SLE-SDK/12/release-notes-sdk.rpm
+  short_name: SDK12
+  source: 5
+  status: :selected
+  summary: SUSE Linux Enterprise Software Development Kit 12
+  transact_by: :app_high
+  type: addon
+  update_urls: []
+  vendor: SUSE LLC <https://www.suse.com/>
+  version: 12-0
+- arch: x86_64
+  category: base
+  description: |-
+    SUSE Linux Enterprise offers a comprehensive
+            suite of products built on a single code base.
+            The platform addresses business needs from
+            the smallest thin-client devices to the world’s
+            most powerful high-performance computing
+            and mainframe servers. SUSE Linux Enterprise
+            offers common management tools and technology
+            certifications across the platform, and
+            each product is enterprise-class.
+  display_name: SUSE Linux Enterprise Server 11 SP3
+  download_size: 0
+  flags: []
+  flavor: ''
+  inst_size: 0
+  locked: false
+  medium_nr: 0
+  name: SUSE_SLES
+  product_file: "/mnt/etc/products.d/SUSE_SLES.prod"
+  register_release: ''
+  register_target: sle-11-x86_64
+  register_urls:
+  - http://register.novell.com/
+  relnotes_url: 
https://www.suse.com/releasenotes/x86_64/SUSE-SLES/11-SP3/release-notes-sles.rpm
+  relnotes_urls:
+  - 
https://www.suse.com/releasenotes/x86_64/SUSE-SLES/11-SP3/release-notes-sles.rpm
+  short_name: SLES11_SP3
+  smolt_urls:
+  - http://smolt.novell.com/register.pl
+  source: -1
+  status: :removed
+  summary: SUSE Linux Enterprise Server 11 SP3
+  transact_by: :solver
+  type: base
+  update_urls: []
+  upgrades: []
+  vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
+  version: 11.3-1.138
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.1.25/test/packages_test.rb 
new/yast2-packager-3.1.30/test/packages_test.rb
--- old/yast2-packager-3.1.25/test/packages_test.rb     2014-06-25 
15:34:23.000000000 +0200
+++ new/yast2-packager-3.1.30/test/packages_test.rb     2014-07-11 
14:34:33.000000000 +0200
@@ -1,8 +1,7 @@
 #! /usr/bin/env rspec
 
-ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
+require_relative "./test_helper"
 
-require "yast"
 require "yaml"
 
 include Yast::Logger
@@ -259,6 +258,7 @@
 
   describe "#group_products_by_status" do
     let(:products) { load_zypp("products_update.yml") }
+    let(:products2) { load_zypp("products_update2.yml") }
 
     it "returns groups of the products" do
       status = Yast::Packages.group_products_by_status(products)
@@ -277,6 +277,29 @@
       expect(old_product["display_name"]).to eq("SUSE Linux Enterprise Server 
11 SP3")
       expect(new_product["display_name"]).to eq("SUSE Linux Enterprise Server 
12")
     end
+
+    it "returns updated product which has been renamed" do
+      products = [
+        { "name" => "sle-haegeo", "status" => :removed },
+        { "name" => "sle-ha-geo", "status" => :selected }
+      ]
+
+      status = Yast::Packages.group_products_by_status(products)
+
+      expect(status[:updated].size).to eq(1)
+      old_product, new_product = status[:updated].first
+      expect(old_product["name"]).to eq("sle-haegeo")
+      expect(new_product["name"]).to eq("sle-ha-geo")
+    end
+
+    it "handles mixed renamed and unchanged products" do
+      status = Yast::Packages.group_products_by_status(products2)
+
+      expect(status[:new]).to eq([])
+      expect(status[:removed]).to eq([])
+      expect(status[:kept]).to eq([])
+      expect(status[:updated]).to have(3).items
+    end
   end
 
   describe "#product_update_summary" do
@@ -306,4 +329,46 @@
     end
   end
 
+  describe "#ComputeSystemPatternList" do
+    before do
+      expect(Yast::Arch).to receive(:is_laptop).and_return(false)
+      expect(Yast::Arch).to receive(:has_pcmcia).and_return(false)
+      expect(Yast::PackagesProposal).to 
receive(:GetAllResolvables).with(:pattern).and_return([])
+    end
+
+    context "when fips pattern is available" do
+      before do
+        allow(Yast::Pkg).to receive(:ResolvableProperties).
+          with("fips", :pattern, "").and_return([{ "name" => "fips" }])
+      end
+
+      it "adds 'fips' pattern if fips=1 boot parameter is used" do
+        expect(Yast::Linuxrc).to 
receive(:InstallInf).with("Cmdline").and_return("foo fips=1 bar")
+        expect(Yast::Packages.ComputeSystemPatternList).to include("fips")
+      end
+
+      it "does not add 'fips' pattern if fips=1 boot parameter is not used" do
+        expect(Yast::Linuxrc).to 
receive(:InstallInf).with("Cmdline").and_return("foo bar")
+        expect(Yast::Packages.ComputeSystemPatternList).to_not include("fips")
+      end
+    end
+
+    context "when fips pattern is not available" do
+      before do
+        allow(Yast::Pkg).to receive(:ResolvableProperties).
+          with("fips", :pattern, "").and_return([])
+      end
+
+      it "does not add 'fips' pattern if fips=1 boot parameter is used" do
+        expect(Yast::Linuxrc).to 
receive(:InstallInf).with("Cmdline").and_return("foo fips=1 bar")
+        expect(Yast::Packages.ComputeSystemPatternList).to_not include("fips")
+      end
+
+      it "does not add 'fips' pattern if fips=1 boot parameter is not used" do
+        expect(Yast::Linuxrc).to 
receive(:InstallInf).with("Cmdline").and_return("foo bar")
+        expect(Yast::Packages.ComputeSystemPatternList).to_not include("fips")
+      end
+    end
+  end
+
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-3.1.25/test/test_helper.rb 
new/yast2-packager-3.1.30/test/test_helper.rb
--- old/yast2-packager-3.1.25/test/test_helper.rb       1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-packager-3.1.30/test/test_helper.rb       2014-07-11 
14:34:33.000000000 +0200
@@ -0,0 +1,8 @@
+ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
+
+if ENV["COVERAGE"]
+  require "simplecov"
+  SimpleCov.start
+end
+
+require "yast"

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to