Collect some data on freshly-installed systems after some tests

Summary:
I've been wanting to do this for a while; I think it'll let us
check for some significant changes between composes. This should
cause runs of a few test cases to collect and upload info on:

* installed packages
* free memory
* disk space
* active services
* 1 minute of CPU usage info (via top)

immediately after install and initial login. In some cases this
will be useful / interesting simply to look at directly, but
we can also have check-compose analyze the data and include
significant changes in its reports.

Test Plan:
Run affected tests, make sure the data collection
works.

Reviewers: jskladan, garretraziel

Reviewed By: garretraziel

Subscribers: tflink

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D1046
This commit is contained in:
Adam Williamson 2016-11-09 07:20:17 -08:00
parent c4edf8009e
commit 65cadb11df
2 changed files with 34 additions and 0 deletions

View File

@ -1552,12 +1552,14 @@
name => "install_default",
settings => [
{ key => "PACKAGE_SET", value => "default" },
{ key => "POSTINSTALL", value => "_collect_data" },
],
},
{
name => "install_default_upload",
settings => [
{ key => "PACKAGE_SET", value => "default" },
{ key => "POSTINSTALL", value => "_collect_data" },
{ key => "STORE_HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" },
],
},
@ -1593,6 +1595,7 @@
name => "install_package_set_minimal",
settings => [
{ key => "PACKAGE_SET", value => "minimal" },
{ key => "POSTINSTALL", value => "_collect_data" },
],
},
{
@ -1957,6 +1960,7 @@
settings => [
{ key => "DESKTOP", value => "kde" },
{ key => "PACKAGE_SET", value => "kde" },
{ key => "POSTINSTALL", value => "_collect_data" },
{ key => "REPOSITORY_VARIATION", value => "%LOCATION%" },
{ key => "USER_LOGIN", value => "false" },
],

30
tests/_collect_data.pm Normal file
View File

@ -0,0 +1,30 @@
use base "installedtest";
use strict;
use testapi;
sub run {
my $self = shift;
$self->root_console(tty=>3);
assert_script_run 'rpm -qa --queryformat "%{NAME}\n" | sort -u > /var/tmp/rpms.log';
upload_logs '/var/tmp/rpms.log';
assert_script_run 'free > /var/tmp/free.log';
upload_logs '/var/tmp/free.log';
assert_script_run 'df > /var/tmp/df.log';
upload_logs '/var/tmp/df.log';
assert_script_run 'systemctl -t service --no-pager |grep -o ".*\.service" > /var/tmp/services.log';
upload_logs '/var/tmp/services.log';
assert_script_run 'top -i -n20 -b > /var/tmp/top.log';
upload_logs '/var/tmp/top.log';
}
sub test_flags {
# without anything - rollback to 'lastgood' snapshot if failed
# 'fatal' - whole test suite is in danger if this fails
# 'milestone' - after this test succeeds, update 'lastgood'
# 'important' - if this fails, set the overall state to 'fail'
return {};
}
1;
# vim: set sw=4 et: