From cc7fe4b9713daaf38bbf689831009c766c2d5834 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 8 Dec 2016 12:03:26 -0800 Subject: [PATCH] Tweaks to AVC test loading / run Committing without review as this causes failures...try to make sure we only run the AVC test when it makes sense, and fix running it on the French install test. --- lib/main_common.pm | 9 ++++++++- main.pm | 10 ++++++++-- tests/_console_wait_login.pm | 4 ++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/main_common.pm b/lib/main_common.pm index 94fdca70..86cbabeb 100644 --- a/lib/main_common.pm +++ b/lib/main_common.pm @@ -6,7 +6,7 @@ use base 'Exporter'; use Exporter; use testapi; -our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout/; +our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout console_loadkeys_us/; sub run_with_error_check { my ($func, $error_screen) = @_; @@ -133,3 +133,10 @@ sub console_login { # make sure we reached the console assert_screen($good, 30); } + +# load US layout (from a root console) +sub console_loadkeys_us { + if (get_var('LANGUAGE') eq 'french') { + script_run "loqdkeys us", 0; + } +} diff --git a/main.pm b/main.pm index 0d19e884..1e36d550 100644 --- a/main.pm +++ b/main.pm @@ -204,8 +204,14 @@ sub load_postinstall_tests() { autotest::loadtest "tests/uefi_postinstall.pm"; } - # console avc / crash check (desktops have specific tests for this) - if (!get_var("DESKTOP")) { + # console avc / crash check + # it makes no sense to run this after logging in on most post- + # install tests (hence ! BOOTFROM) but we *do* want to run it on + # upgrade tests after upgrading (hence UPGRADE) + # desktops have specific tests for this (hence !DESKTOP). For + # desktop upgrades we should really upload a disk image at the end + # of upgrade and run all the desktop post-install tests on that + if (!get_var("DESKTOP") && (!get_var("BOOTFROM") || get_var("UPGRADE"))) { autotest::loadtest "tests/_console_avc_crash.pm"; } diff --git a/tests/_console_wait_login.pm b/tests/_console_wait_login.pm index 79c712a6..801b8cef 100644 --- a/tests/_console_wait_login.pm +++ b/tests/_console_wait_login.pm @@ -24,6 +24,10 @@ sub run { } if (get_var("ROOT_PASSWORD")) { console_login(user=>"root", password=>get_var("ROOT_PASSWORD")); + # if this is a non-English, non-switched layout, load US layout + # at this point as we've already checked the default layout is + # the native one, and we might want to run other commands now + console_loadkeys_us; } }