Hello community,

here is the log from the commit of package yast2-kdump for openSUSE:Factory 
checked in at 2017-02-18 03:15:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-kdump (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-kdump.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-kdump"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-kdump/yast2-kdump.changes  2017-02-04 
16:52:30.081493858 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-kdump.new/yast2-kdump.changes     
2017-02-18 03:15:11.917405020 +0100
@@ -1,0 +2,6 @@
+Tue Feb 14 12:08:46 UTC 2017 - [email protected]
+
+- Explicitly create the kdump initrd (bsc#1022496).
+- 3.2.2
+
+-------------------------------------------------------------------

Old:
----
  yast2-kdump-3.2.1.tar.bz2

New:
----
  yast2-kdump-3.2.2.tar.bz2

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

Other differences:
------------------
++++++ yast2-kdump.spec ++++++
--- /var/tmp/diff_new_pack.olc6vf/_old  2017-02-18 03:15:12.313349100 +0100
+++ /var/tmp/diff_new_pack.olc6vf/_new  2017-02-18 03:15:12.313349100 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-kdump
-Version:        3.2.1
+Version:        3.2.2
 Release:        0
 Summary:        Configuration of kdump
 License:        GPL-2.0

++++++ yast2-kdump-3.2.1.tar.bz2 -> yast2-kdump-3.2.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.2.1/package/yast2-kdump.changes 
new/yast2-kdump-3.2.2/package/yast2-kdump.changes
--- old/yast2-kdump-3.2.1/package/yast2-kdump.changes   2017-01-31 
08:16:54.565993255 +0100
+++ new/yast2-kdump-3.2.2/package/yast2-kdump.changes   2017-02-15 
15:43:21.851607361 +0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Tue Feb 14 12:08:46 UTC 2017 - [email protected]
+
+- Explicitly create the kdump initrd (bsc#1022496).
+- 3.2.2
+
+-------------------------------------------------------------------
 Wed Jan 25 13:01:58 UTC 2017 - [email protected]
 
 - Implement simple_mode -> label_proposal (FATE#322328)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.2.1/package/yast2-kdump.spec 
new/yast2-kdump-3.2.2/package/yast2-kdump.spec
--- old/yast2-kdump-3.2.1/package/yast2-kdump.spec      2017-01-31 
08:16:54.569993255 +0100
+++ new/yast2-kdump-3.2.2/package/yast2-kdump.spec      2017-02-15 
15:43:21.851607361 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-kdump
-Version:        3.2.1
+Version:        3.2.2
 Release:        0
 Summary:        Configuration of kdump
 License:        GPL-2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.2.1/src/clients/kdump_finish.rb 
new/yast2-kdump-3.2.2/src/clients/kdump_finish.rb
--- old/yast2-kdump-3.2.1/src/clients/kdump_finish.rb   2017-01-31 
08:16:54.581993255 +0100
+++ new/yast2-kdump-3.2.2/src/clients/kdump_finish.rb   2017-02-15 
15:43:21.855607361 +0100
@@ -1,70 +1,2 @@
-# encoding: utf-8
-
-# File:
-#  kdump_finish.ycp
-#
-# Module:
-#  Step of base installation finish
-#
-# Authors:
-#  Jozef Uhliarik <[email protected]>
-#
-#
-module Yast
-  class KdumpFinishClient < Client
-    def main
-
-      textdomain "kdump"
-
-      Yast.import "Kdump"
-      Yast.import "Mode"
-      Yast.import "Progress"
-
-      @ret = nil
-      @func = ""
-      @param = {}
-
-      # Check arguments
-      if Ops.greater_than(Builtins.size(WFM.Args), 0) &&
-          Ops.is_string?(WFM.Args(0))
-        @func = Convert.to_string(WFM.Args(0))
-        if Ops.greater_than(Builtins.size(WFM.Args), 1) &&
-            Ops.is_map?(WFM.Args(1))
-          @param = Convert.to_map(WFM.Args(1))
-        end
-      end
-
-      @progress_orig = Progress.set(false)
-
-      Builtins.y2milestone("starting kdump_finish")
-      Builtins.y2debug("func=%1", @func)
-      Builtins.y2debug("param=%1", @param)
-
-      if @func == "Info"
-        return {
-          "steps" => 3,
-          # progress step title
-          "title" => _("Saving kdump configuration..."),
-          "when"  => [:installation, :update, :autoinst]
-        }
-      elsif @func == "Write"
-        # propose settings for kdump if autoyast doesn't include settings for 
yast2-kdump
-        Kdump.Propose if !Kdump.import_called && (Mode.autoinst || 
Mode.autoupgrade)
-        if Mode.update
-          Kdump.Update
-        else
-          Kdump.Write
-        end
-      else
-        Builtins.y2error("unknown function: %1", @func)
-        @ret = nil
-      end
-      Progress.set(@progress_orig)
-      Builtins.y2debug("ret=%1", @ret)
-      Builtins.y2milestone("kdump_finish finished")
-      deep_copy(@ret)
-    end
-  end
-end
-
-Yast::KdumpFinishClient.new.main
+require "kdump/clients/finish"
+::Y2Kdump::Clients::Finish.run
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.2.1/src/lib/kdump/clients/finish.rb 
new/yast2-kdump-3.2.2/src/lib/kdump/clients/finish.rb
--- old/yast2-kdump-3.2.1/src/lib/kdump/clients/finish.rb       1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-kdump-3.2.2/src/lib/kdump/clients/finish.rb       2017-02-15 
15:43:21.891607361 +0100
@@ -0,0 +1,56 @@
+# encoding: utf-8
+
+# 
------------------------------------------------------------------------------
+# Copyright (c) 2017 SUSE LLC
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of version 2 of the GNU General Public License as published by the
+# Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 
details.
+#
+# 
------------------------------------------------------------------------------
+
+require "installation/finish_client"
+
+module Y2Kdump
+  module Clients
+    class Finish < ::Installation::FinishClient
+      def initialize
+        textdomain "kdump"
+
+        Yast.import "Kdump"
+        Yast.import "Mode"
+        Yast.import "Progress"
+      end
+
+      def title
+        # progress step title
+        _("Saving kdump configuration...")
+      end
+
+      def modes
+        [:installation, :update, :autoinst]
+      end
+
+      def steps
+        3
+      end
+
+      def write
+        progress_orig = Progress.set(false)
+        # propose settings for kdump
+        # if autoyast doesn't include settings for yast2-kdump
+        Kdump.Propose if !Kdump.import_called && Mode.auto
+        if Mode.update
+          Kdump.Update
+        else
+          Kdump.Write
+        end
+        Progress.set(progress_orig)
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.2.1/src/modules/Kdump.rb 
new/yast2-kdump-3.2.2/src/modules/Kdump.rb
--- old/yast2-kdump-3.2.1/src/modules/Kdump.rb  2017-01-31 08:16:54.605993255 
+0100
+++ new/yast2-kdump-3.2.2/src/modules/Kdump.rb  2017-02-15 15:43:21.899607361 
+0100
@@ -385,10 +385,24 @@
     #
     # @return [Boolean] whether successful
     def update_initrd
+      # For CaaSP we need an explicit initrd rebuild before the
+      # first boot, when the root filesystem becomes read only.
+      rebuild_cmd = "/usr/sbin/tu-rebuild-kdump-initrd"
+      # part of transactional-update.rpm
+      update_initrd_with("if test -x #{rebuild_cmd}; then #{rebuild_cmd}; fi")
+
+      return true unless using_fadump_changed?
+
       # See FATE#315780
       # See https://www.suse.com/support/kb/doc.php?id=7012786
       # FIXME what about dracut?
       update_command = (using_fadump? ? "mkdumprd -f" : "mkinitrd")
+      update_initrd_with(update_command)
+    end
+
+    # @param update_command [String] a command for .target.bash
+    # @return [Boolean] whether successful
+    def update_initrd_with(update_command)
       update_logfile = File.join(Directory.vardir, "y2logmkinitrd")
 
       run_command = update_command + " >> #{update_logfile} 2>&1"
@@ -429,11 +443,7 @@
     def WriteKdumpSettings
       WriteKdumpSettingsTo(path(".sysconfig.kdump"), @kdump_file)
 
-      if using_fadump_changed? && ! update_initrd
-        return false
-      end
-
-      true
+      update_initrd
     end
 
     # Write kdump boot arguments - crashkernel and fadump
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.2.1/test/finish_test.rb 
new/yast2-kdump-3.2.2/test/finish_test.rb
--- old/yast2-kdump-3.2.1/test/finish_test.rb   1970-01-01 01:00:00.000000000 
+0100
+++ new/yast2-kdump-3.2.2/test/finish_test.rb   2017-02-15 15:43:21.939607361 
+0100
@@ -0,0 +1,51 @@
+#!/usr/bin/env rspec
+
+require_relative "./test_helper"
+
+require "kdump/clients/finish"
+
+describe Y2Kdump::Clients::Finish do
+  describe "#steps" do
+    it "returns an integer" do
+      expect(subject.steps).to be_an Integer
+    end
+  end
+
+  describe "#title" do
+    it "returns a string" do
+      expect(subject.title).to be_a String
+    end
+  end
+
+  describe "#modes" do
+    it "returns a list" do
+      modes = subject.modes
+      # If we want to make this a generic FinishClient test,
+      # remember the API allows a nil
+      expect(modes).to be_an Array
+      modes.each do |m|
+        # elements are fixed symbol values
+        expect(m).to be_a Symbol
+      end
+    end
+  end
+
+  describe "#write" do
+    before do
+      allow(Yast::Kdump).to receive(:Propose)
+      Yast::Kdump.import_called = false
+    end
+
+    it "calls Kdump.Write for installing" do
+      expect(Yast::Mode).to receive(:update).and_return(false)
+      expect(Yast::Kdump).to receive(:Write)
+      subject.write
+    end
+
+    it "calls Kdump.Update for updating" do
+      expect(Yast::Mode).to receive(:update).and_return(true)
+      expect(Yast::Kdump).to receive(:Update)
+      subject.write
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.2.1/test/test_helper.rb 
new/yast2-kdump-3.2.2/test/test_helper.rb
--- old/yast2-kdump-3.2.1/test/test_helper.rb   2017-01-31 08:16:54.613993255 
+0100
+++ new/yast2-kdump-3.2.2/test/test_helper.rb   2017-02-15 15:43:21.943607361 
+0100
@@ -7,14 +7,13 @@
 
 if ENV["COVERAGE"]
   require "simplecov"
-  SimpleCov.start
-
-  # For coverage we need to load all ruby files
-  # Note that clients/ are excluded because they run too eagerly by design
-  Dir["#{srcdir}/{include,modules}/**/*.rb"].each do |f|
-    require_relative f
+  SimpleCov.start do
+    add_filter "/test/"
   end
 
+  # track all ruby files under src
+  SimpleCov.track_files("#{srcdir}/**/*.rb")
+
   # use coveralls for on-line code coverage reporting at Travis CI
   if ENV["TRAVIS"]
     require "coveralls"


Reply via email to