diff --git a/neon/tests/natives/qt_compat.pm b/neon/tests/natives/qt_compat.pm index 0eb8693..39a6cca 100644 --- a/neon/tests/natives/qt_compat.pm +++ b/neon/tests/natives/qt_compat.pm @@ -1,104 +1,116 @@ # Copyright (C) 2018 Harald Sitter # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License or (at your option) version 3 or any later version # accepted by the membership of KDE e.V. (or its successor approved # by the membership of KDE e.V.), which shall act as a proxy # defined in Section 14 of version 3 of the license. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . use base "basetest_neon"; use strict; use testapi; sub send_key_while_needlematch { my ($tag, $key, $counter, $timeout) = @_; $counter //= 20; $timeout //= 1; while (check_screen($tag, $timeout)) { send_key $key; if (!$counter--) { if (check_screen($tag, $timeout)) { die "Wanted to get rid of match for " . $tag . " but timed out"; } } } } sub xkill_while_needlematch { my ($tag, $counter, $timeout) = @_; $counter //= 20; $timeout //= 1; while (check_screen($tag, $timeout)) { send_key 'alt-ctrl-esc'; mouse_set(32, 32); # TODO: should assert_screen on the kill icon assert_and_click($tag); if (!$counter--) { if (check_screen($tag, $timeout)) { die "Wanted to get rid of match for " . $tag . " but timed out"; } } } } sub run { my ($self) = @_; # login to sddm $self->boot_to_dm; # install packages select_console 'log-console'; if (get_var('OPENQA_ADD_TESTING_REPO')) { assert_script_run 'wget ' . data_url('add_testing_repo.rb'), 16; assert_script_sudo 'ruby add_testing_repo.rb ', 60 * 30; } assert_script_run 'wget ' . data_url('qt_compat_install.rb'), 16; assert_script_sudo 'ruby qt_compat_install.rb '. 'kdevelop skrooge kontact plasma-discover', 60 * 30; select_console 'x11'; # once install is done, login $self->login; assert_screen 'folder-desktop', 30; # In case we have any lingering windows for whatever weird reason: send_key_while_needlematch('breeze-close', 'alt-f4', 20, 2); x11_start_program 'discover' ; assert_screen 'breeze-close'; send_key_while_needlematch('breeze-close', 'alt-f4', 20, 2); x11_start_program 'kdevelop'; assert_screen 'breeze-close'; send_key_while_needlematch('breeze-close', 'alt-f4', 20, 2); x11_start_program('skrooge'); assert_screen 'breeze-close'; send_key_while_needlematch('breeze-close', 'alt-f4', 20, 2); x11_start_program('kontact'); assert_screen 'breeze-close'; # apparently you can't close the kontact account wizard with alt-f4. wtf. # https://bugs.kde.org/show_bug.cgi?id=388815 # instead we xkill it. We'll then continue closing as per usual. xkill_while_needlematch('breeze-close', 20, 2); # If all went fine we should match our desktop again! assert_screen 'folder-desktop', 30; } +sub post_fail_hook { + my ($self) = shift; + $self->SUPER::post_fail_hook; + + select_console 'log-console'; + + # Uploads end up in wok/ulogs/ + assert_script_run 'apt-cache policy kwayland-data > /tmp/kwayland-policy.txt'; + upload_logs '/tmp/kwayland-policy.txt' +} + + 1;