Skip to content

Commit

Permalink
Merge branch 'SLE-15-SP3' into merge_SLE-15-SP3
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Nov 25, 2021
2 parents 9b7b92f + 1264f78 commit 48774f5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
7 changes: 7 additions & 0 deletions package/autoyast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Nov 25 12:56:23 UTC 2021 - Knut Anderssen <kanderssen@suse.com>

- During autoupgrade merge the selected product workflow in order
to execute 2nd stage modules (bsc#1192437)
- 4.4.23

-------------------------------------------------------------------
Mon Nov 22 16:58:45 UTC 2021 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
%endif

Name: autoyast2
Version: 4.4.22
Version: 4.4.23
Release: 0
Summary: YaST2 - Automated Installation
License: GPL-2.0-only
Expand Down
10 changes: 6 additions & 4 deletions src/lib/autoinstall/clients/inst_autosetup_upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ def main
return :abort if UI.PollInput == :abort && Popup.ConfirmAbort(:painless)

Progress.NextStage

# configure general settings

#
# Set workflow variables
#
# Ensure that we clean product cache to avoid product from control (bsc#1156058)
AutoinstFunctions.reset_product
# Merging selected product (bsc#1192437)
AutoinstSoftware.merge_product(AutoinstFunctions.selected_product)

# configure general settings
general_section = Profile.current["general"] || {}
AutoinstGeneral.Import(general_section)
Builtins.y2milestone(
Expand Down
17 changes: 15 additions & 2 deletions test/lib/clients/inst_autosetup_upgrade_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
require "y2packager/resolvable"

describe Y2Autoinstallation::Clients::InstAutosetupUpgrade do
let(:product_name) { "sled" }
let(:profile) do
Yast::ProfileHash.new(
"general" => {},
"software" => {
"products" => ["sled"],
"products" => [product_name],
"patterns" => ["yast-devel"],
"packages" => ["vim"],
"remove-packages" => ["emacs"],
Expand All @@ -40,6 +41,10 @@
)
end

let(:product) do
Y2Packager::Product.new(name: product_name)
end

before do
allow(subject).to receive(:probe_storage)
allow(Yast::Packages).to receive(:Init)
Expand All @@ -56,6 +61,8 @@
allow(Yast::WFM).to receive(:SetLanguage)
allow(Yast::UI).to receive(:SetLanguage)
allow(Yast::AutoinstFunctions).to receive(:available_base_products).and_return([])
allow(Yast::AutoinstFunctions).to receive(:selected_product).and_return(product)
allow(Yast::AutoinstSoftware).to receive(:merge_product)
allow(Yast::Product).to receive(:FindBaseProducts).and_return([])
allow(Yast::ProductControl).to receive(:RunFrom).and_return(:next)
end
Expand All @@ -67,6 +74,12 @@
subject.main
end

it "merges the selected product workflow" do
expect(Yast::AutoinstSoftware).to receive(:merge_product).with(product)

subject.main
end

it "checks if upgrade is supported" do
Yast::RootPart.previousRootPartition = ""
Yast::RootPart.selectedRootPartition = "/dev/sda1"
Expand Down Expand Up @@ -96,7 +109,7 @@
end

it "install/removes patterns, products anad packages according to profile" do
expect(Yast::Pkg).to receive(:ResolvableInstall).with("sled", :product)
expect(Yast::Pkg).to receive(:ResolvableInstall).with(product_name, :product)
expect(Yast::Pkg).to receive(:ResolvableInstall).with("yast-devel", :pattern)
expect(Yast::Pkg).to receive(:ResolvableInstall).with("vim", :package)
expect(Yast::Pkg).to receive(:ResolvableRemove).with("emacs", :package)
Expand Down

0 comments on commit 48774f5

Please sign in to comment.