Hello community, here is the log from the commit of package autoyast2 for openSUSE:Factory checked in at 2018-09-07 15:41:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old) and /work/SRC/openSUSE:Factory/.autoyast2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "autoyast2" Fri Sep 7 15:41:35 2018 rev:248 rq:633710 version:4.0.61 Changes: -------- --- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes 2018-09-04 22:50:04.727749053 +0200 +++ /work/SRC/openSUSE:Factory/.autoyast2.new/autoyast2.changes 2018-09-07 15:41:44.306386028 +0200 @@ -1,0 +2,7 @@ +Thu Aug 23 14:25:55 CEST 2018 - [email protected] + +- AutoInstallRules: Fixed crash while merging profiles. + (bsc#1105711) +- 4.0.61 + +------------------------------------------------------------------- Old: ---- autoyast2-4.0.60.tar.bz2 New: ---- autoyast2-4.0.61.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ autoyast2.spec ++++++ --- /var/tmp/diff_new_pack.1I9dFa/_old 2018-09-07 15:41:44.758385544 +0200 +++ /var/tmp/diff_new_pack.1I9dFa/_new 2018-09-07 15:41:44.758385544 +0200 @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.0.60 +Version: 4.0.61 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ autoyast2-4.0.60.tar.bz2 -> autoyast2-4.0.61.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.0.60/package/autoyast2.changes new/autoyast2-4.0.61/package/autoyast2.changes --- old/autoyast2-4.0.60/package/autoyast2.changes 2018-08-22 10:08:42.000000000 +0200 +++ new/autoyast2-4.0.61/package/autoyast2.changes 2018-08-23 15:55:06.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Aug 23 14:25:55 CEST 2018 - [email protected] + +- AutoInstallRules: Fixed crash while merging profiles. + (bsc#1105711) +- 4.0.61 + +------------------------------------------------------------------- Tue Aug 21 08:01:33 UTC 2018 - [email protected] - AutoInstallRules: increased default maxdepth for not crashing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.0.60/package/autoyast2.spec new/autoyast2-4.0.61/package/autoyast2.spec --- old/autoyast2-4.0.60/package/autoyast2.spec 2018-08-22 10:08:42.000000000 +0200 +++ new/autoyast2-4.0.61/package/autoyast2.spec 2018-08-23 15:55:06.000000000 +0200 @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.0.60 +Version: 4.0.61 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.0.60/src/modules/AutoInstallRules.rb new/autoyast2-4.0.61/src/modules/AutoInstallRules.rb --- old/autoyast2-4.0.60/src/modules/AutoInstallRules.rb 2018-08-22 10:08:42.000000000 +0200 +++ new/autoyast2-4.0.61/src/modules/AutoInstallRules.rb 2018-08-23 15:55:06.000000000 +0200 @@ -910,13 +910,13 @@ # @param [String] result_profile the resulting control file path # @return [Boolean] true on success def Merge(result_profile) - base_profile = File.join(AutoinstConfig.tmpdir, "base_profile.xml") - merge_profile = File.join(AutoinstConfig.tmpdir, "result.xml") + base_profile = File.join(AutoinstConfig.tmpDir, "base_profile.xml") + merge_profile = File.join(AutoinstConfig.tmpDir, "result.xml") ok = true skip = false error = false @tomerge.each do |file| - log.info("Working on file: %1", file) + log.info("Working on file: #{file}") current_profile = File.join(AutoinstConfig.local_rules_location, file) if !skip if !XML_cleanup(current_profile, base_profile) @@ -932,7 +932,7 @@ elsif !error xsltret = merge_profiles(base_profile, current_profile, merge_profile) - log.info("Merge result: %1", xsltret) + log.info("Merge result: #{xsltret}") if xsltret["exit"] != 0 || xsltret.fetch("stderr", "") != "" log.error("Merge Failed") StdErrLog(xsltret.fetch("stderr", "")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.0.60/test/AutoInstallRules_test.rb new/autoyast2-4.0.61/test/AutoInstallRules_test.rb --- old/autoyast2-4.0.60/test/AutoInstallRules_test.rb 2018-08-22 10:08:42.000000000 +0200 +++ new/autoyast2-4.0.61/test/AutoInstallRules_test.rb 2018-08-23 15:55:06.000000000 +0200 @@ -279,4 +279,52 @@ end end end + + describe '#Merge' do + let(:tmp_dir) { File.join(root_path, 'tmp') } + let(:result_path) { File.join(tmp_dir, 'result.xml') } + let(:second_path) { File.join(tmp_dir, 'second.xml') } + let(:base_profile_path) { File.join(tmp_dir, 'base_profile.xml') } + + around(:each) do |example| + FileUtils.rm_rf(tmp_dir) if Dir.exist?(tmp_dir) + FileUtils.mkdir(tmp_dir) + example.run + FileUtils.rm_rf(tmp_dir) + end + + before(:each) do + allow(Yast::AutoinstConfig).to receive(:tmpDir).and_return(tmp_dir) + allow(Yast::AutoinstConfig).to receive(:local_rules_location).and_return(tmp_dir) + subject.reset + end + + context 'when no XML profile has been given to merge' do + it 'does not read and merge any XML profile' do + expect(subject).to_not receive(:merge_profiles) + expect(subject).not_to receive(:XML_cleanup) + expect(subject.Merge(result_path)).to eq(true) + end + end + + context 'when only one XML profile is given' do + it 'does read but not merge this XML profile' do + subject.CreateFile("first.xml") + expect(subject).to_not receive(:merge_profiles) + expect(subject).to receive(:XML_cleanup).at_least(:once).and_return(true) + expect(subject.Merge(result_path)).to eq(true) + end + end + + context 'when two XML profiles are given' do + it 'merges two XML profiles' do + subject.CreateFile("first.xml") + subject.CreateFile("second.xml") + expect(subject).to receive(:XML_cleanup).at_least(:once).and_return(true) + expect(subject).to receive(:merge_profiles).with(base_profile_path, + second_path, result_path).and_return({ 'exit' => 0, 'stderr' => '', 'stdout' => '' }) + expect(subject.Merge(result_path)).to eq(true) + end + end + end end
