commit yast2-installation for openSUSE:Factory
Hello community, here is the log from the commit of package yast2-installation for openSUSE:Factory checked in at 2014-06-26 08:00:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old) and /work/SRC/openSUSE:Factory/.yast2-installation.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-installation" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes 2014-06-06 14:36:34.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-installation.new/yast2-installation.changes 2014-06-26 08:00:43.000000000 +0200 @@ -1,0 +2,54 @@ +Mon Jun 23 16:09:32 CEST 2014 - locilka@suse.com + +- Changed /bin/rm path to /usr/bin/rm path (bnc#882453) +- 3.1.96 + +------------------------------------------------------------------- +Mon Jun 23 13:02:27 UTC 2014 - jreidinger@suse.com + +- directly export autoyast profile to target file (bnc#881108) +- 3.1.95 + +------------------------------------------------------------------- +Thu Jun 19 19:05:10 UTC 2014 - lslezak@suse.cz + +- removed random_finish client, haveged service is by default + enabled, no need for explicit enabling by Yast + (gh#yast/yast-installation#214) +- 3.1.94 + +------------------------------------------------------------------- +Wed Jun 18 11:47:26 UTC 2014 - lslezak@suse.cz + +- make sure the CIO ignore config file ends with a new line + (bnc#883198) +- 3.1.93 + +------------------------------------------------------------------- +Tue Jun 17 12:34:33 UTC 2014 - lslezak@suse.cz + +- inst_upgrade_urls.rb: set the future target distribution to not + ignore the SCC online repositories in libzypp (bnc#881320) +- 3.1.92 + +------------------------------------------------------------------- +Mon Jun 16 12:33:18 UTC 2014 - jreidinger@suse.com + +- write list of active devices for cio_ignore ( partially written + by Ihno ) +- 3.1.91 + +------------------------------------------------------------------- +Thu Jun 12 15:20:04 UTC 2014 - jreidinger@suse.com + +- restore backup if yast failed during installation/upgrade + (bnc#882039) +- 3.1.90 + +------------------------------------------------------------------- +Thu Jun 12 08:27:01 UTC 2014 - lslezak@suse.cz + +- properly enable the add-on module in the installation workflow +- 3.1.89 + +------------------------------------------------------------------- Old: ---- yast2-installation-3.1.88.tar.bz2 New: ---- yast2-installation-3.1.96.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-installation.spec ++++++ --- /var/tmp/diff_new_pack.v9awje/_old 2014-06-26 08:00:44.000000000 +0200 +++ /var/tmp/diff_new_pack.v9awje/_new 2014-06-26 08:00:44.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 3.1.88 +Version: 3.1.96 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ YaST2-Firstboot.service ++++++ --- /var/tmp/diff_new_pack.v9awje/_old 2014-06-26 08:00:44.000000000 +0200 +++ /var/tmp/diff_new_pack.v9awje/_new 2014-06-26 08:00:44.000000000 +0200 @@ -9,7 +9,7 @@ Environment=SYSTEMCTL_OPTIONS=--ignore-dependencies TERM=linux ExecStartPre=-/usr/bin/plymouth --hide-splash ExecStart=/usr/lib/YaST2/startup/YaST2.Firstboot -ExecStartPost=/bin/rm -f /var/lib/YaST2/reconfig_system +ExecStartPost=/usr/bin/rm -f /var/lib/YaST2/reconfig_system ExecStartPost=/usr/bin/systemctl restart systemd-vconsole-setup.service TimeoutSec=0 RemainAfterExit=true ++++++ YaST2-Second-Stage.service ++++++ --- /var/tmp/diff_new_pack.v9awje/_old 2014-06-26 08:00:44.000000000 +0200 +++ /var/tmp/diff_new_pack.v9awje/_new 2014-06-26 08:00:44.000000000 +0200 @@ -11,7 +11,7 @@ ExecStart=/usr/lib/YaST2/startup/YaST2.Second-Stage RemainAfterExit=yes TimeoutSec=0 -ExecStartPost=/bin/rm -f /var/lib/YaST2/runme_at_boot +ExecStartPost=/usr/bin/rm -f /var/lib/YaST2/runme_at_boot ExecStartPost=/usr/bin/systemctl restart systemd-vconsole-setup.service StandardInput=tty ++++++ yast2-installation-3.1.88.tar.bz2 -> yast2-installation-3.1.96.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/package/YaST2-Firstboot.service new/yast2-installation-3.1.96/package/YaST2-Firstboot.service --- old/yast2-installation-3.1.88/package/YaST2-Firstboot.service 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/package/YaST2-Firstboot.service 2014-06-24 14:34:58.000000000 +0200 @@ -9,7 +9,7 @@ Environment=SYSTEMCTL_OPTIONS=--ignore-dependencies TERM=linux ExecStartPre=-/usr/bin/plymouth --hide-splash ExecStart=/usr/lib/YaST2/startup/YaST2.Firstboot -ExecStartPost=/bin/rm -f /var/lib/YaST2/reconfig_system +ExecStartPost=/usr/bin/rm -f /var/lib/YaST2/reconfig_system ExecStartPost=/usr/bin/systemctl restart systemd-vconsole-setup.service TimeoutSec=0 RemainAfterExit=true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/package/YaST2-Second-Stage.service new/yast2-installation-3.1.96/package/YaST2-Second-Stage.service --- old/yast2-installation-3.1.88/package/YaST2-Second-Stage.service 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/package/YaST2-Second-Stage.service 2014-06-24 14:34:58.000000000 +0200 @@ -11,7 +11,7 @@ ExecStart=/usr/lib/YaST2/startup/YaST2.Second-Stage RemainAfterExit=yes TimeoutSec=0 -ExecStartPost=/bin/rm -f /var/lib/YaST2/runme_at_boot +ExecStartPost=/usr/bin/rm -f /var/lib/YaST2/runme_at_boot ExecStartPost=/usr/bin/systemctl restart systemd-vconsole-setup.service StandardInput=tty diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/package/yast2-installation.changes new/yast2-installation-3.1.96/package/yast2-installation.changes --- old/yast2-installation-3.1.88/package/yast2-installation.changes 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/package/yast2-installation.changes 2014-06-24 14:34:58.000000000 +0200 @@ -1,4 +1,58 @@ ------------------------------------------------------------------- +Mon Jun 23 16:09:32 CEST 2014 - locilka@suse.com + +- Changed /bin/rm path to /usr/bin/rm path (bnc#882453) +- 3.1.96 + +------------------------------------------------------------------- +Mon Jun 23 13:02:27 UTC 2014 - jreidinger@suse.com + +- directly export autoyast profile to target file (bnc#881108) +- 3.1.95 + +------------------------------------------------------------------- +Thu Jun 19 19:05:10 UTC 2014 - lslezak@suse.cz + +- removed random_finish client, haveged service is by default + enabled, no need for explicit enabling by Yast + (gh#yast/yast-installation#214) +- 3.1.94 + +------------------------------------------------------------------- +Wed Jun 18 11:47:26 UTC 2014 - lslezak@suse.cz + +- make sure the CIO ignore config file ends with a new line + (bnc#883198) +- 3.1.93 + +------------------------------------------------------------------- +Tue Jun 17 12:34:33 UTC 2014 - lslezak@suse.cz + +- inst_upgrade_urls.rb: set the future target distribution to not + ignore the SCC online repositories in libzypp (bnc#881320) +- 3.1.92 + +------------------------------------------------------------------- +Mon Jun 16 12:33:18 UTC 2014 - jreidinger@suse.com + +- write list of active devices for cio_ignore ( partially written + by Ihno ) +- 3.1.91 + +------------------------------------------------------------------- +Thu Jun 12 15:20:04 UTC 2014 - jreidinger@suse.com + +- restore backup if yast failed during installation/upgrade + (bnc#882039) +- 3.1.90 + +------------------------------------------------------------------- +Thu Jun 12 08:27:01 UTC 2014 - lslezak@suse.cz + +- properly enable the add-on module in the installation workflow +- 3.1.89 + +------------------------------------------------------------------- Tue Jun 3 13:53:15 UTC 2014 - lslezak@suse.cz - inst_upgrade_urls.rb client: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/package/yast2-installation.spec new/yast2-installation-3.1.96/package/yast2-installation.spec --- old/yast2-installation-3.1.88/package/yast2-installation.spec 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/package/yast2-installation.spec 2014-06-24 14:34:58.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 3.1.88 +Version: 3.1.96 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/src/Makefile.am new/yast2-installation-3.1.96/src/Makefile.am --- old/yast2-installation-3.1.88/src/Makefile.am 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/src/Makefile.am 2014-06-24 14:34:58.000000000 +0200 @@ -62,7 +62,6 @@ clients/pre_umount_finish.rb \ clients/prep_shrink_finish.rb \ clients/proxy_finish.rb \ - clients/random_finish.rb \ clients/save_config_finish.rb \ clients/save_hw_status_finish.rb \ clients/ssh_settings_finish.rb \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/src/clients/clone_proposal.rb new/yast2-installation-3.1.96/src/clients/clone_proposal.rb --- old/yast2-installation-3.1.88/src/clients/clone_proposal.rb 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/src/clients/clone_proposal.rb 2014-06-24 14:34:58.000000000 +0200 @@ -74,8 +74,10 @@ if param["force"] || @clone_settings.enabled? # keep mode, cloning set it to autoinst_config, but we need to continue # installation with original one(BNC#861520) + options = {} + options["target_path"] = param["target_path"] if param["target_path"] mode = Mode.mode - WFM.call "clone_system" + WFM.call("clone_system",[options]) Mode.SetMode(mode) end ret = true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/src/clients/inst_finish.rb new/yast2-installation-3.1.96/src/clients/inst_finish.rb --- old/yast2-installation-3.1.88/src/clients/inst_finish.rb 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/src/clients/inst_finish.rb 2014-06-24 14:34:58.000000000 +0200 @@ -157,7 +157,6 @@ # product registration step is optional WFM.ClientExists("scc_finish") ? "scc" : "", "driver_update1", - "random", # bnc #340733 "system_settings" ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/src/clients/inst_proposal.rb new/yast2-installation-3.1.96/src/clients/inst_proposal.rb --- old/yast2-installation-3.1.88/src/clients/inst_proposal.rb 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/src/clients/inst_proposal.rb 2014-06-24 14:34:58.000000000 +0200 @@ -222,12 +222,10 @@ # force write, so it always write profile even if user do not want # to store profile after installation - WFM.CallFunction("clone_proposal", ["Write", "force" => true]) - if !File.exists?("/root/autoinst.xml") + WFM.CallFunction("clone_proposal", ["Write", "force" => true, "target_path" => path]) + if !File.exists?(path) raise _("Failed to store configuration. Details can be found in log.") end - - WFM.Execute(path(".local.bash"), "mv -- /root/autoinst.xml '#{String.Quote(path)}'") when :skip, :dontskip if Convert.to_boolean(UI.QueryWidget(Id(:skip), :Value)) # User doesn't want to use any of the settings diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/src/clients/inst_upgrade_urls.rb new/yast2-installation-3.1.96/src/clients/inst_upgrade_urls.rb --- old/yast2-installation-3.1.88/src/clients/inst_upgrade_urls.rb 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/src/clients/inst_upgrade_urls.rb 2014-06-24 14:34:58.000000000 +0200 @@ -849,7 +849,8 @@ # force reloading the libzypp repomanager to notice the removed files Pkg.TargetFinish - Pkg.TargetInitialize(Installation.destdir) + Pkg.TargetInitializeOptions(Installation.destdir, + "target_distro" => target_distribution) Pkg.TargetLoad end @@ -1300,6 +1301,21 @@ :next end + + private + + # TODO FIXME: share this code better + def target_distribution + base_products = Product.FindBaseProducts + + # empty target distribution disables service compatibility check in case + # the base product cannot be found + target_distro = base_products ? base_products.first["register_target"] : "" + log.info "Base product target distribution: #{target_distro}" + + target_distro + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/src/clients/random_finish.rb new/yast2-installation-3.1.96/src/clients/random_finish.rb --- old/yast2-installation-3.1.88/src/clients/random_finish.rb 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/src/clients/random_finish.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,113 +0,0 @@ -# encoding: utf-8 - -# ------------------------------------------------------------------------------ -# Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved. -# -# -# 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. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, contact Novell, Inc. -# -# To contact Novell about this file by physical or electronic mail, you may find -# current contact information at www.novell.com. -# ------------------------------------------------------------------------------ - -# File: random_finish.ycp -# -# Module: Handle haveged service and preserve the current randomness state -# -# Authors: Lukas Ocilka <locilka@suse.cz> -# -# $Id$ - -require "installation/minimal_installation" - -module Yast - class RandomFinishClient < Client - def main - textdomain "installation" - - Yast.import "FileUtils" - Yast.import "Service" - - @ret = nil - @func = "" - @param = {} - - 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 - - Builtins.y2milestone("starting random_finish") - Builtins.y2debug("func=%1", @func) - Builtins.y2debug("param=%1", @param) - - if @func == "Info" - minimal_inst = ::Installation::MinimalInstallation.instance.enabled? - return { - "steps" => 1, - # progress step title - "title" => _( - "Enabling random number generator..." - ), - "when" => minimal_inst ? [] : - [:installation, :live_installation, :update, :autoinst] - } - elsif @func == "Write" - @init_path = "/etc/init.d/" - @init_service = "haveged" - - # The generator of randomness should be always enabled if possible - if FileUtils.Exists( - Builtins.sformat("%1/%2", @init_path, @init_service) - ) - Builtins.y2milestone("Enabling service %1", @init_service) - @ret = Service.Enable(@init_service) - else - Builtins.y2warning( - "Cannot enable service %1, %2 is not installed", - @init_service, - Builtins.sformat("%1/%2", @init_path, @init_service) - ) - end - else - Builtins.y2error("unknown function: %1", @func) - @ret = nil - end - - Builtins.y2debug("ret=%1", @ret) - Builtins.y2milestone("random_finish finished") - - deep_copy(@ret) - end - - # Calls a local command and returns if successful - def LocalCommand(command) - cmd = Convert.to_map(WFM.Execute(path(".local.bash_output"), command)) - Builtins.y2milestone("Command %1 returned: %2", command, cmd) - - if Ops.get_integer(cmd, "exit", -1) == 0 - return true - else - if Ops.get_string(cmd, "stderr", "") != "" - Builtins.y2error("Error: %1", Ops.get_string(cmd, "stderr", "")) - end - return false - end - end - end -end - -Yast::RandomFinishClient.new.main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/src/include/installation/inst_inc_first.rb new/yast2-installation-3.1.96/src/include/installation/inst_inc_first.rb --- old/yast2-installation-3.1.88/src/include/installation/inst_inc_first.rb 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/src/include/installation/inst_inc_first.rb 2014-06-24 14:34:58.000000000 +0200 @@ -85,9 +85,9 @@ addons_default ) if show_addons - ProductControl.DisableModule("add-on") - else ProductControl.EnableModule("add-on") + else + ProductControl.DisableModule("add-on") end Installation.add_on_selected = addons_default @@ -139,7 +139,7 @@ "Directory '%1' exists, removing...", String.Quote(zypp_data_item) ) - bashcmd = Builtins.sformat("/bin/rm -rf '%1'", zypp_data_item) + bashcmd = Builtins.sformat("/usr/bin/rm -rf '%1'", zypp_data_item) Builtins.y2milestone( "Result: %1", WFM.Execute(path(".local.bash_output"), bashcmd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/src/lib/installation/cio_ignore.rb new/yast2-installation-3.1.96/src/lib/installation/cio_ignore.rb --- old/yast2-installation-3.1.88/src/lib/installation/cio_ignore.rb 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/src/lib/installation/cio_ignore.rb 2014-06-24 14:34:58.000000000 +0200 @@ -153,6 +153,9 @@ # blacklisted (fate#315318) add_boot_kernel_parameters + # store activelly used devices to not be blocked + store_active_devices + nil else raise "Uknown action #{func} passed as first parameter" @@ -173,5 +176,24 @@ raise "failed to write kernel parameters for IPL and console device" end end + + ACTIVE_DEVICES_FILE = "/boot/zipl/active_devices.txt" + def store_active_devices + Yast.import "Installation" + res = Yast::SCR.Execute(YAST_BASH_PATH, "cio_ignore -L") + log.info "active devices: #{res}" + + raise "cio_ignore -L failed with #{res["stderr"]}" if res["exit"] != 0 + #lets select only lines that looks like device. Regexp is not perfect, but good enough + devices_lines = res["stdout"].lines.grep(/^(?:\h.){0,2}\h{4}.*$/) + + devices = devices_lines.map(&:chomp) + target_file = File.join(Yast::Installation.destdir, ACTIVE_DEVICES_FILE) + + # make sure the file ends with a new line character + devices << "" unless devices.empty? + + File.write(target_file, devices.join("\n")) + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/src/modules/Vendor.rb new/yast2-installation-3.1.96/src/modules/Vendor.rb --- old/yast2-installation-3.1.88/src/modules/Vendor.rb 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/src/modules/Vendor.rb 2014-06-24 14:34:58.000000000 +0200 @@ -65,7 +65,7 @@ Builtins.y2milestone("Extracting driver update...") # clean up, just in case - SCR.Execute(path(".target.bash"), "/bin/rm -rf /tmp/update") + SCR.Execute(path(".target.bash"), "/usr/bin/rm -rf /tmp/update") # copy log file WFM.Execute( @@ -182,7 +182,7 @@ ) # remove driver update dir - SCR.Execute(path(".target.bash"), "/bin/rm -rf /tmp/update") + SCR.Execute(path(".target.bash"), "/usr/bin/rm -rf /tmp/update") nil end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/startup/YaST2.call new/yast2-installation-3.1.96/startup/YaST2.call --- old/yast2-installation-3.1.88/startup/YaST2.call 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/startup/YaST2.call 2014-06-24 14:34:58.000000000 +0200 @@ -275,6 +275,16 @@ } +#----[ restore_backup ]----# +function restore_backup () { + # restores backup if it is available + if [ -d /mnt/var/adm/backup/system-upgrade ]; then + for i in /mnt/var/adm/backup/system-upgrade/*.tar.bz2; do + tar xvf $i -C /mnt --overwrite + done + fi +} + #----[ start_yast ]----# function start_yast () { #------------------------------------------------------ @@ -336,6 +346,7 @@ cat /etc/yast.inf | grep -q -i "Aborted: 1" if [ $? = 0 ];then log "\t$Y2_ABORT_MESSAGE" + restore_backup fi else #============================================= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.88/test/cio_ignore_test.rb new/yast2-installation-3.1.96/test/cio_ignore_test.rb --- old/yast2-installation-3.1.88/test/cio_ignore_test.rb 2014-06-03 17:10:28.000000000 +0200 +++ new/yast2-installation-3.1.96/test/cio_ignore_test.rb 2014-06-24 14:34:58.000000000 +0200 @@ -106,6 +106,7 @@ describe "first parameter \"Write\"" do before(:each) do + stub_const("Yast::Installation", double(:destdir => "/mnt")) stub_const("Yast::Bootloader", double()) allow(Yast::Bootloader).to receive(:Write) { true } @@ -113,8 +114,9 @@ allow(Yast::Bootloader).to receive(:modify_kernel_params) { true } allow(Yast::SCR).to receive(:Execute). - once. and_return({"exit" => 0, "stdout" => "", "stderr" => ""}) + + allow(File).to receive(:write) end describe "Device blacklisting is disabled" do @@ -176,6 +178,45 @@ expect{subject.run("Write")}.to raise_error(RuntimeError, /failed to write kernel parameters/) end + + it "writes list of active devices to zipl so it is not blocked" do + test_output = <<-EOL +Devices that are not ignored: +============================= +0.0.0160 +0.0.01c0 +0.0.0700-0.0.0702 +0.0.fc00 + EOL + expect(Yast::SCR).to receive(:Execute). + with( + ::Installation::CIOIgnoreFinish::YAST_BASH_PATH, + "cio_ignore -L" + ). + once. + and_return({"exit" => 0, "stdout" => test_output, "stderr" => ""}) + + + expect(File).to receive(:write).once do |file, content| + expect(file).to eq("/mnt/boot/zipl/active_devices.txt") + expect(content).to match(/0.0.0700-0.0.0702/) + expect(content).to end_with("\n") + end + + subject.run("Write") + end + + it "raises an exception if cio_ignore -L failed" do + expect(Yast::SCR).to receive(:Execute). + with( + ::Installation::CIOIgnoreFinish::YAST_BASH_PATH, + "cio_ignore -L" + ). + once. + and_return({"exit" => 1, "stdout" => "", "stderr" => "FAIL"}) + + expect{subject.run("Write")}.to raise_error(RuntimeError, /cio_ignore -L failed/) + end end end -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de