From 062d9f8f5e2fa909a4b72335a4a4376e5383985f Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 16 Jan 2017 09:30:14 -0800 Subject: [PATCH] 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 --- main.pm | 7 ++++++ templates | 41 +++++++++++++++++++++++++++++++++ tests/_boot_to_anaconda.pm | 4 +++- tests/_do_install_and_reboot.pm | 15 +++++++----- tests/_memcheck.pm | 21 +++++++++++++++++ 5 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 tests/_memcheck.pm diff --git a/main.pm b/main.pm index 0a4a1b57..2ddcbe89 100644 --- a/main.pm +++ b/main.pm @@ -173,6 +173,13 @@ sub load_install_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 # follows the 'storage post-install' convention, but must be run earlier. if (get_var("ENCRYPT_PASSWORD")) { diff --git a/templates b/templates index f4fd880d..6a8eb93a 100755 --- a/templates +++ b/templates @@ -116,6 +116,28 @@ }, 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" }, prio => 16, @@ -1238,6 +1260,17 @@ }, 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" }, prio => 17, @@ -2305,5 +2338,13 @@ { key => "WORKER_CLASS", value => "tap" }, ], }, + { + name => "memory_check", + settings => [ + { key => "PACKAGE_SET", value => "default" }, + { key => "MEMCHECK", value => "1" }, + { key => "REPOSITORY_VARIATION", value => "%LOCATION%" }, + ], + }, ], } diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index c3736498..024b5a53 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -17,7 +17,9 @@ sub run { if ($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 $params = $params =~ /^\s+$/ ? "" : $params; diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index 8010e8ae..5d5c70f5 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -104,12 +104,15 @@ sub run { assert_screen "anaconda_install_done", $timeout; # wait for transition to complete so we don't click in the sidebar wait_still_screen 3; - assert_and_click "anaconda_install_done"; - if (get_var('LIVE')) { - # reboot from a console, it's more reliable than the desktop - # runners - $self->root_console; - type_string "reboot\n"; + # for the memory check test, we *don't* want to leave + unless (get_var("MEMCHECK")) { + assert_and_click "anaconda_install_done"; + if (get_var('LIVE')) { + # reboot from a console, it's more reliable than the desktop + # runners + $self->root_console; + type_string "reboot\n"; + } } } diff --git a/tests/_memcheck.pm b/tests/_memcheck.pm new file mode 100644 index 00000000..91b68fa4 --- /dev/null +++ b/tests/_memcheck.pm @@ -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: