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 toolchain test failing in gcc version #3965

Merged
merged 1 commit into from Dec 13, 2017
Merged
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
2 changes: 1 addition & 1 deletion products/sle/main.pm
Expand Up @@ -1600,7 +1600,7 @@ load_create_hdd_tests if get_var("STORE_HDD_1") || get_var("PUBLISH_HDD_1");
if (get_var("TCM") || check_var("ADDONS", "tcm")) {
loadtest "console/force_cron_run";
loadtest "toolchain/install";
loadtest "toolchain/gcc5_fortran_compilation";
loadtest "toolchain/gcc_fortran_compilation";
loadtest "toolchain/gcc_compilation";
loadtest "console/kdump_and_crash" if kdump_is_applicable;
}
Expand Down
@@ -1,19 +1,21 @@
# SUSE's openQA tests
#
# Copyright © 2009-2013 Bernhard M. Wiedemann
# Copyright © 2012-2016 SUSE LLC
# Copyright © 2012-2017 SUSE LLC
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.

# Summary: Fortran test for SLE Toolchain Module's GCC5
# Summary: Fortran test for SLE Toolchain Module's GCC
# Maintainer: Michal Nowak <mnowak@suse.com>

use base "opensusebasetest";
use strict;
use testapi;
use utils;
use version_utils qw(is_sle sle_version_at_least);

sub run {
my $self = shift;
Expand All @@ -27,7 +29,9 @@ sub run {
script_run 'tar jxf fcvs21_f95.tar.bz2';
script_run 'cp FM923.DAT fcvs21_f95/';
script_run 'pushd fcvs21_f95';
script_run "sed -i 's/g77/gfortran-5/g' driver_*";
# gfortran (and gcc) fixed to version in SLE12 after the yearly gcc update with Toolchain module
my $fortran_version = is_sle && sle_version_at_least('15') ? "gfortran" : "gfortran-5";
script_run "sed -i 's/g77/$fortran_version/g' driver_*";
script_run 'echo "exit \${failed}" >> driver_parse';

script_run "patch -p0 < ../adapt-FM406-to-fortran-95.patch";
Expand Down
48 changes: 32 additions & 16 deletions tests/toolchain/install.pm
@@ -1,7 +1,7 @@
# SUSE's openQA tests
#
# Copyright © 2009-2013 Bernhard M. Wiedemann
# Copyright © 2012-2016 SUSE LLC
# Copyright © 2012-2017 SUSE LLC
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
Expand All @@ -15,6 +15,8 @@ use base "opensusebasetest";
use strict;
use testapi;
use utils;
use version_utils qw(is_sle sle_version_at_least);
use registration;

sub run {
my ($self) = @_;
Expand All @@ -24,23 +26,37 @@ sub run {
# disable packagekitd
script_run 'systemctl mask packagekit.service';
script_run 'systemctl stop packagekit.service';
# toolchain channels
if (!check_var('ADDONS', 'tcm')) {
my $arch = get_var('ARCH');
assert_script_run "zypper ar -f http://download.suse.de/ibs/SUSE/Products/SLE-Module-Toolchain/12/$arch/product/ SLE-Module-Toolchain12-Pool";
assert_script_run "zypper ar -f http://download.suse.de/ibs/SUSE/Updates/SLE-Module-Toolchain/12/$arch/update/ SLE-Module-Toolchain12-Updates";

if (is_sle && !sle_version_at_least('15')) {
# toolchain channels
if (!check_var('ADDONS', 'tcm')) {
my $arch = get_var('ARCH');
assert_script_run "zypper ar -f http://download.suse.de/ibs/SUSE/Products/SLE-Module-Toolchain/12/$arch/product/ SLE-Module-Toolchain12-Pool";
assert_script_run "zypper ar -f http://download.suse.de/ibs/SUSE/Updates/SLE-Module-Toolchain/12/$arch/update/ SLE-Module-Toolchain12-Updates";
}
zypper_call('in -t pattern gcc5');
zypper_call('up');

# reboot when runing processes use deleted files after packages update
type_string "zypper ps|grep 'PPID' || echo OK | tee /dev/$serialdev\n";
if (!wait_serial("OK", 100)) {
type_string "shutdown -r now\n";
$self->wait_boot;
select_console('root-console');
}
Copy link
Member

Choose a reason for hiding this comment

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

hm, I consider the update handling and optional rebooting as something should either apply for SLE15 as well or should not be there at all. So for SLE12 a volatile update repo was used but for SLE15 we use a properly synced proxy-SCC repo per build. IMHO we need to find a better way for SLE12 as well but I am not sure which one that is. I checked on IBS if we can find a build-specific module repo but that is not the way it is done for SLE12 so I give up. Your change here is fine :)

script_run 'export CC=/usr/bin/gcc-5';
script_run 'export CXX=/usr/bin/g++-5';
}
zypper_call('in -t pattern gcc5');
zypper_call('up');
# reboot when runing processes use deleted files after packages update
type_string "zypper ps|grep 'PPID' || echo OK | tee /dev/$serialdev\n";
if (!wait_serial("OK", 100)) {
type_string "shutdown -r now\n";
$self->wait_boot;
select_console('root-console');
elsif (is_sle) {
# No need to be fixed to version (that is only for products receiving the yearly gcc update)
# but it needs to activate development tool module
add_suseconnect_product("sle-module-development-tools");
zypper_call 'in -t pattern devel_basis';
zypper_call 'in gcc-fortran'; # from Base System Module
script_run 'export CC=/usr/bin/gcc';
script_run 'export CXX=/usr/bin/g++';
}
script_run 'export CC=/usr/bin/gcc-5';
script_run 'export CXX=/usr/bin/g++-5';

script_run 'lscpu';
script_run 'free -m';
save_screenshot;
Expand Down