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
Add system info check #8462
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There's already There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More info in #7521 |
||
} | ||
|
||
1; |
There was a problem hiding this comment.
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