From 65cadb11df4877d2a8e454a6cdd843a1b0961254 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 9 Nov 2016 07:20:17 -0800 Subject: [PATCH] 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 --- templates | 4 ++++ tests/_collect_data.pm | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/_collect_data.pm diff --git a/templates b/templates index a8794ba9..cabe51fb 100755 --- a/templates +++ b/templates @@ -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" }, ], diff --git a/tests/_collect_data.pm b/tests/_collect_data.pm new file mode 100644 index 00000000..d0cadc31 --- /dev/null +++ b/tests/_collect_data.pm @@ -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: