Skip to content

Commit

Permalink
bsc#1013976 in CASP (#472)
Browse files Browse the repository at this point in the history
* Document that self-update is disabled by default (#455)
* setting popup timeout in autoyast upgrade mode (#443 and #456)
* fix non-existing icon (bsc#988377)
* Do not crash when proposals are set in the AY profile (bsc#1013976)
  • Loading branch information
imobachgs committed Dec 7, 2016
1 parent 2321092 commit d49acd1
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 15 deletions.
2 changes: 1 addition & 1 deletion autoyast_desktop/ssh_import.desktop
Expand Up @@ -17,7 +17,7 @@ X-SuSE-YaST-AutoInstPath=install
X-SuSE-YaST-AutoInstSchema=ssh_import.rnc
X-SuSE-YaST-AutoInstClonable=true

Icon=yast-ssh_import
Icon=yast-ssh-server
Exec=

Name=SSH Key Import
Expand Down
9 changes: 5 additions & 4 deletions doc/SELF_UPDATE.md
Expand Up @@ -5,10 +5,11 @@ system installation. This feature will help to solve problems with the
installation even after the media has been released. Check
[FATE#319716](https://fate.suse.com/319716) for a more in-depth rationale.

## Disabling Updates
## Enabling Updates

Self-update is enabled by default. However, it can be disabled by setting
`self_update=0` boot option.
Self-update is disabled by default. However, it can be enabled by setting
`self_update=1` boot option. In the following sections it is assumed that this
feature is enabled.

## Basic Workflow

Expand Down Expand Up @@ -74,7 +75,7 @@ and the download bandwidth.
The URL of the update repository is evaluated in this order:

1. The `self_update` boot option
(Note: `self_update=0` completely disables the self-update!)
(Note: `self_update=1` will enable the self-update)
2. The AutoYaST profile - in AutoYaST installation only, use the
`/general/self_update_url` XML node:

Expand Down
13 changes: 13 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,16 @@
-------------------------------------------------------------------
Wed Dec 7 14:00:53 UTC 2016 - igonzalezsosa@suse.com

- Do not crash when the proposal screen is configured through
an AutoYaST profile and tabs are not being used (bsc#1013976)
- 3.1.217.2

-------------------------------------------------------------------
Tue Nov 22 12:27:17 UTC 2016 - jreidinger@suse.com

- fix missing icon next to SSH Key Import in autoyast
(bsc#988377)

-------------------------------------------------------------------
Fri Nov 18 15:10:49 UTC 2016 - jreidinger@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-installation.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-installation
Version: 3.1.217.1.1
Version: 3.1.217.2
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
6 changes: 3 additions & 3 deletions src/lib/installation/proposal_runner.rb
Expand Up @@ -604,11 +604,11 @@ def load_matching_submodules_list
# setup the list
@submodules_presentation = @store.presentation_order

p = Yast::AutoinstConfig.getProposalList
proposals = Yast::AutoinstConfig.getProposalList

if !p.nil? && p != []
if proposals && !proposals.empty?
# array intersection
@submodules_presentation &= v
@submodules_presentation &= proposals
end
end

Expand Down
101 changes: 95 additions & 6 deletions test/proposal_runner_test.rb
Expand Up @@ -4,11 +4,18 @@

require "installation/proposal_runner"

Yast.import "ProductControl"
Yast.import "GetInstArgs"
Yast.import "Mode"

describe ::Installation::ProposalRunner do
let(:autoyast_proposals) { [] }

before do
# mock constant to avoid dependency on autoyast
autoinst_config = double(Confirm: false)
autoinst_config = double(Confirm: false, getProposalList: autoyast_proposals)
stub_const("Yast::AutoinstConfig", autoinst_config)
allow(Yast::UI).to receive(:UserInput).and_return(:accept)
end

describe ".new" do
Expand All @@ -19,24 +26,106 @@ class C < ::Installation::ProposalStore; end
end

describe "#run" do
PROPERTIES = {
"enable_skip" => "no",
"label" => "Installation Settings",
"mode" => "autoinstallation",
"name" => "initial",
"stage" => "initial",
"unique_id" => "auto_inst_proposal",
"proposal_modules" => [
{ "name" => "hwinfo", "presentation_order" => "90" },
{ "name" => "keyboard", "presentation_order" => "15" }
]
}.freeze

let(:properties) { PROPERTIES }
let(:proposals) { [["keyboard_proposal", 90], ["hwinfo_proposal", 15]] }
let(:keyboard_description) do
{ "id" => "keyboard_stuff", "menu_title" => "&Keyboard Layout", "rich_text_title" => "Keyboard Layout" }
end
let(:hwinfo_description) do
{ "id" => "init_hwinfo", "menu_title" => "S&ystem", "rich_text_title" => "System" }
end

before do
allow(Yast::ProductControl).to receive(:getProposalProperties)
.and_return(properties)
allow(Yast::ProductControl).to receive(:getProposals)
.and_return(proposals)
allow_any_instance_of(::Installation::ProposalStore).to receive(:proposal_names)
.and_return(proposals.map(&:first))
allow(Yast::WFM).to receive(:CallFunction).and_call_original
allow(Yast::WFM).to receive(:CallFunction)
.with("keyboard_proposal", ["Description", {}]).and_return(keyboard_description)
allow(Yast::WFM).to receive(:CallFunction)
.with("hwinfo_proposal", ["Description", {}]).and_return(hwinfo_description)
end

it "do nothing if run non-interactive" do
Yast.import "Mode"
allow(Yast::Mode).to receive(:autoinst).and_return(true)

expect(subject.run).to eq :auto
end

it "do nothing if given proposal type is disabled" do
Yast.import "ProductControl"
Yast.import "GetInstArgs"
allow(Yast::ProductControl).to receive(:GetDisabledProposals).and_return(["initial"])
allow(Yast::GetInstArgs).to receive(:proposal).and_return("initial")

expect(subject.run).to eq :auto
end

it "passes a smoke test" do
expect { subject.run }.to_not raise_error
context "when proposal contains tabs" do
let(:properties) do
PROPERTIES.merge(
"proposal_tabs" => [
{ "label" => "Overview", "proposal_modules" => ["keyboard"] },
{ "label" => "Expert", "proposal_modules" => ["hwinfo", "keyboard"] }
]
)
end

it "makes a proposal" do
expect_any_instance_of(::Installation::ProposalStore).to receive(:make_proposal)
.with("keyboard_proposal", anything).and_return("preformatted_proposal" => "")
expect_any_instance_of(::Installation::ProposalStore).to receive(:make_proposal)
.with("hwinfo_proposal", anything).and_return("preformatted_proposal" => "")
expect(subject.run).to eq(:next)
end

context "and the proposal screen is configured through AutoYaST" do
let(:autoyast_proposals) { ["keyboard_proposal"] } # check bsc#1013976

it "makes a proposal" do
expect_any_instance_of(::Installation::ProposalStore).to receive(:make_proposal)
.with("keyboard_proposal", anything).and_return("preformatted_proposal" => "")
expect_any_instance_of(::Installation::ProposalStore).to receive(:make_proposal)
.with("hwinfo_proposal", anything).and_return("preformatted_proposal" => "")
expect(subject.run).to eq(:next)
end
end
end

context "when proposal does not contain tabs" do
it "makes a proposal" do
expect_any_instance_of(::Installation::ProposalStore).to receive(:make_proposal)
.with("keyboard_proposal", anything).and_return("preformatted_proposal" => "")
expect_any_instance_of(::Installation::ProposalStore).to receive(:make_proposal)
.with("hwinfo_proposal", anything).and_return("preformatted_proposal" => "")
expect(subject.run).to eq(:next)
end

context "and the proposal screen is configured through AutoYaST" do
let(:autoyast_proposals) { ["keyboard_proposal"] } # check bsc#1013976

it "makes a proposal" do
expect_any_instance_of(::Installation::ProposalStore).to receive(:make_proposal)
.with("keyboard_proposal", anything).and_return("preformatted_proposal" => "")
expect_any_instance_of(::Installation::ProposalStore).to receive(:make_proposal)
.with("hwinfo_proposal", anything).and_return("preformatted_proposal" => "")
expect(subject.run).to eq(:next)
end
end
end
end
end

0 comments on commit d49acd1

Please sign in to comment.