Skip to content

Commit

Permalink
Merge pull request #354 from yast/fix_tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
jreidinger committed Jul 18, 2016
2 parents bbbbaa2 + 7c75acf commit 68668be
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
7 changes: 7 additions & 0 deletions package/yast2-bootloader.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jul 18 14:56:27 UTC 2016 - jreidinger@suse.com

- do not fail tests when run in environment connected by serial
console (bnc#989405)
- 3.1.199

-------------------------------------------------------------------
Wed Jul 13 08:49:50 UTC 2016 - jreidinger@suse.com

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


Name: yast2-bootloader
Version: 3.1.198
Version: 3.1.199
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
42 changes: 39 additions & 3 deletions test/grub2base_test.rb
Expand Up @@ -120,11 +120,47 @@
allow(Yast::Arch).to receive(:architecture).and_return("s390_64")
end

it "proposes console terminal" do
context "with TERM=\"linux\"" do
before do
allow(ENV).to receive(:"[]").with("TERM").and_return("linux")
end

it "proposes to use serial terminal" do
subject.propose

expect(subject.grub_default.terminal).to eq :serial
end
end

context "on other TERM" do
before do
allow(ENV).to receive(:"[]").with("TERM").and_return("xterm")
end

it "proposes to use console terminal" do
subject.propose

expect(subject.grub_default.terminal).to eq :console
end
end
end

context "on ppc" do
before do
allow(Yast::Arch).to receive(:architecture).and_return("ppc64")
end

it "proposes to use console terminal" do
subject.propose

expect(subject.grub_default.terminal).to eq :console
end

it "sets GFXPAYLOAD_LINUX to text" do
subject.propose

expect(subject.grub_default.generic_get("GRUB_GFXPAYLOAD_LINUX")).to eq "text"
end
end

context "otherwise" do
Expand Down Expand Up @@ -213,7 +249,7 @@

context "with TERM=\"linux\"" do
before do
ENV["TERM"] = "linux"
allow(ENV).to receive(:"[]").with("TERM").and_return("linux")
end

it "proposes to use serial console with \"TERM=linux console=ttyS0 console=ttyS1\"" do
Expand All @@ -225,7 +261,7 @@

context "on other TERM" do
before do
ENV["TERM"] = "xterm"
allow(ENV).to receive(:"[]").with("TERM").and_return("xterm")
end

it "proposes dumb term and sets 8 iuvc terminals" do
Expand Down

0 comments on commit 68668be

Please sign in to comment.