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

special handling for PREP partitions on PPC PowerNV machines #248

Merged
merged 5 commits into from
Sep 15, 2016

Conversation

schubi2
Copy link
Member

@schubi2 schubi2 commented Sep 14, 2016

No description provided.

pb = {}
# PPCs do not need /boot but prep partition only.
if !Arch.ppc
Copy link
Member

Choose a reason for hiding this comment

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

well, what happen if board is powernv and cryptic first condition is true? then it create prep partition. so maybe use quick exit here?
like

# comment about powernv
return tc if Arch.ppc && Arch.board_powernv
if !@planHasBoot && root &&
  ....


describe "#autopart" do

describe "ppc partitioning" do
Copy link
Member

Choose a reason for hiding this comment

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

this should be context and not describe


context "AY configuration file has no /boot partition" do
before do
client.planHasBoot=false
Copy link
Member

Choose a reason for hiding this comment

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

this is wrong, as for ppc it is not about /boot but about prep partition. Only exception is powernv. So for ppc in general planHasBoot is true if there is prep or gpt_prep partition ( depending on disk label ).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but unfortunately this flag wil be used for /boot and prep partitions. But at least I have changed the naming.

context "checking device with root partition" do
let(:checked_device) { "/dev/sdc" }

it "do not add an additional prep disk if it is a pwoernv system" do
Copy link
Member

Choose a reason for hiding this comment

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

typo powernv

ret = client.try_add_boot( ay_device, target_map[checked_device])
expect(ret["partitions"].size).to eq(ay_device["partitions"].size)
end
it "do add an additional prep disk if it is NOT a pwoernv system" do
Copy link
Member

Choose a reason for hiding this comment

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

empy line please

Copy link
Member

Choose a reason for hiding this comment

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

and same typo

Copy link
Member

Choose a reason for hiding this comment

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

and do add can be replaced by adds

it "do add an additional prep disk if it is NOT a pwoernv system" do
allow(Yast::Arch).to receive(:board_powernv).and_return(false)
ret = client.try_add_boot( ay_device, target_map[checked_device])
expect(ret["partitions"].size).to eq(ay_device["partitions"].size+1)
Copy link
Member

Choose a reason for hiding this comment

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

please space around + we should deploy rubocop here, to check it automatic.

ret = client.try_add_boot( ay_device, target_map[checked_device])
expect(ret["partitions"].size).to eq(ay_device["partitions"].size)
end
it "do add an additional prep disk if it is NOT a pwoernv system" do
Copy link
Member

Choose a reason for hiding this comment

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

and do add can be replaced by adds

Copy link
Member

@jreidinger jreidinger left a comment

Choose a reason for hiding this comment

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

there are some types and confusing statements. Also one hole in logic.

end
end

context "checking device with NO root partition" do
Copy link
Member

Choose a reason for hiding this comment

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

maybe without instead of with NO

end
end

context "AY configuration file has a /boot partition" do
Copy link
Member

Choose a reason for hiding this comment

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

this is about prep again

context "checking device with root partition" do
let(:checked_device) { "/dev/sdc" }

it "do not add an additional prep disk if it is NOT a pwoernv system" do
Copy link
Member

Choose a reason for hiding this comment

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

typo and I think here we should not mention powernv at all, as it is generic for all powerpcs.

# bnc#989392
allow(Yast::Arch).to receive(:board_powernv).and_return(true)
ret = client.try_add_boot( ay_device, target_map[checked_device])
expect(ret["partitions"].size).to eq(ay_device["partitions"].size)
end
it "do add an additional prep disk if it is NOT a pwoernv system" do

it "adds an additional prep partition if it is NOT a powerpc system" do
Copy link
Member

Choose a reason for hiding this comment

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

powernv not powerpc! it change sense of this statement

end

context "checking device with root partition" do
let(:checked_device) { "/dev/sdc" }

it "do not add an additional prep disk if it is a pwoernv system" do
it "do not add an additional prep partition if it is a powerpc system" do
Copy link
Member

Choose a reason for hiding this comment

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

same here, it is powernv! powerpc is whole architecture

context "checking device with root partition" do
let(:checked_device) { "/dev/sdc" }

it "do not add an additional prep partition if it is NOT a powerpc system" do
Copy link
Member

Choose a reason for hiding this comment

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

still powerpc

@@ -271,6 +271,12 @@ def preprocess_partition_config(xmlflex)

def try_add_boot(conf, disk)
conf = deep_copy(conf)
Copy link
Member

Choose a reason for hiding this comment

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

btw deep copy is not needed here, as eval do copy and conf is not used anywhere else.

@jreidinger
Copy link
Member

LGTM

@schubi2 schubi2 merged commit 7be7bc3 into SLE-12-SP2 Sep 15, 2016
@imobachgs imobachgs deleted the bug_989392_SLE-12-SP2 branch October 25, 2017 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants