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

Conversation

AlynxZhou
Copy link
Contributor

@AlynxZhou AlynxZhou commented Sep 18, 2019

Add check for /etc/issue, /etc/os-release, etc.

# Summary: Check system info like `/etc/issue` or `/etc/os-release`.
# Maintainer: Alynx Zhou <alynx.zhou@suse.com>

use base "basetest";
Copy link
Member

Choose a reason for hiding this comment

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

I would propose to use consoletest as parent class, as it has already postfail hooks.

}

sub test_flags {
return {fatal => 0};
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to set this to 0, as by default no flags are set.

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

script_output("SUSEConnect --list");
Copy link
Member

Choose a reason for hiding this comment

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

Why not to convert that to assert_script_run to at least test that exit code is zero. Otherwise we just list some info which is not visible on the dashboard.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the output may be out of one screen and using script_output can print them to serial port.

Copy link
Member

Choose a reason for hiding this comment

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

You can redirect output in the assert_script_run too using > /dev/$serialdev. But my question is more about if we want just print somethingor we want to check the output and have the test for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your advice. Currently we just want to print something, because we don't have source to compare with those output. Those code is providing a way for us to check those things manually while reviewing.

Copy link
Member

Choose a reason for hiding this comment

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

Sure, then let's keep that in mind for next steps. Cheers ;)

script_output("SUSEConnect --status-text");

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.

my $milestone_version = get_var('MILESTONE_VERSION');
assert_script_run("grep $milestone_version /etc/issue");
}
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

@AlynxZhou AlynxZhou changed the title Add system info check [WIP]Add system info check Sep 19, 2019
@rwx788
Copy link
Member

rwx788 commented Sep 20, 2019

Hey! Is it ready now? If so, could you please remove [WIP] tag. Thanks!

@AlynxZhou
Copy link
Contributor Author

Hey! Is it ready now? If so, could you please remove [WIP] tag. Thanks!

I am running test to ensure what I changed can work, but some other modules blocked it so I run it again and again with EXCLUDE_MODULES...

@AlynxZhou AlynxZhou changed the title [WIP]Add system info check Add system info check Sep 23, 2019
@coolgw coolgw merged commit 73400fe into os-autoinst:master Sep 24, 2019
@@ -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

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