Skip to content

Commit

Permalink
Remove fixes for self_update not needed anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Aug 19, 2016
1 parent cc4bce3 commit d1565c7
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 124 deletions.
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Aug 19 11:15:21 UTC 2016 - kanderssen@suse.com

- Removing remember state fix related to update_installre from
inst_complex_welcome and from disk_activation
- 3.1.210

-------------------------------------------------------------------
Tue Aug 16 15:34:43 UTC 2016 - kanderssen@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-installation.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-installation
Version: 3.1.208
Version: 3.1.210
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
35 changes: 0 additions & 35 deletions src/lib/installation/clients/inst_complex_welcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ def main
@license_id = Ops.get(Pkg.SourceGetCurrent(true), 0, 0)

# ------------------------------------- main part of the client -----------
if Installation.restarting? && data_stored?
apply_data
return :next
end

@argmap = GetInstArgs.argmap

Expand Down Expand Up @@ -127,8 +123,6 @@ def event_loop

setup_final_choice

store_data

return :next
when :show_fulscreen_license
UI.OpenDialog(all_licenses_dialog)
Expand Down Expand Up @@ -383,35 +377,6 @@ def setup_final_choice
log.info "Language: '#{@language}', system encoding '#{WFM.GetEncoding}'"
end

DATA_PATH = "/var/lib/YaST2/complex_welcome_store.yaml".freeze

def data_stored?
::File.exist?(DATA_PATH)
end

def store_data
data = {
"language" => @language,
"keyboard" => @keyboard,
"license_accepted" => InstData.product_license_accepted
}

File.write(DATA_PATH, data.to_yaml)
end

def apply_data
data = YAML.load(File.read(DATA_PATH))
@language = data["language"]
@keyboard = data["keyboard"]
InstData.product_license_accepted = data["license_accepted"]
ProductLicense.info_seen!(@license_id)

change_language
setup_final_choice

::FileUtils.rm_rf(DATA_PATH)
end

def text_mode?
return @text_mode unless @text_mode.nil?

Expand Down
2 changes: 0 additions & 2 deletions src/lib/installation/clients/inst_disks_activate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ def main
@have_zfcp = false
@want_fcoe = false

return :next if Installation.restarting?

if Arch.s390
# popup label
UI.OpenDialog(Label(_("Detecting Available Controllers")))
Expand Down
123 changes: 48 additions & 75 deletions test/inst_complex_welcome_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,105 +44,78 @@
allow(Yast::Installation).to receive(:restarting?) { restarting }
end

context "and installer is restarting" do
let(:restarting) { true }
it "applies data if exists and returns next" do
allow(subject).to receive(:data_stored?) { true }
expect(subject).to receive(:apply_data)
it "initializes dialog" do
allow(subject).to receive(:event_loop)
expect(subject).to receive(:initialize_dialog)

expect(subject.main).to eql(:next)
end
subject.main
end

it "does not apply data if not exists and continues as not restarting" do
allow(subject).to receive(:data_stored?) { false }
expect(subject).not_to receive(:apply_data)
allow(subject).to receive(:event_loop)
expect(subject).to receive(:initialize_dialog)
it "starts input loop" do
expect(subject).to receive(:initialize_dialog)
expect(subject).to receive(:event_loop)

subject.main
end
subject.main
end

context "and installer is not restarting" do
before do
allow(subject).to receive(:data_stored?) { false }
end
context "when back is selected" do

it "initializes dialog" do
allow(subject).to receive(:event_loop)
it "returns back" do
expect(subject).to receive(:initialize_dialog)
expect(Yast::UI).to receive(:UserInput).and_return(:back)

subject.main
expect(subject.main).to eql(:back)
end
end

it "starts input loop" do
expect(subject).to receive(:initialize_dialog)
expect(subject).to receive(:event_loop)
context "when next is selected" do
before do
allow(Yast::Mode).to receive(:config).and_return(false)
allow(Yast::Stage).to receive(:initial).and_return(true)

subject.main
end
allow(Yast::Language).to receive(:CheckIncompleteTranslation).and_return(true)
allow(Yast::Language).to receive(:CheckLanguagesSupport)

context "when back is selected" do
allow(Yast::ProductLicense).to receive(:AcceptanceNeeded).and_return(license_needed)
allow(Yast::ProductLicense).to receive(:cache_license_acceptance_needed).and_return(nil)
allow(subject).to receive(:license_accepted?).and_return(license_accepted)
end

it "returns back" do
expect(subject).to receive(:initialize_dialog)
expect(Yast::UI).to receive(:UserInput).and_return(:back)
context "when license is required and not accepted" do
let(:license_needed) { true }
let(:license_accepted) { false }

it "not returns" do
expect(Yast::UI).to receive(:UserInput).and_return(:next, :back)
expect(Yast::Report).to receive(:Message)
.with(_("You must accept the license to install this product"))
expect(subject.main).to eql(:back)
end
end

context "when next is selected" do
before do
allow(Yast::Mode).to receive(:config).and_return(false)
allow(Yast::Stage).to receive(:initial).and_return(true)
context "when license is not required" do
let(:license_needed) { false }
let(:license_accepted) { false }

allow(Yast::Language).to receive(:CheckIncompleteTranslation).and_return(true)
allow(Yast::Language).to receive(:CheckLanguagesSupport)
it "stores selected data and returns next" do
expect(Yast::UI).to receive(:UserInput).and_return(:next)
expect(subject).to receive(:setup_final_choice)
expect(Yast::Report).to_not receive(:Message)

allow(Yast::ProductLicense).to receive(:AcceptanceNeeded).and_return(license_needed)
allow(Yast::ProductLicense).to receive(:cache_license_acceptance_needed).and_return(nil)
allow(subject).to receive(:license_accepted?).and_return(license_accepted)
end

context "when license is required and not accepted" do
let(:license_needed) { true }
let(:license_accepted) { false }

it "not returns" do
expect(Yast::UI).to receive(:UserInput).and_return(:next, :back)
expect(Yast::Report).to receive(:Message)
.with(_("You must accept the license to install this product"))
expect(subject.main).to eql(:back)
end
end

context "when license is not required" do
let(:license_needed) { false }
let(:license_accepted) { false }

it "stores selected data and returns next" do
expect(Yast::UI).to receive(:UserInput).and_return(:next)
expect(subject).to receive(:setup_final_choice)
expect(subject).to receive(:store_data)
expect(Yast::Report).to_not receive(:Message)

expect(subject.main).to eql(:next)
end
expect(subject.main).to eql(:next)
end
end

context "when license is required and accepted" do
let(:license_needed) { true }
let(:license_accepted) { true }
context "when license is required and accepted" do
let(:license_needed) { true }
let(:license_accepted) { true }

it "stores selected data and returns next" do
expect(Yast::UI).to receive(:UserInput).and_return(:next)
expect(subject).to receive(:setup_final_choice)
expect(subject).to receive(:store_data)
expect(Yast::Report).to_not receive(:Message)
it "stores selected data and returns next" do
expect(Yast::UI).to receive(:UserInput).and_return(:next)
expect(subject).to receive(:setup_final_choice)
expect(Yast::Report).to_not receive(:Message)

expect(subject.main).to eql(:next)
end
expect(subject.main).to eql(:next)
end
end
end
Expand Down
11 changes: 0 additions & 11 deletions test/inst_disks_activate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
describe "#main" do
let(:probed_disks) { [] }
let(:s390) { false }
let(:restarting) { false }

before do
allow(Yast::Linuxrc).to receive(:InstallInf).with("WithFCoE").and_return("0")
Expand All @@ -23,19 +22,9 @@
allow(Yast::Popup).to receive(:ConfirmAbort).with(:painless).and_return(true)
allow(Yast::Arch).to receive(:s390).and_return(s390)
allow(Yast::GetInstArgs).to receive(:going_back) { going_back }
allow(Yast::Installation).to receive(:restarting?) { restarting }
stub_const("Yast::Storage", double("Yast::Storage", ReReadTargetMap: true))
end

context "when installation is restarting" do
let(:restarting) { true }
it "returns next" do
expect(Yast::Arch).to_not receive(:s390)

expect(subject.main).to eql(:next)
end
end

context "when architecture is s390" do
let(:s390) { true }
before do
Expand Down

0 comments on commit d1565c7

Please sign in to comment.