Skip to content

Commit

Permalink
CaaSP: Display the Beta product warning at start (bsc#1016887)
Browse files Browse the repository at this point in the history
...when it is present

- 3.1.217.19
  • Loading branch information
lslezak committed Feb 8, 2017
1 parent 4cca1ad commit c9559aa
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Feb 8 11:57:14 UTC 2017 - lslezak@suse.cz

- CaaSP: Display the Beta product warning at start when it is
present (bsc#1016887)
- 3.1.217.19

-------------------------------------------------------------------
Wed Feb 1 14:20:43 UTC 2017 - 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.18
Version: 3.1.217.19
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
7 changes: 7 additions & 0 deletions src/lib/installation/clients/inst_casp_overview.rb
Expand Up @@ -48,6 +48,7 @@ def run
Yast.import "CWM"
Yast.import "Popup"
Yast.import "Pkg"
Yast.import "InstShowInfo"

textdomain "installation"

Expand All @@ -59,6 +60,9 @@ def run
# helpful when testing all manually on a running system
Yast::Wizard.CreateDialog if separate_wizard_needed?

# show the Beta warning if it exists
Yast::InstShowInfo.show_info_txt(INFO_FILE) if File.exist?(INFO_FILE)

ret = nil
loop do
ret = Yast::CWM.show(
Expand Down Expand Up @@ -102,6 +106,9 @@ def run

private

# location of the info.txt file (containing the Beta warning)
INFO_FILE = "/info.txt".freeze

# Specific services that needs to be enabled on CAaSP see (FATE#321738)
# It is additional services to the ones defined for role.
# It is caasp only services and for generic approach systemd-presets should be used.
Expand Down
18 changes: 18 additions & 0 deletions test/inst_casp_overview_test.rb
Expand Up @@ -69,6 +69,8 @@ def label
allow(Yast::WFM).to receive(:CallFunction).and_return({})
allow(Yast::WFM).to receive(:CallFunction)
.with("inst_doit", []).and_return(:next)
allow(File).to receive(:exist?).and_call_original
allow(File).to receive(:exist?).with("/info.txt").and_return(false)
end

it "sets package locale same as Language" do
Expand Down Expand Up @@ -114,5 +116,21 @@ def label

expect(::Installation::Services.enabled).to include("cloud-init")
end

it "displays the /info.txt file if it exists" do
expect(File).to receive(:exist?).with("/info.txt").and_return(true)
expect(Yast::InstShowInfo).to receive(:show_info_txt).with("/info.txt").and_return(true)
expect(Yast::CWM).to receive(:show).and_return(:next)

subject.run
end

it "does not try displaying the /info.txt file if it does not exist" do
expect(File).to receive(:exist?).with("/info.txt").and_return(false)
expect(Yast::InstShowInfo).to_not receive(:show_info_txt)
expect(Yast::CWM).to receive(:show).and_return(:next)

subject.run
end
end
end

0 comments on commit c9559aa

Please sign in to comment.