Skip to content

Commit

Permalink
Merge 70203c4 into 1b7447f
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jul 12, 2022
2 parents 1b7447f + 70203c4 commit 07edcd0
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
10 changes: 10 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Jul 11 15:54:15 UTC 2022 - Ladislav Slezák <lslezak@suse.cz>

- Run the registration step early only on the Online installation
medium which does not provide any packages. On the other media
run the registration step later.
Fixes crash in the SLE Micro when the AutoYaST profile enables
the registration step. (bsc#1200803)
- 4.5.2

-------------------------------------------------------------------
Tue May 3 15:00:22 UTC 2022 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -22,7 +22,7 @@
%endif

Name: autoyast2
Version: 4.5.1
Version: 4.5.2
Release: 0
Summary: YaST2 - Automated Installation
License: GPL-2.0-only
Expand Down
5 changes: 4 additions & 1 deletion src/lib/autoinstall/clients/inst_autoinit.rb
Expand Up @@ -4,6 +4,7 @@
require "autoinstall/importer"
require "y2packager/installation_medium"
require "y2packager/product_spec"
require "y2packager/medium_type"

Yast.import "AutoinstConfig"
Yast.import "AutoinstFunctions"
Expand Down Expand Up @@ -96,7 +97,9 @@ def run
autosetup_network if network_before_proposal? && !Yast::Mode.autoupgrade

# register the system early to get repositories from registration server
if Yast::Profile.current.fetch_as_hash(REGISTER_SECTION)["do_registration"] &&
# when using the Online medium, for the other media the registration is done later
if Y2Packager::MediumType.online? &&
Yast::Profile.current.fetch_as_hash(REGISTER_SECTION)["do_registration"] &&
!Yast::Mode.autoupgrade

register = suse_register
Expand Down
39 changes: 31 additions & 8 deletions test/lib/clients/inst_autoinit_test.rb
Expand Up @@ -155,16 +155,39 @@
context "when the registration is enabled according to the profile" do
let(:do_registration) { true }

it "registers the system" do
expect(Yast::WFM).to receive(:CallFunction)
.with("scc_auto", ["Import", profile["suse_register"]])
expect(Yast::WFM).to receive(:CallFunction).with("scc_auto", ["Write"])
# fake that registration is available to avoid build requires
allow(subject).to receive(:registration_module_available?).and_return(true)
allow(Yast::Profile).to receive(:remove_sections)
before do
expect(Y2Packager::MediumType).to receive(:online?).and_return(online_medium)
end

subject.run
context "on the Online medium" do
let(:online_medium) { true }

it "registers the system" do
expect(Yast::WFM).to receive(:CallFunction)
.with("scc_auto", ["Import", profile["suse_register"]])
expect(Yast::WFM).to receive(:CallFunction).with("scc_auto", ["Write"])
# fake that registration is available to avoid build requires
allow(subject).to receive(:registration_module_available?).and_return(true)
allow(Yast::Profile).to receive(:remove_sections)

subject.run
end
end

context "on the Full medium" do
let(:online_medium) { false }

it "does not register the system" do
allow(Yast::WFM).to receive(:CallFunction)
expect(Yast::WFM).to_not receive(:CallFunction).with("scc_auto", anything)
# fake that registration is available to avoid build requires
allow(subject).to receive(:registration_module_available?).and_return(true)
allow(Yast::Profile).to receive(:remove_sections)

subject.run
end
end

end

context "when the network is requested to be configured before the proposal" do
Expand Down

0 comments on commit 07edcd0

Please sign in to comment.