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

Replace check_var ARCH ppc64le by get_var OFW #4477

Merged
merged 1 commit into from
Feb 24, 2018
Merged

Replace check_var ARCH ppc64le by get_var OFW #4477

merged 1 commit into from
Feb 24, 2018

Conversation

michelmno
Copy link
Contributor

problem initially detected on ppc64 (BE) tests failures
with openSUSE snapshot 2018021 as reported by
https://progress.opensuse.org/issues/32155

  • Assumption: OFW key defined in used templates for PowerPC arches
    (ppc64, ppc64le) which is the case for default opensuse templates
    (bot not for sle one <= potential TODO)
$find . -name templates -exec grep -Hn backend -A8 {}
\; |grep -E 'backend|ppc64|OFW' |grep ppc64 -A100
products/opensuse/templates-2691- name => "ppc64le",
products/opensuse/templates-2694- { key => "OFW", value => 1 },
products/opensuse/templates-2695- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2704: backend => "qemu",
products/opensuse/templates-2705- name => "ppc64",
products/opensuse/templates-2708- { key => "OFW", value => 1 },
products/opensuse/templates-2709- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2718: backend => "qemu",
products/opensuse/templates-2719- name => "ppc64le-multipath",
products/opensuse/templates-2723- { key => "OFW", value => 1 },
products/opensuse/templates-2724- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2733: backend => "qemu",
products/opensuse/templates-2734- name => "ppc64-multipath",
products/opensuse/templates-2738- { key => "OFW", value => 1 },
products/opensuse/templates-2739- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2748: backend => "qemu",

@michelmno
Copy link
Contributor Author

WARNING: I did not tried to test it yet !

problem initially detected on ppc64 (BE) tests failures
with openSUSE snapshot 2018021 as reported by
https://progress.opensuse.org/issues/32155

Assumption: OFW key defined in used templates for PowerPC arches
(ppc64, ppc64le) which is the case for default opensuse templates
(bot not for sle one <= potential TODO)
===
$find . -name templates -exec grep -Hn backend -A8 {}
\; |grep -E 'backend|ppc64|OFW' |grep ppc64 -A100
products/opensuse/templates-2691- name => "ppc64le",
products/opensuse/templates-2694- { key => "OFW", value => 1 },
products/opensuse/templates-2695- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2704: backend => "qemu",
products/opensuse/templates-2705- name => "ppc64",
products/opensuse/templates-2708- { key => "OFW", value => 1 },
products/opensuse/templates-2709- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2718: backend => "qemu",
products/opensuse/templates-2719- name => "ppc64le-multipath",
products/opensuse/templates-2723- { key => "OFW", value => 1 },
products/opensuse/templates-2724- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2733: backend => "qemu",
products/opensuse/templates-2734- name => "ppc64-multipath",
products/opensuse/templates-2738- { key => "OFW", value => 1 },
products/opensuse/templates-2739- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2748: backend => "qemu",
===

Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
@okurz
Copy link
Member

okurz commented Feb 22, 2018

looks like a good idea. Let's see if someone can help with testing.

@SergioAtSUSE @Zaoliang ?

@michelmno
Copy link
Contributor Author

I am on the way to test it locally with same snapshot 20180221 ppc64 iso on my local openQA instance, at least first tests seems to work correctly.

Copy link
Member

@SergioAtSUSE SergioAtSUSE left a comment

Choose a reason for hiding this comment

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

Good idea. ;)
We have to look at this in more detail to detect where it is PPC related and OFW related.

