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

Add system info check #8462

Merged
merged 5 commits into from Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions lib/main_common.pm
Expand Up @@ -1126,6 +1126,7 @@ sub load_consoletests {
loadtest "console/xorg_vt";
}
loadtest "console/zypper_lr";
loadtest "console/check_system_info" if (is_sle && (get_var('SCC_ADDONS') !~ /ha/) && !is_sles4sap && (is_upgrade || get_var('MEDIA_UPGRADE')));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can be safely scheduled for SLES4SAP as I don't believe we have any test using variable MILESTONE_VERSION and without it the module only check for files that should exist in SLES4SAP. WDYT @ldevulder

# Enable installation repo from the usb, unless we boot from USB, but don't use it
# for the installation, like in case of LiveCDs and when using http/smb/ftp mirror
if (check_var('USBBOOT', 1) && !is_livecd && !get_var('NETBOOT')) {
Expand Down
40 changes: 40 additions & 0 deletions tests/console/check_system_info.pm
@@ -0,0 +1,40 @@
# Copyright (C) 2019 SUSE LLC
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, see <http://www.gnu.org/licenses/>.
#
# Summary: Check system info like `/etc/issue` or `/etc/os-release`.
# Maintainer: Alynx Zhou <alynx.zhou@suse.com>

use base "consoletest";
use strict;
use warnings;
use testapi;
use utils;

sub run {
select_console('root-console');

assert_script_run("SUSEConnect --list > /dev/$serialdev");
assert_script_run("SUSEConnect --status-text > /dev/$serialdev");

if (!get_var('MILESTONE_VERSION')) {
assert_script_run('cat /etc/issue');
Copy link
Member

Choose a reason for hiding this comment

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

Similar question to this check, as of now we basically just check file existence.

} else {
my $milestone_version = get_var('MILESTONE_VERSION');
assert_script_run("grep $milestone_version /etc/issue");
AlynxZhou marked this conversation as resolved.
Show resolved Hide resolved
}
assert_script_run('cat /etc/os-release');
Copy link
Member

Choose a reason for hiding this comment

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

Similar thing here, I would propose to check content of the file that it matches version, distribution, etc. This check will fail only if file is missing or cannot be read.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rwx788 Thanks for your comments, i have created another ticket and try to check the result and avoid manual check.
https://progress.opensuse.org/issues/57242

Copy link
Contributor

Choose a reason for hiding this comment

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

Similar thing here, I would propose to check content of the file that it matches version, distribution, etc. This check will fail only if file is missing or cannot be read.

There's already console/check_os_release doing that. It's being scheduled in load_extra_console_tests as well as for SLES4SAP and HA.

Copy link
Contributor

Choose a reason for hiding this comment

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

More info in #7521

}

1;