Hello community, here is the log from the commit of package yast2-installation for openSUSE:Factory checked in at 2015-09-13 09:43:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2015-08-29 20:03:19.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-installation.new/yast2-installation.changes 2015-09-13 09:43:13.000000000 +0200 @@ -1,0 +2,21 @@ +Fri Sep 4 07:07:33 UTC 2015 - jsrain@suse.cz + +- fix bug preventing to finish proposal in some sutuations + (bsc#944334) +- 3.1.159 + +------------------------------------------------------------------- +Thu Sep 3 14:41:07 CEST 2015 - locilka@suse.com + +- Fixed setting language / languages in the installation welcome + screen (bsc#943746, bsc#944035) +- 3.1.158 + +------------------------------------------------------------------- +Wed Sep 2 09:43:21 UTC 2015 - igonzalezsosa@suse.com + +- Move #second_stage_required? method to InstFunctions module + to be used by AutoYaST (bnc#892091) +- 3.1.157 + +------------------------------------------------------------------- Old: ---- yast2-installation-3.1.156.tar.bz2 New: ---- yast2-installation-3.1.159.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-installation.spec ++++++ --- /var/tmp/diff_new_pack.c3bvoD/_old 2015-09-13 09:43:14.000000000 +0200 +++ /var/tmp/diff_new_pack.c3bvoD/_new 2015-09-13 09:43:14.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 3.1.156 +Version: 3.1.159 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-installation-3.1.156.tar.bz2 -> yast2-installation-3.1.159.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/package/yast2-installation.changes new/yast2-installation-3.1.159/package/yast2-installation.changes --- old/yast2-installation-3.1.156/package/yast2-installation.changes 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/package/yast2-installation.changes 2015-09-04 09:24:11.000000000 +0200 @@ -1,4 +1,25 @@ ------------------------------------------------------------------- +Fri Sep 4 07:07:33 UTC 2015 - jsrain@suse.cz + +- fix bug preventing to finish proposal in some sutuations + (bsc#944334) +- 3.1.159 + +------------------------------------------------------------------- +Thu Sep 3 14:41:07 CEST 2015 - locilka@suse.com + +- Fixed setting language / languages in the installation welcome + screen (bsc#943746, bsc#944035) +- 3.1.158 + +------------------------------------------------------------------- +Wed Sep 2 09:43:21 UTC 2015 - igonzalezsosa@suse.com + +- Move #second_stage_required? method to InstFunctions module + to be used by AutoYaST (bnc#892091) +- 3.1.157 + +------------------------------------------------------------------- Tue Aug 25 10:17:24 CEST 2015 - schubi@suse.de - fixed cio_ignore testcase diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/package/yast2-installation.spec new/yast2-installation-3.1.159/package/yast2-installation.spec --- old/yast2-installation-3.1.156/package/yast2-installation.spec 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/package/yast2-installation.spec 2015-09-04 09:24:11.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 3.1.156 +Version: 3.1.159 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/src/include/installation/inst_inc_first.rb new/yast2-installation-3.1.159/src/include/installation/inst_inc_first.rb --- old/yast2-installation-3.1.156/src/include/installation/inst_inc_first.rb 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/src/include/installation/inst_inc_first.rb 2015-09-04 09:24:11.000000000 +0200 @@ -45,6 +45,7 @@ Yast.import "Mode" Yast.import "ProductFeatures" Yast.import "AutoinstConfig" + Yast.import "InstFunctions" Yast.include include_target, "installation/misc.rb" end @@ -175,7 +176,7 @@ # file name run_yast_at_boot = "#{Installation.destdir}/#{Installation.run_yast_at_boot}" - if second_stage_required? + if InstFunctions.second_stage_required? Builtins.y2milestone("Running the second stage is required") WFM.Write(path(".local.string"), run_yast_at_boot, "") WriteSecondStageRequired(true) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/src/include/installation/misc.rb new/yast2-installation-3.1.159/src/include/installation/misc.rb --- old/yast2-installation-3.1.156/src/include/installation/misc.rb 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/src/include/installation/misc.rb 2015-09-04 09:24:11.000000000 +0200 @@ -365,30 +365,5 @@ nil end - - def second_stage_required? - return false unless Stage.initial - - # the current one is 'initial' - if (Mode.autoinst || Mode.autoupgrade) && !AutoinstConfig.second_stage - run_second_stage = false - Builtins.y2milestone("Autoyast: second stage is disabled") - else - # after reboot/kexec it would be 'continue' - stage_to_check = "continue" - - # for matching the control file - mode_to_check = Mode.mode - - Builtins.y2milestone( - "Checking RunRequired (%1, %2)", - stage_to_check, - mode_to_check - ) - run_second_stage = ProductControl.RunRequired(stage_to_check, mode_to_check) - end - - run_second_stage - end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/src/lib/installation/clients/copy_files_finish.rb new/yast2-installation-3.1.159/src/lib/installation/clients/copy_files_finish.rb --- old/yast2-installation-3.1.156/src/lib/installation/clients/copy_files_finish.rb 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/src/lib/installation/clients/copy_files_finish.rb 2015-09-04 09:24:11.000000000 +0200 @@ -53,6 +53,7 @@ Yast.import "WorkflowManager" Yast.import "SystemFilesCopy" Yast.import "ProductFeatures" + Yast.import "InstFunctions" Yast.include self, "installation/misc.rb" @@ -127,7 +128,7 @@ # -------------------------------------------------------------- # Copy /etc/install.inf into built system so that the # second phase of the installation can find it. - if second_stage_required? + if InstFunctions.second_stage_required? Linuxrc.SaveInstallInf(Installation.destdir) else SCR.Execute(path(".target.remove"), "/etc/install.inf") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/src/lib/installation/clients/inst_complex_welcome.rb new/yast2-installation-3.1.159/src/lib/installation/clients/inst_complex_welcome.rb --- old/yast2-installation-3.1.156/src/lib/installation/clients/inst_complex_welcome.rb 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/src/lib/installation/clients/inst_complex_welcome.rb 2015-09-04 09:24:11.000000000 +0200 @@ -353,7 +353,7 @@ # Set it in the Language module. Language.Set(@language) - Language.languages = [Language.RemoveSuffix(@language)] + Language.languages = Language.RemoveSuffix(@language) end # Check and set CJK languages if Stage.initial || Stage.firstboot @@ -403,7 +403,8 @@ # In case of normal installation, solver run will follow without this explicit call if Mode.live_installation && Language.PackagesModified - Language.PackagesInit(Language.languages) + selected_languages = Language.languages.split(",") << Language.language + Language.PackagesInit(selected_languages) end Builtins.y2milestone( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/src/lib/installation/proposal_runner.rb new/yast2-installation-3.1.159/src/lib/installation/proposal_runner.rb --- old/yast2-installation-3.1.156/src/lib/installation/proposal_runner.rb 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/src/lib/installation/proposal_runner.rb 2015-09-04 09:24:11.000000000 +0200 @@ -298,6 +298,9 @@ elsif Yast::Stage.stage == "normal" && Yast::Mode.update input = confirm_update ? :next : nil log.info "Update not confirmed, returning back..." unless input + else + # sane default for other cases (bsc#944334) + input = :next end input diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/src/lib/installation/snapshots_finish.rb new/yast2-installation-3.1.159/src/lib/installation/snapshots_finish.rb --- old/yast2-installation-3.1.156/src/lib/installation/snapshots_finish.rb 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/src/lib/installation/snapshots_finish.rb 2015-09-04 09:24:11.000000000 +0200 @@ -12,6 +12,7 @@ Yast.import "Mode" Yast.import "StorageSnapper" + Yast.import "InstFunctions" Yast.include self, "installation/misc.rb" end @@ -23,7 +24,7 @@ # @return [TrueClass,FalseClass] True if snapshot was created; # otherwise it returns false. def write - if !second_stage_required? && Yast2::FsSnapshot.configured? + if !InstFunctions.second_stage_required? && Yast2::FsSnapshot.configured? log.info("Creating root filesystem snapshot") if Mode.update create_post_snapshot diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/src/modules/InstFunctions.rb new/yast2-installation-3.1.159/src/modules/InstFunctions.rb --- old/yast2-installation-3.1.156/src/modules/InstFunctions.rb 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/src/modules/InstFunctions.rb 2015-09-04 09:24:11.000000000 +0200 @@ -34,6 +34,10 @@ textdomain "installation" Yast.import "Linuxrc" + Yast.import "AutoinstConfig" + Yast.import "Stage" + Yast.import "Mode" + Yast.import "ProductControl" end # Returns list of ignored features defined via Linuxrc commandline @@ -95,8 +99,41 @@ ignored_features.include?(feature) end + # Determines if the second stage should be executed + # + # Checks Mode, AutoinstConfig and ProductControl to decide if it's + # needed. + # + # @return [Boolean] 'true' if it's needed; 'false' otherwise. + def second_stage_required? + return false unless Stage.initial + + # the current one is 'initial' + if (Mode.autoinst || Mode.autoupgrade) && !AutoinstConfig.second_stage + run_second_stage = false + Builtins.y2milestone("Autoyast: second stage is disabled") + else + # after reboot/kexec it would be 'continue' + stage_to_check = "continue" + + # for matching the control file + mode_to_check = Mode.mode + + Builtins.y2milestone( + "Checking RunRequired (%1, %2)", + stage_to_check, + mode_to_check + ) + run_second_stage = ProductControl.RunRequired(stage_to_check, mode_to_check) + end + + run_second_stage + end + alias_method :second_stage_required, :second_stage_required? + publish function: :ignored_features, type: "list ()" publish function: :feature_ignored?, type: "boolean (string)" + publish function: :second_stage_required, type: "boolean ()" private diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/test/inst_functions_test.rb new/yast2-installation-3.1.159/test/inst_functions_test.rb --- old/yast2-installation-3.1.156/test/inst_functions_test.rb 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/test/inst_functions_test.rb 2015-09-04 09:24:11.000000000 +0200 @@ -7,178 +7,259 @@ # For mocking Yast.import "Linuxrc" -def stub_install_inf(install_inf) - allow(Yast::Linuxrc).to receive(:keys).and_return(install_inf.keys) +describe Yast::InstFunctions do + def stub_install_inf(install_inf) + allow(Yast::Linuxrc).to receive(:keys).and_return(install_inf.keys) - install_inf.keys.each do |key| - allow(Yast::Linuxrc).to receive(:InstallInf).with(key).and_return(install_inf[key]) + install_inf.keys.each do |key| + allow(Yast::Linuxrc).to receive(:InstallInf).with(key).and_return(install_inf[key]) + end end -end -describe "when getting list of ignored features from Linuxrc" do - before(:each) do - Yast::InstFunctions.reset_ignored_features - end + describe "when getting list of ignored features from Linuxrc" do + before(:each) do + Yast::InstFunctions.reset_ignored_features + end - it "returns empty list if no features were ignored on commandline" do - linuxrc_commandline = "othercommand=xyz no_ignore_features=1 something-else=555" + it "returns empty list if no features were ignored on commandline" do + linuxrc_commandline = "othercommand=xyz no_ignore_features=1 something-else=555" - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.ignored_features.sort).to be_empty - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.ignored_features.sort).to be_empty + end - it "returns empty list if features ignored on commandline were empty" do - linuxrc_commandline = "ignore_features=" + it "returns empty list if features ignored on commandline were empty" do + linuxrc_commandline = "ignore_features=" - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.ignored_features.sort).to be_empty - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.ignored_features.sort).to be_empty + end - it "returns list of features set on commandline by two entries" do - linuxrc_commandline = "ignore_features=aa,b_b,c-c ignoredfeatures=a-a,dd othercommand=xyz" - ignored_features = ["aa", "bb", "cc", "dd"].sort + it "returns list of features set on commandline by two entries" do + linuxrc_commandline = "ignore_features=aa,b_b,c-c ignoredfeatures=a-a,dd othercommand=xyz" + ignored_features = ["aa", "bb", "cc", "dd"].sort - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features + end - it "returns list of features set on commandline by one entry" do - linuxrc_commandline = "ignore_features=x-x,yy" - ignored_features = ["xx", "yy"].sort + it "returns list of features set on commandline by one entry" do + linuxrc_commandline = "ignore_features=x-x,yy" + ignored_features = ["xx", "yy"].sort - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features + end - it "returns list of features set on commandline by several entries, each feature in separate entry" do - linuxrc_commandline = "trash=install ignore_feature=f.e.a.ture1 ig.n.o.red_features=feature2 ignore_features=feature3" - ignored_features = ["feature1", "feature2", "feature3"].sort + it "returns list of features set on commandline by several entries, each feature in separate entry" do + linuxrc_commandline = "trash=install ignore_feature=f.e.a.ture1 ig.n.o.red_features=feature2 ignore_features=feature3" + ignored_features = ["feature1", "feature2", "feature3"].sort - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features + end - it "returns one feature set on commandline by one entry" do - linuxrc_commandline = "i-g-n-o-r-e_feature=fff" - ignored_features = ["fff"] + it "returns one feature set on commandline by one entry" do + linuxrc_commandline = "i-g-n-o-r-e_feature=fff" + ignored_features = ["fff"] - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features + end - it "returns one feature set on commandline by one entry using up/down case" do - linuxrc_commandline = "Ignore_FeaTUres=ffF" - ignored_features = ["fff"] + it "returns one feature set on commandline by one entry using up/down case" do + linuxrc_commandline = "Ignore_FeaTUres=ffF" + ignored_features = ["fff"] - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features + end - # PTOptions makes a command hidden from 'Cmdline' and creates - # a new install.inf entry using the exact name as it appears in PTOptions - # @see http://en.opensuse.org/SDB:Linuxrc#p_ptoptions - it "returns features set on commandline together with ptoptions" do - install_inf = { - "ignored_features" => "f1,f2,f3", - "IgnoReDfEAtuRes" => "f2,f4", - "i.g.n.o.r.e.d.features" => "f1,f5", - "IGNORE-FEA-T-U-RE" => "f6,f7,f7,f7", - "another_feature" => "another_value", - "Cmdline" => "splash=silent vga=0x314", - "Keyboard" => "1" - } - stub_install_inf(install_inf) + # PTOptions makes a command hidden from 'Cmdline' and creates + # a new install.inf entry using the exact name as it appears in PTOptions + # @see http://en.opensuse.org/SDB:Linuxrc#p_ptoptions + it "returns features set on commandline together with ptoptions" do + install_inf = { + "ignored_features" => "f1,f2,f3", + "IgnoReDfEAtuRes" => "f2,f4", + "i.g.n.o.r.e.d.features" => "f1,f5", + "IGNORE-FEA-T-U-RE" => "f6,f7,f7,f7", + "another_feature" => "another_value", + "Cmdline" => "splash=silent vga=0x314", + "Keyboard" => "1" + } + stub_install_inf(install_inf) - expect(Yast::InstFunctions.ignored_features.sort).to eq(["f1", "f2", "f3", "f4", "f5", "f6", "f7"]) - end + expect(Yast::InstFunctions.ignored_features.sort).to eq(["f1", "f2", "f3", "f4", "f5", "f6", "f7"]) + end - it "handles missing Cmdline in Linuxrc" do - install_inf = { - # Cmdline is not defined, bnc#861465 - "Cmdline" => nil - } - stub_install_inf(install_inf) + it "handles missing Cmdline in Linuxrc" do + install_inf = { + # Cmdline is not defined, bnc#861465 + "Cmdline" => nil + } + stub_install_inf(install_inf) - expect(Yast::InstFunctions.ignored_features.sort).to be_empty + expect(Yast::InstFunctions.ignored_features.sort).to be_empty + end end -end -describe "#feature_ignored?" do - before(:each) do - Yast::InstFunctions.reset_ignored_features - end + describe "#feature_ignored?" do + before(:each) do + Yast::InstFunctions.reset_ignored_features + end - it "should be true if feature is exactly set on commandline" do - linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3" + it "should be true if feature is exactly set on commandline" do + linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3" - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.feature_ignored?("feature2")).to eq(true) - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.feature_ignored?("feature2")).to eq(true) + end - it "should be true if feature is exactly on commandline using up/down case" do - linuxrc_commandline = "trash=install ignore_features=fEAture1 igno-RED_features=f-eatuRE_2 ignore_features=feature3" + it "should be true if feature is exactly on commandline using up/down case" do + linuxrc_commandline = "trash=install ignore_features=fEAture1 igno-RED_features=f-eatuRE_2 ignore_features=feature3" - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.feature_ignored?("f-e-a-t-u-r-e-2")).to eq(true) - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.feature_ignored?("f-e-a-t-u-r-e-2")).to eq(true) + end - it "should be true if feature is set on commandline with dashes and underscores" do - linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3" + it "should be true if feature is set on commandline with dashes and underscores" do + linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3" - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.feature_ignored?("f-e-a-t-u-r-e_2")).to eq(true) - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.feature_ignored?("f-e-a-t-u-r-e_2")).to eq(true) + end - it "should be false if feature is not set on commandline" do - linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3" + it "should be false if feature is not set on commandline" do + linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3" - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.feature_ignored?("no-such-feature")).to eq(false) - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.feature_ignored?("no-such-feature")).to eq(false) + end - it "should be false if feature to check is empty" do - linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3" + it "should be false if feature to check is empty" do + linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3" - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.feature_ignored?("")).to eq(false) - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.feature_ignored?("")).to eq(false) + end - it "should be false if feature to check is undefined" do - linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3" + it "should be false if feature to check is undefined" do + linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3" - allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) - expect(Yast::InstFunctions.feature_ignored?(nil)).to eq(false) - end + allow(Yast::Linuxrc).to receive(:InstallInf).and_return(linuxrc_commandline) + expect(Yast::InstFunctions.feature_ignored?(nil)).to eq(false) + end + + it "should be true if feature is mentioned as a separate install.inf entry or in Cmdline" do + install_inf = { + "ignored_features" => "f1,f2,f3", + "IgnoReDfEAtuRes" => "f2,f4", + "i.g.n.o.r.e.d.features" => "f1,f5", + "IGNORED-FEA-T-U-RES" => "f6,f7,f7,f7", + "another_feature" => "another_value", + "Cmdline" => "splash=silent vga=0x314 ignored_feature=f8", + "Keyboard" => "1" + } + stub_install_inf(install_inf) + + ["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8"].each do |key| + expect(Yast::InstFunctions.feature_ignored?(key)).to eq(true), "Key #{key} is not ignored" + end + end - it "should be true if feature is mentioned as a separate install.inf entry or in Cmdline" do - install_inf = { - "ignored_features" => "f1,f2,f3", - "IgnoReDfEAtuRes" => "f2,f4", - "i.g.n.o.r.e.d.features" => "f1,f5", - "IGNORED-FEA-T-U-RES" => "f6,f7,f7,f7", - "another_feature" => "another_value", - "Cmdline" => "splash=silent vga=0x314 ignored_feature=f8", - "Keyboard" => "1" - } - stub_install_inf(install_inf) + it "should be false if feature is not mentioned as a separate install.inf entry or in Cmdline" do + install_inf = { + "ignored_features" => "f1,f2,f3", + "IgnoReDfEAtuRes" => "f2,f4", + "i.g.n.o.r.e.d.features" => "f1,f5", + "IGNORE-FEA-T-U-RE" => "f6,f7,f7,f7", + "another_feature" => "another_value", + "Cmdline" => "splash=silent vga=0x314 ignored_feature=f8", + "Keyboard" => "1" + } + stub_install_inf(install_inf) - ["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8"].each do |key| - expect(Yast::InstFunctions.feature_ignored?(key)).to eq(true), "Key #{key} is not ignored" + expect(Yast::InstFunctions.feature_ignored?("f9")).to eq(false) end end - it "should be false if feature is not mentioned as a separate install.inf entry or in Cmdline" do - install_inf = { - "ignored_features" => "f1,f2,f3", - "IgnoReDfEAtuRes" => "f2,f4", - "i.g.n.o.r.e.d.features" => "f1,f5", - "IGNORE-FEA-T-U-RE" => "f6,f7,f7,f7", - "another_feature" => "another_value", - "Cmdline" => "splash=silent vga=0x314 ignored_feature=f8", - "Keyboard" => "1" - } - stub_install_inf(install_inf) + describe "#second_stage_required?" do + def stub_initialstage(bool) + allow(Yast::Stage).to receive(:initial).and_return(bool) + end + + def stub_autoinst(bool) + allow(Yast::Mode).to receive(:autoinst).and_return(bool) + end + + def stub_autoupgrade(bool) + allow(Yast::Mode).to receive(:autoupgrade).and_return(bool) + end - expect(Yast::InstFunctions.feature_ignored?("f9")).to eq(false) + def stub_secondstage(bool) + allow(Yast::AutoinstConfig).to receive(:second_stage).and_return(bool) + end + + before { allow(Yast::ProductControl).to receive(:RunRequired).and_return(true) } + + it "returns false when in initial stage" do + stub_initialstage(false) + expect(subject.second_stage_required?).to eq false + end + + context "when in autoinst mode" do + before do + stub_autoinst(true) + stub_autoupgrade(false) + stub_initialstage(true) + end + + it "returns true when second stage is defined in autoinst configuration" do + stub_secondstage(true) + expect(subject.second_stage_required?).to eq true + end + + it "returns false when second stage is not defined in autoinst configuration" do + stub_secondstage(false) + expect(subject.second_stage_required?).to eq false + end + end + + context "when in autoupgrade mode" do + before do + stub_autoinst(false) + stub_autoupgrade(true) + stub_initialstage(true) + end + + it "returns true when second stage is defined in autoinst configuration" do + stub_secondstage(true) + expect(subject.second_stage_required?).to eq true + end + + it "returns false when second stage is not defined in autoinst configuration" do + stub_secondstage(false) + expect(subject.second_stage_required?).to eq false + end + end + + context "when in neiter in autoinst nor in autoupgrade mode" do + before do + stub_autoinst(false) + stub_autoupgrade(false) + stub_initialstage(true) + end + + it "returns true when second stage is defined in autoinst configuration" do + stub_secondstage(true) + expect(subject.second_stage_required?).to eq true + end + + it "returns true when second stage is not defined in autoinst configuration" do + stub_secondstage(false) + expect(subject.second_stage_required?).to eq true + end + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/test/installation_misc_test.rb new/yast2-installation-3.1.159/test/installation_misc_test.rb --- old/yast2-installation-3.1.156/test/installation_misc_test.rb 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/test/installation_misc_test.rb 2015-09-04 09:24:11.000000000 +0200 @@ -8,89 +8,6 @@ include Yast::InstallationMiscInclude end -# we need to mock these modules -Yast.import "Stage" -Yast.import "Mode" -Yast.import "ProductControl" - -def stub_initialstage(bool) - allow(Yast::Stage).to receive(:initial).and_return(bool) -end - -def stub_autoinst(bool) - allow(Yast::Mode).to receive(:autoinst).and_return(bool) -end - -def stub_autoupgrade(bool) - allow(Yast::Mode).to receive(:autoupgrade).and_return(bool) -end - -def stub_secondstage(bool) - allow(Yast::AutoinstConfig).to receive(:second_stage).and_return(bool) -end - describe Yast::InstallationMiscInclude do - subject { InstallationMiscIncludeTest.new } - describe "#second_stage_required?" do - before { allow(Yast::ProductControl).to receive(:RunRequired).and_return(true) } - - it "returns false when in initial stage" do - stub_initialstage(false) - expect(subject.second_stage_required?).to eq false - end - - context "when in autoinst mode" do - before do - stub_autoinst(true) - stub_autoupgrade(false) - stub_initialstage(true) - end - - it "returns true when second stage is defined in autoinst configuration" do - stub_secondstage(true) - expect(subject.second_stage_required?).to eq true - end - - it "returns false when second stage is not defined in autoinst configuration" do - stub_secondstage(false) - expect(subject.second_stage_required?).to eq false - end - end - - context "when in autoupgrade mode" do - before do - stub_autoinst(false) - stub_autoupgrade(true) - stub_initialstage(true) - end - - it "returns true when second stage is defined in autoinst configuration" do - stub_secondstage(true) - expect(subject.second_stage_required?).to eq true - end - - it "returns false when second stage is not defined in autoinst configuration" do - stub_secondstage(false) - expect(subject.second_stage_required?).to eq false - end - end - - context "when in neiter in autoinst nor in autoupgrade mode" do - before do - stub_autoinst(false) - stub_autoupgrade(false) - stub_initialstage(true) - end - - it "returns true when second stage is defined in autoinst configuration" do - stub_secondstage(true) - expect(subject.second_stage_required?).to eq true - end - - it "returns true when second stage is not defined in autoinst configuration" do - stub_secondstage(false) - expect(subject.second_stage_required?).to eq true - end - end - end + pending end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.156/test/snapshots_finish_test.rb new/yast2-installation-3.1.159/test/snapshots_finish_test.rb --- old/yast2-installation-3.1.156/test/snapshots_finish_test.rb 2015-08-26 16:29:09.000000000 +0200 +++ new/yast2-installation-3.1.159/test/snapshots_finish_test.rb 2015-09-04 09:24:11.000000000 +0200 @@ -3,10 +3,12 @@ require_relative "./test_helper" require "installation/snapshots_finish" +Yast.import "InstFunctions" + describe ::Installation::SnapshotsFinish do describe "#write" do before do - allow(subject).to receive(:second_stage_required?).and_return(second_stage_required) + allow(Yast::InstFunctions).to receive(:second_stage_required?).and_return(second_stage_required) allow(Yast2::FsSnapshot).to receive(:configured?).and_return(snapper_configured) end