@@ -333,7 +333,7 @@ sub workaround_type_encrypted_passphrase {
return if get_var('UNENCRYPTED_BOOT');
return if !get_var('ENCRYPT') && !get_var('FULL_LVM_ENCRYPT');
# ppc64le on pre-storage-ng boot was part of encrypted LVM
return if !get_var('FULL_LVM_ENCRYPT') && !is_storage_ng && !check_var('ARCH', 'ppc64le');
return if !get_var('FULL_LVM_ENCRYPT') && !is_storage_ng && !get_var('OFW');
Copy link
Member

Choose a reason for hiding this comment

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

Here the check is about PPC having a proposed separated /boot partition.
AFAIK OFW and PPC are not always the same. So here would make more sense to have

return if !get_var('FULL_LVM_ENCRYPT') && !is_storage_ng && get_var('ARCH) !~ /^ppc/;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per products/opensuse/templates OFW is defined for ppc64 and ppc64le ARCH, so I consider the same for all the tests of this commit.
Why do you want to keep a difference between the two ?

Copy link
Member

Choose a reason for hiding this comment

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

It is a coincidence that only our ppc machines have OFW. We could have another machines non-ppc which use OFW.

@@ -44,7 +44,7 @@ sub run {
select_console 'root-console';

# all but PPC64LE arch's vmlinux images are gzipped
my $suffix = check_var('ARCH', 'ppc64le') ? '' : '.gz';
my $suffix = get_var('OFW') ? '' : '.gz';
Copy link
Member

Choose a reason for hiding this comment

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

Here also seems to be unrelated to OFW, but about PPC specific

@@ -39,7 +39,7 @@ sub run {
}
# on ppc64le boot have to be confirmed with ctrl-x or F10
# and it doesn't have nice graphical menu with video and language options
if (!check_var('ARCH', 'ppc64le')) {
if (!get_var('OFW')) {
Copy link
Member

Choose a reason for hiding this comment

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

Please adapt also the comment above to clarify that the "textmode" comes from OFW.

@@ -22,10 +22,10 @@ use version_utils 'is_storage_ng';

sub run {
create_new_partition_table;
if (check_var('ARCH', 'ppc64le')) { # ppc64le always needs PReP boot
if (get_var('OFW')) { # ppc64le always needs PReP boot
Copy link
Member

Choose a reason for hiding this comment

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

That's also PPC related, not OFW

@@ -24,7 +24,7 @@ sub run {
if (check_var('ARCH', 's390x')) { # s390x need /boot/zipl on ext partition
addpart(role => 'OS', size => 500, format => 'ext2', mount => '/boot');
}
elsif (check_var('ARCH', 'ppc64le')) { # ppc64le need PReP /boot
elsif (get_var('OFW')) { # ppc64le need PReP /boot
Copy link
Member

Choose a reason for hiding this comment

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

PPC related, not OFW

@@ -101,7 +101,7 @@ sub run {
sles4sap => 'i',
hpc => 'x'
);
$hotkey{sles4sap} = 'u' if check_var('ARCH', 'ppc64le');
$hotkey{sles4sap} = 'u' if get_var('OFW');
Copy link
Member

Choose a reason for hiding this comment

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

PPC, not OFW

Because a different list of products are offered for PPC

@coolo
Copy link
Contributor

coolo commented Feb 22, 2018

well, the whole idea of this patch is that OFW is always there when ARCH starts with ppc - so your reviews are bit strange

@SergioAtSUSE
Copy link
Member

@coolo, for semantic. It would be like changing check_var('ARCH', 'aarch64') to check_var('UEFI', 1)

@coolo
Copy link
Contributor

coolo commented Feb 22, 2018

Yeah, once we test sparc servers we might be in trouble - until then I prefer check_var('OFW' ) over regexp checks

@michelmno
Copy link
Contributor Author

@coolo, @SergioAtSUSE so what should I do with this PR ?

  • keep the PR with use of get_var('OFW') and dismiss the review to ignore the change request. (my preference of course :)
  • add a new "POWERPC" key to be set in template for ppc64 and ppc64le, and use it in all places identified in the review.
  • something else ?

@SergioAtSUSE SergioAtSUSE dismissed their stale review February 23, 2018 12:03

Dismissing review. People is already aware that in the future we would need to review this checks, but accepting argument against regexp.

@SergioAtSUSE
Copy link
Member

@michelmno, from my part I only need some verification runs, like RAID0 test.

@michelmno
Copy link
Contributor Author

my local tests with this patch allow all Raid* tests to pass for ppc64 on snapshot 20180221.

@SergioAtSUSE
Copy link
Member

SergioAtSUSE commented Feb 23, 2018

Waiting for verification run: http://copland.arch.suse.de/tests/911

@coolo
Copy link
Contributor

coolo commented Feb 24, 2018

worked

@coolo coolo merged commit 8e30d7c into os-autoinst:master Feb 24, 2018
@michelmno michelmno deleted the ofw_not_ppc64le branch February 26, 2018 07:35
StefanBruens pushed a commit to StefanBruens/os-autoinst-distri-opensuse that referenced this pull request Mar 1, 2018
problem initially detected on ppc64 (BE) tests failures
with openSUSE snapshot 2018021 as reported by
https://progress.opensuse.org/issues/32155

Assumption: OFW key defined in used templates for PowerPC arches
(ppc64, ppc64le) which is the case for default opensuse templates
(bot not for sle one <= potential TODO)
===
$find . -name templates -exec grep -Hn backend -A8 {}
\; |grep -E 'backend|ppc64|OFW' |grep ppc64 -A100
products/opensuse/templates-2691- name => "ppc64le",
products/opensuse/templates-2694- { key => "OFW", value => 1 },
products/opensuse/templates-2695- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2704: backend => "qemu",
products/opensuse/templates-2705- name => "ppc64",
products/opensuse/templates-2708- { key => "OFW", value => 1 },
products/opensuse/templates-2709- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2718: backend => "qemu",
products/opensuse/templates-2719- name => "ppc64le-multipath",
products/opensuse/templates-2723- { key => "OFW", value => 1 },
products/opensuse/templates-2724- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2733: backend => "qemu",
products/opensuse/templates-2734- name => "ppc64-multipath",
products/opensuse/templates-2738- { key => "OFW", value => 1 },
products/opensuse/templates-2739- { key => "QEMU", value => "ppc64" },
products/opensuse/templates:2748: backend => "qemu",
===

Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
@pevik
Copy link
Contributor

pevik commented Dec 5, 2018

IMHO this was a wrong direction: detecting ppc* with variable for OFW is really cryptic. And one day we might want to use QEMU Open Firmware on other platforms.

It'd be great, if there was another variable for ARCH (not sure for name), which would have more general name than MACHINE or ARCH has. I.e. having content which QEMU variable has (i.e. ppc64 for both ppc64 and ppc64le). Problem with QEMU is, that is not defined on x86_64 ARCH (this variable would have to be mandatory for all tests).

@okurz
Copy link
Member

okurz commented Jan 25, 2019

@pevik I agree with you that we should not "detect ppc* with OFW" but I do not think that we do. I think we are doing a good job to really handle OFW-specific behaviour based on that variable and we still look at ARCH (or maybe MACHINE) in other places. We can always use get_var('ARCH', '') =~ /ppc/ or check_var('ARCH', 'ppc') || check_var('ARCH', 'ppc64le')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants