Skip to content

Commit

Permalink
fix proposed generic mbr (found during debugging bnc#994348)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Aug 23, 2016
1 parent 1ec1511 commit 6746753
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/bootloader/stage1_proposal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def self.propose(stage1)

proposal.new(stage1).propose

log.info "proposed stage1 configuratopn #{stage1.inspect}"
log.info "proposed stage1 configuration #{stage1.inspect}"
end

protected
Expand Down Expand Up @@ -119,6 +119,8 @@ def propose_boot_location
end

assign_bootloader_device(selected_location)

selected_location
end

def separated_boot?
Expand Down
14 changes: 14 additions & 0 deletions test/stage1_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@
expect(subject.mbr?).to eq true
end

it "do not set generic_mbr if proposed boot from mbr" do
allow(Bootloader::Stage1Device).to receive(:new).and_call_original
target_map_stub("storage_mdraid.yaml")

allow(Yast::BootStorage).to receive(:mbr_disk)
.and_return("/dev/md")
allow(Yast::BootStorage).to receive(:BootPartitionDevice)
.and_return("/dev/md1")

subject.propose

expect(subject.generic_mbr?).to eq false
end

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

0 comments on commit 6746753

Please sign in to comment.