diff --git a/lib/installedtest.pm b/lib/installedtest.pm index 9fb7fa70..abb43b85 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -23,10 +23,21 @@ sub root_console { sub post_fail_hook { my $self = shift; - $self->root_console(tty=>6); + if (check_screen 'emergency_rescue', 3) { + my $password = get_var("ROOT_PASSWORD", "weakpassword"); + type_string "$password\n"; + # bring up network so we can upload logs + assert_script_run "dhclient"; + } + else { + $self->root_console(tty=>6); + } - # We can't rely on tar being in minimal installs - assert_script_run "dnf -y install tar", 180; + # We can't rely on tar being in minimal installs, but we also can't + # rely on dnf always working (it fails in emergency mode, not sure + # why), so try it, then check if we have tar + script_run "dnf -y install tar", 180; + assert_script_run "rpm -q tar"; # Note: script_run returns the exit code, so the logic looks weird. # We're testing that the directory exists and contains something. diff --git a/needles/console/emergency_rescue-20170119.json b/needles/console/emergency_rescue-20170119.json new file mode 100644 index 00000000..212ba67e --- /dev/null +++ b/needles/console/emergency_rescue-20170119.json @@ -0,0 +1,16 @@ +{ + "properties": [], + "tags": [ + "LANGUAGE-english", + "emergency_rescue" + ], + "area": [ + { + "xpos": 1, + "ypos": 48, + "width": 142, + "height": 16, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/console/emergency_rescue-20170119.png b/needles/console/emergency_rescue-20170119.png new file mode 100644 index 00000000..5ff69e5e Binary files /dev/null and b/needles/console/emergency_rescue-20170119.png differ diff --git a/tests/_console_wait_login.pm b/tests/_console_wait_login.pm index 8141eaec..c19b9885 100644 --- a/tests/_console_wait_login.pm +++ b/tests/_console_wait_login.pm @@ -1,4 +1,4 @@ -use base "basetest"; +use base "installedtest"; use strict; use testapi; use utils;