Hello community,

here is the log from the commit of package autoyast2 for openSUSE:Factory 
checked in at 2020-09-21 17:06:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old)
 and      /work/SRC/openSUSE:Factory/.autoyast2.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "autoyast2"

Mon Sep 21 17:06:40 2020 rev:289 rq:835787 version:4.3.51

Changes:
--------
--- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes      2020-09-15 
16:15:53.145889799 +0200
+++ /work/SRC/openSUSE:Factory/.autoyast2.new.4249/autoyast2.changes    
2020-09-21 17:08:48.999212985 +0200
@@ -1,0 +2,20 @@
+Fri Sep 18 12:20:10 CEST 2020 - [email protected]
+
+- Removing package evaluation via AY schema. Using autoyast(...)
+  supplements instead (bsc#1146494).
+- 4.3.51
+
+-------------------------------------------------------------------  
+Thu Sep 17 20:03:44 UTC 2020 - Knut Anderssen <[email protected]>
+
+- Import general and report sections in case that some pre-script
+  modified the profile (bsc#1175725)
+- 4.3.50
+
+-------------------------------------------------------------------
+Thu Sep 17 09:30:44 UTC 2020 - David Diaz <[email protected]>
+
+- Fix 'bcache_options' element using the right type (bsc#1176595)
+- 4.3.49
+
+-------------------------------------------------------------------

Old:
----
  autoyast2-4.3.48.tar.bz2

New:
----
  autoyast2-4.3.51.tar.bz2

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

Other differences:
------------------
++++++ autoyast2.spec ++++++
--- /var/tmp/diff_new_pack.eFGIE8/_old  2020-09-21 17:08:51.643215362 +0200
+++ /var/tmp/diff_new_pack.eFGIE8/_new  2020-09-21 17:08:51.647215365 +0200
@@ -22,7 +22,7 @@
 %endif
 
 Name:           autoyast2
-Version:        4.3.48
+Version:        4.3.51
 Release:        0
 Summary:        YaST2 - Automated Installation
 License:        GPL-2.0-only

++++++ autoyast2-4.3.48.tar.bz2 -> autoyast2-4.3.51.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.48/package/autoyast2.changes 
new/autoyast2-4.3.51/package/autoyast2.changes
--- old/autoyast2-4.3.48/package/autoyast2.changes      2020-09-14 
12:45:10.000000000 +0200
+++ new/autoyast2-4.3.51/package/autoyast2.changes      2020-09-21 
12:12:20.000000000 +0200
@@ -1,4 +1,24 @@
 -------------------------------------------------------------------
+Fri Sep 18 12:20:10 CEST 2020 - [email protected]
+
+- Removing package evaluation via AY schema. Using autoyast(...)
+  supplements instead (bsc#1146494).
+- 4.3.51
+
+-------------------------------------------------------------------  
+Thu Sep 17 20:03:44 UTC 2020 - Knut Anderssen <[email protected]>
+
+- Import general and report sections in case that some pre-script
+  modified the profile (bsc#1175725)
+- 4.3.50
+
+-------------------------------------------------------------------
+Thu Sep 17 09:30:44 UTC 2020 - David Diaz <[email protected]>
+
+- Fix 'bcache_options' element using the right type (bsc#1176595)
+- 4.3.49
+
+-------------------------------------------------------------------
 Mon Sep 14 10:34:41 UTC 2020 - Imobach Gonzalez Sosa <[email protected]>
 
 - Fix the returned value form the AutoinstPartPlan's Read method
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.48/package/autoyast2.spec 
new/autoyast2-4.3.51/package/autoyast2.spec
--- old/autoyast2-4.3.48/package/autoyast2.spec 2020-09-14 12:45:10.000000000 
+0200
+++ new/autoyast2-4.3.51/package/autoyast2.spec 2020-09-21 12:12:20.000000000 
+0200
@@ -22,7 +22,7 @@
 %endif
 
 Name:           autoyast2
-Version:        4.3.48
+Version:        4.3.51
 Release:        0
 Summary:        YaST2 - Automated Installation
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.48/src/autoyast-rnc/partitioning.rnc 
new/autoyast2-4.3.51/src/autoyast-rnc/partitioning.rnc
--- old/autoyast2-4.3.48/src/autoyast-rnc/partitioning.rnc      2020-09-14 
12:45:10.000000000 +0200
+++ new/autoyast2-4.3.51/src/autoyast-rnc/partitioning.rnc      2020-09-21 
12:12:20.000000000 +0200
@@ -156,7 +156,7 @@
 }
 
 cache_mode = element cache_mode { STRING_ATTR, ("writethrough" | "writeback" | 
"writearound" | "none") }
-bcache_options = element bcache_options { cache_mode? }
+bcache_options = element bcache_options { MAP, (cache_mode?) }
 
 btrfs_name = element btrfs_name { STRING }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.48/src/clients/inst_autoconfigure.rb 
new/autoyast2-4.3.51/src/clients/inst_autoconfigure.rb
--- old/autoyast2-4.3.48/src/clients/inst_autoconfigure.rb      2020-09-14 
12:45:10.000000000 +0200
+++ new/autoyast2-4.3.51/src/clients/inst_autoconfigure.rb      2020-09-21 
12:12:20.000000000 +0200
@@ -87,7 +87,7 @@
         log.error "Could not process these unknown profile sections: 
#{unknown_sections}"
         needed_packages = Y2Autoinstallation::PackagerSearcher.new(
           unknown_sections
-        ).evaluate_via_schema
+        ).evaluate_via_rpm
         schema_package_list = if needed_packages.empty?
           unknown_sections.map { |section| "&lt;#{section}/&gt;" }
         else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autoyast2-4.3.48/src/lib/autoinstall/clients/inst_autoinit.rb 
new/autoyast2-4.3.51/src/lib/autoinstall/clients/inst_autoinit.rb
--- old/autoyast2-4.3.48/src/lib/autoinstall/clients/inst_autoinit.rb   
2020-09-14 12:45:10.000000000 +0200
+++ new/autoyast2-4.3.51/src/lib/autoinstall/clients/inst_autoinit.rb   
2020-09-21 12:12:20.000000000 +0200
@@ -177,10 +177,18 @@
         end
 
         # reimport scripts, for the case <ask> has changed them
-        Yast::AutoinstScripts.Import(Yast::Profile.current["scripts"] || {})
+        import_initial_config if modified_profile?
         :ok
       end
 
+      # Imports the initial profile configuration (report, general and
+      # pre-scripts sections)
+      def import_initial_config
+        Yast::Report.Import(Yast::Profile.current.fetch("report", {}))
+        Yast::AutoinstGeneral.Import(Yast::Profile.current.fetch("general", 
{}))
+        Yast::AutoinstScripts.Import(Yast::Profile.current.fetch("scripts", 
{}))
+      end
+
       # Checking profile for unsupported sections.
       def check_unsupported_profile_sections
         unsupported_sections = 
Y2Autoinstallation::Importer.new(Yast::Profile.current)
@@ -263,8 +271,7 @@
         Yast::Progress.NextStage
         Yast::Progress.Title(_("Initial Configuration"))
         log.info "Initial Configuration"
-        Yast::Report.Import(Yast::Profile.current.fetch("report", {}))
-        Yast::AutoinstGeneral.Import(Yast::Profile.current.fetch("general", 
{}))
+        import_initial_config
 
         #
         # Copy the control file for easy access by user to  a pre-defined
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autoyast2-4.3.48/src/lib/autoinstall/package_searcher.rb 
new/autoyast2-4.3.51/src/lib/autoinstall/package_searcher.rb
--- old/autoyast2-4.3.48/src/lib/autoinstall/package_searcher.rb        
2020-09-14 12:45:10.000000000 +0200
+++ new/autoyast2-4.3.51/src/lib/autoinstall/package_searcher.rb        
2020-09-21 12:12:20.000000000 +0200
@@ -67,72 +67,8 @@
       package_names
     end
 
-    # Gets packages that needs to be installed via the schema file
-    # @return [Hash<String, Array<String>>] Required packages of a section. 
Return only
-    #   packages that are not already installed.
-    def evaluate_via_schema
-      package_names = {}
-      log.info "Evaluating needed packages via schema for handling AY-sections 
via schema entries."
-      log.info "Sections: #{sections}"
-
-      if !File.exist?(SCHEMA_PACKAGE_FILE)
-        log.error "Cannot evaluate due to missing yast2-schema"
-        return package_names
-      end
-
-      sections.each do |section|
-        # Evaluate which *rng file belongs to the given section
-        package_names[section] = []
-        ret = Yast::SCR.Execute(Yast::Path.new(".target.bash_output"),
-          "/usr/bin/grep -l \"<define name=\\\"#{section}\\\">\" 
#{YAST_SCHEMA_DIR}")
-        if ret["exit"] == 0
-          ret["stdout"].split.uniq.each do |rng_file|
-            # Evaluate package name to which this rng file belongs to.
-            package = package_name_of_schema(File.basename(rng_file, ".rng"))
-            if package
-              package_names[section] << package unless 
Yast::PackageSystem.Installed(package)
-            else
-              log.info("No package belongs to #{rng_file}.")
-            end
-          end
-        else
-          log.info("Cannot evaluate needed packages for AY section #{section}: 
#{ret.inspect}")
-        end
-      end
-
-      package_names
-    end
-
   private
 
-    YAST_SCHEMA_DIR = "/usr/share/YaST2/schema/autoyast/rng/*.rng".freeze
-    private_constant :YAST_SCHEMA_DIR
-    SCHEMA_PACKAGE_FILE = 
"/usr/share/YaST2/schema/autoyast/rnc/includes.rnc".freeze
-    private_constant :SCHEMA_PACKAGE_FILE
-    SCHEMA_LINE_ELEMENTS = 4
-    private_constant :SCHEMA_LINE_ELEMENTS
-
     attr_reader :sections
-
-    # Returns package name of a given schema.
-    # This information is stored in 
/usr/share/YaST2/schema/autoyast/rnc/includes.rnc
-    # which will be provided by the yast2-schema package.
-    #
-    # @param schema [String] schema name like firewall, firstboot, ...
-    # @return [String, nil] package name or nil if no package found
-    def package_name_of_schema(schema)
-      if !@schema_package
-        @schema_package = {}
-        File.readlines(SCHEMA_PACKAGE_FILE).each do |line|
-          line_split = line.split
-          next if line.split.size < SCHEMA_LINE_ELEMENTS # Old version of 
yast2-schema
-
-          # example line
-          #   include 'ntpclient.rnc' # yast2-ntp-client
-          @schema_package[File.basename(line_split[1].delete("\'"), ".rnc")] = 
line.split.last
-        end
-      end
-      @schema_package[schema]
-    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.48/src/modules/AutoInstallRules.rb 
new/autoyast2-4.3.51/src/modules/AutoInstallRules.rb
--- old/autoyast2-4.3.48/src/modules/AutoInstallRules.rb        2020-09-14 
12:45:10.000000000 +0200
+++ new/autoyast2-4.3.51/src/modules/AutoInstallRules.rb        2020-09-21 
12:12:20.000000000 +0200
@@ -808,7 +808,7 @@
       deep_copy(@tomerge)
     end
 
-    # Retrieves the files to merge
+    # Retrieves the rules files to merge
     #
     # @return [Boolean] true if the files were retrieved; false otherwise
     def GetRules
@@ -949,21 +949,8 @@
       ok
     end
 
-    # Process Rules
-    # @param [String] result_profile
-    # @return [Boolean]
-    def Process(result_profile)
-      ok = true
-      prefinal = Ops.add(
-        AutoinstConfig.local_rules_location,
-        "/prefinal_autoinst.xml"
-      )
-      return false if !Merge(prefinal)
-
-      @tomerge = []
-
-      # Now check if there any classes defined in theis pre final control file
-      if !Profile.ReadXML(prefinal)
+    def read_xml(profile)
+      if !Profile.ReadXML(profile)
         Popup.Error(
           _(
             "Error while parsing the control file.\n" \
@@ -973,48 +960,56 @@
         )
         return false
       end
-      Builtins.y2milestone("Checking classes...")
-      if Builtins.haskey(Profile.current, "classes")
-        Builtins.y2milestone("User defined classes available, processing....")
-        classes = Ops.get_list(Profile.current, "classes", [])
-        Builtins.foreach(classes) do |_class|
-          # backdoor for merging problems.
-          if Builtins.haskey(_class, "dont_merge")
-            AutoinstConfig.dontmerge = [] if @dontmergeIsDefault
-            AutoinstConfig.dontmerge = Convert.convert(
-              Builtins.union(
-                AutoinstConfig.dontmerge,
-                Ops.get_list(_class, "dont_merge", [])
-              ),
-              from: "list",
-              to:   "list <string>"
-            )
-            @dontmergeIsDefault = false
-            Builtins.y2milestone(
-              "user defined dont_merge for class found. dontmerge is %1",
-              AutoinstConfig.dontmerge
-            )
-          end
-          @tomerge = Builtins.add(
-            @tomerge,
-            Ops.add(
-              Ops.add(
-                Ops.add(
-                  "classes/",
-                  Ops.get_string(_class, "class_name", "none")
-                ),
-                "/"
-              ),
-              Ops.get_string(_class, "configuration", "none")
-            )
-          )
-        end
 
-        Builtins.y2milestone("New files to process: %1", @tomerge)
-        @Behaviour = :multiple
-        ret = GetRules()
-        if ret
-          @tomerge = Builtins.prepend(@tomerge, "prefinal_autoinst.xml")
+      true
+    end
+
+    # When there are classes defined in the profile it adds mergeable
+    # configurations to the list of files to be merged.
+    #
+    # @return [Boolean] true when there are configurations to be merged; false
+    #   otherwise
+    def classes_to_merge
+      # Now check if there are any classes defined in the pre final control 
file
+      log.info("Checking classes...")
+      return false unless (Profile.current || {}).keys.include?("classes")
+
+      log.info("User defined classes available, processing....")
+      classes = Profile.current["classes"]
+      classes.each do |profile_class|
+        # backdoor for merging problems.
+        if profile_class.keys.include?("dont_merge")
+          AutoinstConfig.dontmerge = [] if @dontmergeIsDefault
+          not_mergeable = profile_class.fetch("dont_merge", [])
+          AutoinstConfig.dontmerge = Builtins.union(AutoinstConfig.dontmerge 
|| [], not_mergeable)
+          @dontmergeIsDefault = false
+          log.info("user defined dont_merge for class found. " \
+                   "dontmerge is #{AutoinstConfig.dontmerge}")
+        end
+        class_name = profile_class.fetch("class_name", "none")
+        file_name  = profile_class.fetch("configuration", "none")
+        @tomerge << File.join("classes", class_name, file_name)
+      end
+
+      log.info("New files to process: #{@tomerge.inspect}")
+      @Behaviour = :multiple
+
+      true
+    end
+
+    # Process Rules
+    # @param [String] result_profile
+    # @return [Boolean]
+    def Process(result_profile)
+      prefinal = File.join(AutoinstConfig.local_rules_location, 
"prefinal_autoinst.xml")
+      return false if !Merge(prefinal)
+      return false if !read_xml(prefinal)
+
+      ok = true
+      @tomerge = []
+      if classes_to_merge
+        if GetRules()
+          @tomerge.prepend("prefinal_autoinst.xml")
           ok = Merge(result_profile)
         else
           Report.Error(
@@ -1028,18 +1023,13 @@
           )
 
           ok = false
-          SCR.Execute(
-            path(".target.bash"),
-            Ops.add(Ops.add(Ops.add("cp ", prefinal), " "), result_profile)
-          )
+          SCR.Execute(path(".target.bash"), "cp #{prefinal} #{result_profile}")
         end
       else
-        SCR.Execute(
-          path(".target.bash"),
-          Ops.add(Ops.add(Ops.add("cp ", prefinal), " "), result_profile)
-        )
+        SCR.Execute(path(".target.bash"), "cp #{prefinal} #{result_profile}")
       end
-      Builtins.y2milestone("returns=%1", ok)
+
+      log.info("returns=#{ok}")
       ok
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.48/src/modules/AutoinstSoftware.rb 
new/autoyast2-4.3.51/src/modules/AutoinstSoftware.rb
--- old/autoyast2-4.3.48/src/modules/AutoinstSoftware.rb        2020-09-14 
12:45:10.000000000 +0200
+++ new/autoyast2-4.3.51/src/modules/AutoinstSoftware.rb        2020-09-21 
12:12:20.000000000 +0200
@@ -187,45 +187,6 @@
           true
         end
       end
-
-      # Evaluating packages for not founded entries via desktop file and rnc 
files.
-      entries.each do |e|
-        registry = Y2Autoinstallation::Entries::Registry.instance
-        description = registry.descriptions.find { |d| 
d.managed_keys.include?(e) }
-        # if needed taking default because no entry has been defined in the 
*.desktop file
-        yast_module = description ? description.module_name : e
-        # FIXME: Does not work see below
-        #
-        # This does currently not work at all as the packages provide this
-        # with the module name camel-cased; e.g.:
-        #
-        #   application(YaST2/org.opensuse.yast.Kdump.desktop)
-        #
-        # As there's no way to predict which letters are upper-cased this 
cannot work at all.
-        #
-        # The fallback method via #required_packages relies on a
-        # pre-calculated data set which may or may not reflect the
-        # dependencies of the packages in the repo.
-        #
-        # This area should be re-thought entirely.
-        #
-        provide = "application(YaST2/org.opensuse.yast.#{yast_module}.desktop)"
-
-        packages = Pkg.PkgQueryProvides(provide)
-        if packages.empty?
-          packs = 
Y2Autoinstallation::PackagerSearcher.new([e]).evaluate_via_schema[e]
-          if packs.nil? || packs.empty?
-            log.info "No package provides: #{provide}"
-          else
-            log.info "AddYdepsFromProfile add packages #{packs} for entry #{e}"
-            pkglist += packs
-          end
-        else
-          name = packages[0][0]
-          log.info "AddYdepsFromProfile add package #{name} for entry #{e}"
-          pkglist.push(name) if !pkglist.include?(name)
-        end
-      end
       pkglist.uniq!
       Builtins.y2milestone("AddYdepsFromProfile pkglist %1", pkglist)
       add_additional_packages(pkglist)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.48/test/AutoInstallRules_test.rb 
new/autoyast2-4.3.51/test/AutoInstallRules_test.rb
--- old/autoyast2-4.3.48/test/AutoInstallRules_test.rb  2020-09-14 
12:45:10.000000000 +0200
+++ new/autoyast2-4.3.51/test/AutoInstallRules_test.rb  2020-09-21 
12:12:20.000000000 +0200
@@ -511,6 +511,146 @@
         )
       end
     end
+  end
+
+  describe "#Process" do
+    let(:tmp_dir) { Dir.mktmpdir("YaST-") }
+    let(:config) do
+      double(
+        "AutoinstConfig",
+        scheme: "https", host: "example.net", directory: "",
+        local_rules_location: local_rules_location, tmpDir: tmp_dir
+      )
+    end
+
+    let(:output) { File.join(tmp_dir, "output.xml") }
+    let(:local_rules_location) { File.join(tmp_dir, "rules") }
+    let(:prefinal_profile_path) { File.join(local_rules_location, 
"prefinal_autoinst.xml") }
+    let(:tomerge) { ["profiles/base.xml", "profiles/disks.xml"] }
+    let(:classes) { false }
+
+    before do
+      stub_const("Yast::AutoinstConfig", config)
+      allow(subject).to receive(:Merge).and_return(true)
+      allow(subject).to receive(:read_xml).and_return(true)
+      allow(subject).to receive(:classes_to_merge).and_return(:classes)
+      allow(Yast::SCR).to receive(:Execute)
+    end
+
+    after do
+      FileUtils.remove_entry(tmp_dir) if Dir.exist?(tmp_dir)
+    end
+
+    it "merges the rules already read into a prefinal profile" do
+      expect(subject).to receive(:Merge).with(prefinal_profile_path)
+
+      subject.Process(output)
+    end
+
+    it "reads classes defined in the prefinal profile" do
+      expect(subject).to receive(:classes_to_merge).and_return(classes)
+
+      subject.Process(output)
+    end
+
+    context "when there are no classes to be merged" do
+      it "copies the prefinal profile to the path given" do
+        expect(Yast::SCR).to receive(:Execute)
+          .with(Yast::Path.new(".target.bash"), "cp #{prefinal_profile_path} 
#{output}")
+
+        subject.Process(output)
+      end
+    end
+
+    context "when there are classes to be merged" do
+      let(:get_rules) { true }
+      let(:classes) { true }
+
+      before do
+        allow(subject).to receive(:GetRules).and_return(get_rules)
+      end
+
+      context "and get the classes files correctly" do
+        it "merges the prefinal profile with the classes ones to the given 
path" do
+          expect(subject).to 
receive(:Merge).with(prefinal_profile_path).and_return(true)
+          expect(subject).to receive(:Merge).with(output)
+
+          subject.Process(output)
+        end
+
+        it "returns true" do
+          expect(subject.Process(output)).to eql(true)
+        end
+      end
 
+      context "and do not get the files correctly" do
+        let(:get_rules) { false }
+
+        it "reports an error" do
+          expect(Yast::Report).to receive(:Error)
+
+          subject.Process(output)
+        end
+
+        it "copies the prefinal profile to the path given" do
+          expect(Yast::SCR).to receive(:Execute)
+            .with(Yast::Path.new(".target.bash"), "cp #{prefinal_profile_path} 
#{output}")
+
+          subject.Process(output)
+        end
+
+        it "returns false" do
+          expect(subject.Process(output)).to eql(false)
+        end
+      end
+    end
+  end
+
+  describe "#classes_to_merge" do
+    let(:profile_def) do
+      { "classes" => [
+        {
+          "class_name"    => "TrainingRoom",
+          "configuration" => "Software.xml",
+          "dont_merge"    => dont_merge
+        }
+      ] }
+    end
+
+    let(:profile) { double("Profile", current: profile_def) }
+    let(:dont_merge) { [] }
+    # let(:config) { double("AutoinstConfig", dontmerge: []) }
+
+    before do
+      stub_const("Yast::Profile", profile)
+      # stub_const("Yast::AutoinstConfig", config)
+      subject.tomerge = []
+      Yast::AutoinstConfig.dontmerge = []
+    end
+
+    context "when there are no classes defined in the profile" do
+      let(:profile_def) { {} }
+
+      it "returns false" do
+        expect(subject.classes_to_merge).to eql(false)
+      end
+    end
+
+    context "when there classes defined in the profile" do
+      let(:tomerge) { ["classes/TrainingRoom/Software.xml"] }
+
+      it "adds the configuration file to the list of files to be merged" do
+        expect { subject.classes_to_merge }.to change { subject.tomerge 
}.from([]).to(tomerge)
+      end
+
+      context "and the classes defines sections to not be merged" do
+        let(:dont_merge) { ["partition", "software"] }
+
+        it "adds the sections to the list of not mergeable" do
+          expect { subject.classes_to_merge }
+            .to change { Yast::AutoinstConfig.dontmerge 
}.from([]).to(dont_merge)
+        end
+      end
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autoyast2-4.3.48/test/lib/clients/inst_autoinit_test.rb 
new/autoyast2-4.3.51/test/lib/clients/inst_autoinit_test.rb
--- old/autoyast2-4.3.48/test/lib/clients/inst_autoinit_test.rb 2020-09-14 
12:45:10.000000000 +0200
+++ new/autoyast2-4.3.51/test/lib/clients/inst_autoinit_test.rb 2020-09-21 
12:12:20.000000000 +0200
@@ -174,5 +174,57 @@
     end
 
     #  TODO: more test for profile processing
+    it "reports a warning with the list of unsupported section when present in 
the profile" do
+      allow_any_instance_of(Y2Autoinstallation::Importer).to 
receive(:obsolete_sections)
+        .and_return(["unsupported"])
+
+      expect(Yast::Report).to receive(:LongWarning)
+      subject.run
+    end
+
+    context "when pre-scripts are defined" do
+      let(:scripts_return) { :ok }
+      let(:read_modified) { :not_found }
+      let(:modified) { false }
+
+      before do
+        allow(subject).to receive(:autoinit_scripts).and_return(scripts_return)
+        allow(subject).to receive(:readModified).and_return(read_modified)
+        allow(Yast::AutoinstScripts).to receive(:Import)
+        allow(Yast::AutoinstScripts).to receive(:Write)
+        allow(subject).to receive(:import_initial_config)
+        allow(subject).to receive(:modified_profile?).and_return(modified)
+      end
+
+      it "runs pre-scripts" do
+        expect(subject).to receive(:autoinit_scripts)
+        subject.run
+      end
+
+      context "when the pre-scripts modify the profile" do
+        let(:modified) { true }
+
+        it "imports the initial configuration (report, general and scripts)" do
+          expect(subject).to receive(:import_initial_config)
+
+          subject.run
+        end
+      end
+
+      context "when applying pre-scripts return :ok" do
+        it "finishes the Progress" do
+          expect(Yast::Progress).to receive(:Finish)
+          subject.run
+        end
+      end
+
+      context "when applying pre-scripts do not return :ok" do
+        let(:scripts_return) { :restart_yast }
+
+        it "returns what was returned by the call" do
+          expect(subject.run).to eq(:restart_yast)
+        end
+      end
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.48/test/lib/package_searcher_test.rb 
new/autoyast2-4.3.51/test/lib/package_searcher_test.rb
--- old/autoyast2-4.3.48/test/lib/package_searcher_test.rb      2020-09-14 
12:45:10.000000000 +0200
+++ new/autoyast2-4.3.51/test/lib/package_searcher_test.rb      2020-09-21 
12:12:20.000000000 +0200
@@ -30,51 +30,6 @@
                                                     ])
   end
 
-  describe "#evaluate_via_schema" do
-    context "no package belongs to section" do
-      let(:sections) { ["nis"] }
-      it "returns hash with section and empty array" do
-        allow(Yast::SCR).to receive(:Execute).and_return(
-          "exit"   => 0,
-          "stdout" => "/usr/share/YaST2/schema/autoyast/rng/nis.rng",
-          "stderr" => ""
-        )
-
-        expect(subject.evaluate_via_schema).to eq("nis" => [])
-      end
-    end
-
-    context "package belonging to section is already installed" do
-      let(:sections) { ["add-on"] }
-      it "returns hash with section and empty array" do
-        allow(Yast::SCR).to receive(:Execute).and_return(
-          "exit"   => 0,
-          "stdout" => "/usr/share/YaST2/schema/autoyast/rng/add-on.rng",
-          "stderr" => ""
-        )
-
-        allow(Yast::PackageSystem).to receive(:Installed).and_return(true)
-
-        expect(subject.evaluate_via_schema).to eq("add-on" => [])
-      end
-    end
-
-    context "package belonging to section is not installed" do
-      let(:sections) { ["audit-laf"] }
-      it "returns hash with section and array with package" do
-        allow(Yast::SCR).to receive(:Execute).and_return(
-          "exit"   => 0,
-          "stdout" => "/usr/share/YaST2/schema/autoyast/rng/audit-laf.rng",
-          "stderr" => ""
-        )
-
-        allow(Yast::PackageSystem).to receive(:Installed).and_return(false)
-
-        expect(subject.evaluate_via_schema).to eq("audit-laf" => 
["yast2-audit-laf"])
-      end
-    end
-  end
-
   describe "#evaluate_via_rpm" do
     let(:packages) do
       [


Reply via email to