diff --git a/lib/utils.pm b/lib/utils.pm index e5d82fe4..6a8f06b9 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -98,6 +98,16 @@ sub desktop_switch_layout { assert_screen "${environment}_layout_${layout}", 3; } +# this is used at the end of console_login to check if we got a prompt +# indicating that we got a bash shell, but sourcing of /etc/bashrc +# failed (the prompt looks different in this case). We treat this as +# a soft failure. +sub _console_login_finish { + if (match_has_tag "bash_noprofile") { + record_soft_failure "It looks like profile sourcing failed"; + } +} + # this subroutine handles logging in as a root/specified user into console # it requires TTY to be already displayed (handled by the root_console() # method of distribution classes) @@ -134,12 +144,12 @@ sub console_login { check_screen [$good, 'text_console_login'], 10; # if we're already logged in, all is good - return if (match_has_tag $good); + _console_login_finish() if (match_has_tag $good); # if we see the login prompt, type the username type_string("$args{user}\n") if (match_has_tag 'text_console_login'); check_screen [$good, 'console_password_required'], 30; # on a live image, just the user name will be enough - return if (match_has_tag $good); + _console_login_finish() if (match_has_tag $good); # otherwise, type the password if we see the prompt if (match_has_tag 'console_password_required') { type_string "$args{password}"; @@ -155,6 +165,7 @@ sub console_login { } # make sure we reached the console assert_screen($good, 30); + _console_login_finish(); } # load US layout (from a root console) diff --git a/needles/console/user_logged_in-noprofile-bash44-20170831.json b/needles/console/user_logged_in-noprofile-bash44-20170831.json new file mode 100644 index 00000000..97876ea7 --- /dev/null +++ b/needles/console/user_logged_in-noprofile-bash44-20170831.json @@ -0,0 +1,18 @@ +{ + "area": [ + { + "type": "match", + "ypos": 127, + "xpos": 1, + "height": 16, + "width": 80 + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-fedora", + "bash_noprofile", + "user_console", + "user_logged_in" + ] +} diff --git a/needles/console/user_logged_in-noprofile-bash44-20170831.png b/needles/console/user_logged_in-noprofile-bash44-20170831.png new file mode 100644 index 00000000..49d08c9f Binary files /dev/null and b/needles/console/user_logged_in-noprofile-bash44-20170831.png differ