Add jobs to gather memory usage data

Summary:
This adds a new test, memory_check, which just does a default
package set install with `inst.debug` parameter then uploads
the memory usage file (`/tmp/memory.dat`) at the end. We can
have check-compose use the data to analyze changes in memory
usage over time.

Test Plan:
Fire off the Workstation network install image tests
and make sure the memory usage test runs and works on all three
machines. This is live on staging already.

Reviewers: jskladan, garretraziel_but_actually_jsedlak_who_uses_stupid_nicknames

Reviewed By: garretraziel_but_actually_jsedlak_who_uses_stupid_nicknames

Subscribers: tflink

Differential Revision: https://phab.qa.fedoraproject.org/D1082
This commit is contained in:
Adam Williamson 2017-01-16 09:30:14 -08:00
parent a946b02e71
commit 062d9f8f5e
5 changed files with 81 additions and 7 deletions

View File

@ -173,6 +173,13 @@ sub load_install_tests() {
} }
sub load_postinstall_tests() { sub load_postinstall_tests() {
# special case for the memory check test, as it doesn't need to boot
# the installed system: just load its test and return
if (get_var("MEMCHECK")) {
autotest::loadtest "tests/_memcheck.pm";
return;
}
# Unlock encrypted storage volumes, if necessary. The test name here # Unlock encrypted storage volumes, if necessary. The test name here
# follows the 'storage post-install' convention, but must be run earlier. # follows the 'storage post-install' convention, but must be run earlier.
if (get_var("ENCRYPT_PASSWORD")) { if (get_var("ENCRYPT_PASSWORD")) {

View File

@ -116,6 +116,28 @@
}, },
test_suite => { name => "install_default" }, test_suite => { name => "install_default" },
}, },
{
machine => { name => "64bit" },
prio => 100,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "Workstation-boot-iso",
version => "*",
},
test_suite => { name => "memory_check" },
},
{
machine => { name => "uefi" },
prio => 100,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "Workstation-boot-iso",
version => "*",
},
test_suite => { name => "memory_check" },
},
{ {
machine => { name => "uefi" }, machine => { name => "uefi" },
prio => 16, prio => 16,
@ -1238,6 +1260,17 @@
}, },
test_suite => { name => "install_default" }, test_suite => { name => "install_default" },
}, },
{
machine => { name => "64bit" },
prio => 100,
product => {
arch => "i386",
distri => "fedora",
flavor => "Workstation-boot-iso",
version => "*",
},
test_suite => { name => "memory_check" },
},
{ {
machine => { name => "64bit" }, machine => { name => "64bit" },
prio => 17, prio => 17,
@ -2305,5 +2338,13 @@
{ key => "WORKER_CLASS", value => "tap" }, { key => "WORKER_CLASS", value => "tap" },
], ],
}, },
{
name => "memory_check",
settings => [
{ key => "PACKAGE_SET", value => "default" },
{ key => "MEMCHECK", value => "1" },
{ key => "REPOSITORY_VARIATION", value => "%LOCATION%" },
],
},
], ],
} }

View File

@ -17,7 +17,9 @@ sub run {
if ($repourl) { if ($repourl) {
$params .= "inst.repo=" . $self->get_full_repo($repourl) . " "; $params .= "inst.repo=" . $self->get_full_repo($repourl) . " ";
} }
$params .= "inst.text" if get_var("ANACONDA_TEXT"); $params .= "inst.text " if get_var("ANACONDA_TEXT");
# inst.debug enables memory use tracking
$params .= "debug" if get_var("MEMCHECK");
# ternary: set $params to "" if it contains only spaces # ternary: set $params to "" if it contains only spaces
$params = $params =~ /^\s+$/ ? "" : $params; $params = $params =~ /^\s+$/ ? "" : $params;

View File

@ -104,6 +104,8 @@ sub run {
assert_screen "anaconda_install_done", $timeout; assert_screen "anaconda_install_done", $timeout;
# wait for transition to complete so we don't click in the sidebar # wait for transition to complete so we don't click in the sidebar
wait_still_screen 3; wait_still_screen 3;
# for the memory check test, we *don't* want to leave
unless (get_var("MEMCHECK")) {
assert_and_click "anaconda_install_done"; assert_and_click "anaconda_install_done";
if (get_var('LIVE')) { if (get_var('LIVE')) {
# reboot from a console, it's more reliable than the desktop # reboot from a console, it's more reliable than the desktop
@ -111,6 +113,7 @@ sub run {
$self->root_console; $self->root_console;
type_string "reboot\n"; type_string "reboot\n";
} }
}
} }
sub test_flags { sub test_flags {

21
tests/_memcheck.pm Normal file
View File

@ -0,0 +1,21 @@
use base "anacondatest";
use strict;
use testapi;
sub run {
my $self = shift;
$self->root_console();
upload_logs '/tmp/memory.dat';
}
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 { fatal => 1 };
}
1;
# vim: set sw=4 et: