Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for bsc#919980 #123

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions package/yast2-storage.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Mar 03 11:38:11 CET 2015 - dvaleev@suse.com

- allow BootMount on RAID1 (bsc#919980)
- version 3.1.54

-------------------------------------------------------------------
Mon Feb 16 11:38:11 CET 2015 - aschnell@suse.de

Expand Down
6 changes: 3 additions & 3 deletions src/include/partitioning/custom_part_lib.rb
Expand Up @@ -73,9 +73,9 @@ def check_lvm_mount_points(mount)
# @param [String] mount mount point
# @return [Boolean]
#
def check_raid_mount_points(mount)
def check_raid_mount_points(mount, raid_level)
not_allowed_raid_mount_points = []
if Arch.ppc || Arch.s390
if (Arch.ppc && raid_level != "raid1") || Arch.s390
not_allowed_raid_mount_points = Builtins.add(
not_allowed_raid_mount_points,
Partitions.BootMount
Expand Down Expand Up @@ -360,7 +360,7 @@ def CheckOkMount(dev, old, new)
Ops.set(ret, "field", :mount_point)
end
if Ops.get_symbol(new, "type", :primary) == :sw_raid
if !check_raid_mount_points(Ops.get_string(new, "mount", ""))
if !check_raid_mount_points(Ops.get_string(new, "mount", ""), Ops.get_string(new, "raid_type", ""))
Ops.set(ret, "ok", false)
Ops.set(ret, "field", :mount_point)
end
Expand Down
3 changes: 2 additions & 1 deletion test/Makefile.am
Expand Up @@ -4,7 +4,8 @@

TESTS = \
storage_snapper_configure_snapper_test.rb \
storage_get_disk_partition.rb
storage_get_disk_partition.rb \
storage_boot_on_raid1.rb

TEST_EXTENSIONS = .rb
RB_LOG_COMPILER = rspec
Expand Down
47 changes: 47 additions & 0 deletions test/storage_boot_on_raid1.rb
@@ -0,0 +1,47 @@
#!/usr/bin/env rspec

$LOAD_PATH.unshift File.expand_path('../../src', __FILE__)
ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)

require "yast"

require "include/partitioning/custom_part_lib"

class CustomPartLib < Yast::Client
include Singleton
def initialize
Yast.include self, "partitioning/custom_part_lib.rb"
end
end

Yast.import "Arch"
Yast.import "Partitions"

describe "CustomPartLib#CheckOkMount" do


it "/boot is only possible with RAID1 on PowerPC" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test does not test that, only that RAID1 works.


allow(Yast::Arch).to receive(:architecture).and_return("ppc")
allow(Yast::Partitions).to receive(:EfiBoot).and_return(false)

expect(CustomPartLib.instance.check_raid_mount_points("/boot", "raid1")).to eq true
end

it "We cannot put /boot/zipl on any RAID" do

allow(Yast::Arch).to receive(:architecture).and_return("s390_64")
allow(Yast::Partitions).to receive(:EfiBoot).and_return(false)

expect(CustomPartLib.instance.check_raid_mount_points("/boot/zipl", "raid1")).to eq false
end

it "x86 can boot with /boot on RAID1 " do

allow(Yast::Arch).to receive(:architecture).and_return("x86_64")
allow(Yast::Partitions).to receive(:EfiBoot).and_return(false)

expect(CustomPartLib.instance.check_raid_mount_points("/boot", "raid1")).to eq true
end

end