diff --git a/neon/main.pm b/neon/main.pm index de1e663..2474ca2 100644 --- a/neon/main.pm +++ b/neon/main.pm @@ -1,179 +1,179 @@ # Copyright (C) 2016-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 warnings; use testapi; use autotest; use File::Basename; use List::Util qw[min]; BEGIN { unshift @INC, dirname(__FILE__) . '/../../lib'; } $testapi::username = 'user'; $testapi::password = 'password'; testapi::set_var('OEM_USERNAME', 'oem'); testapi::set_var('OEM_PASSWORD', 'oem'); # Special var to check if run in the cloud. This enables tests to only run # certain set up bits when run in the cloud rather than a local docker # container. if (!testapi::get_var("OPENQA_IN_CLOUD")) { testapi::set_var('OPENQA_IN_CLOUD', defined $ENV{'NODE_NAME'}); } my $dist = testapi::get_var("CASEDIR") . '/lib/distribution_neon.pm'; require $dist; testapi::set_distribution(distribution_neon->new()); sub unregister_needle_tags { my ($tag) = @_; my @a = @{needle::tags($tag)}; for my $n (@a) { $n->unregister($tag); } } sub cleanup_needles { if (!testapi::get_var('SECUREBOOT')) { unregister_needle_tags('ENV-SECUREBOOT'); } else { unregister_needle_tags('ENV-NO-SECUREBOOT'); } if (testapi::get_var('UEFI')) { unregister_needle_tags('ENV-BIOS'); } else { # BIOS mode unregister_needle_tags('ENV-UEFI'); } unless (testapi::get_var('OPENQA_INSTALLATION_OFFLINE')) { unregister_needle_tags('ENV-OFFLINE'); } unless (testapi::get_var('OPENQA_INSTALLATION_NONENGLISH')) { unregister_needle_tags('ENV-NONENGLISH'); } # Drop needles tagged with a different TYPE. # This is a bit inflexible right now but the best to be done at short # notice. my $good_tag = sprintf('ENV-TYPE-%s', testapi::get_var('TYPE')); for my $tag (keys %needle::tags) { if ($tag !~ /ENV-TYPE-/) { next; } if ($tag eq $good_tag) { next; } # We've found a disqualified tag. Drop all needles that have it. # UNLESS that needle has a qualifier tag (i.e. ENV-TYPE-$TYPE). # qualification > disqualification my @needles = @{needle::tags($tag)}; for my $needle (@needles) { if ($needle->has_tag($good_tag)) { next; } $needle->unregister($tag); } } # FIXME: workaround for bionic # to get bionic tests quickly off the ground we lower all match limits to # 70% . this should give reasonable leeway with most font differences. # additionally TTY is also bugging around and sometimes using wrong colors # we'll want to gradually increase this to 100% and sort out failures # as they pop up. if (testapi::get_var('OPENQA_SERIES') eq 'bionic') { # needle::needles is so overlapping names are lost. # Go through tags instead for my $needles (values %needle::tags) { for my $needle (@{$needles}) { my @areas = $needle->{area}; for my $area (@{$needle->{area}}) { $area->{match} //= 95; # os-autoinst doesn't default this. $area->{match} = min($area->{match}, 70); } } } } # TODO: implement exclusion of newer needles on older systems # Now that we dropped all unsuitable needles. We should restirct the match. # For all needles with our good tag we'll drop all needles that have the # other tags but not our good tag # e.g. n1 [ENV-TYPE-stable, dolphin] # n2 [dolphin] # -> we unregister n2 as it is less suitable than n1 } $needle::cleanuphandler = \&cleanup_needles; if (testapi::get_var("INSTALLATION") && testapi::get_var('OPENQA_PARTITIONING')) { if (testapi::get_var("TYPE") eq 'unstable') { autotest::loadtest('tests/install/calamares_partitioning.pm'); } else { # For ubiquity the partitioning test is the regular install test but # it has built-in conditionals for OPENQA_PARTITIONING. This is because # with ubiquity we need to run complete installs to conduct our tests, # so a separate test would be a huge copy pasta. Cala OTOH has # a super simplified much faster test which easily stands up on its own. autotest::loadtest('tests/install_ubiquity.pm'); } } elsif (testapi::get_var("INSTALLATION")) { my %test = ( - 'devedition-gitunstable' => "tests/install_calamares.pm", + 'unstable' => "tests/install_calamares.pm", '' => "tests/install_ubiquity.pm" ); if (testapi::get_var("INSTALLATION_OEM")) { autotest::loadtest('tests/install/ubiquity_oem.pm'); } else { autotest::loadtest($test{testapi::get_var("TYPE")} || $test{''}); } autotest::loadtest('tests/install/first_start.pm'); } elsif (testapi::get_var('OPENQA_SNAP_NAME')) { print("Running a snap test...\n"); my $snap_name = testapi::get_var('OPENQA_SNAP_NAME'); my $script = "tests/snap/$snap_name.pm"; if (-f join('/', testapi::get_var('CASEDIR'), $script)) { print("Found specific test for snap $script\n"); autotest::loadtest($script); } else { print("Using generic test for snap $snap_name\n"); autotest::loadtest("tests/snap/generic.pm"); } } elsif (testapi::get_var("TESTS_TO_RUN")) { my @testpaths = split /:/, testapi::get_var("TESTS_TO_RUN"); for my $testpath (@testpaths) { autotest::loadtest $testpath; } } elsif (testapi::get_var("PLASMA_DESKTOP")) { autotest::loadtest('tests/plasma/plasma_folder.pm'); autotest::loadtest('tests/plasma/plasma_favorite.pm'); autotest::loadtest('tests/plasma/plasma_alternatives.pm'); # Do not run tests after the lockscreen. We log into a second session # to get away from a switch-user sddm (which has no other means to do so # via the GUI). This may have any number of unfortunate side effects in the # main session (e.g. cache corruption?). autotest::loadtest('tests/plasma/plasma_lockscreen.pm'); } else { testapi::diag 'ERROR FAILURE BAD ERROR no clue what to run!'; exit 1; } 1; diff --git a/neon/needles/live/live-desktop-devedition-gitunstable.json b/neon/needles/live/live-desktop-devedition-gitunstable.json index 0636106..935b472 100644 --- a/neon/needles/live/live-desktop-devedition-gitunstable.json +++ b/neon/needles/live/live-desktop-devedition-gitunstable.json @@ -1,34 +1,34 @@ { "area": [ { "height": 33, "match": 95, "type": "match", "width": 645, "xpos": 0, "ypos": 735 }, { "height": 33, "match": 64, "type": "match", "width": 28, "xpos": 836, "ypos": 734 }, { "height": 725, "match": 95, "type": "match", "width": 919, "xpos": 105, "ypos": 1 } ], "properties": [], "tags": [ "live-desktop", - "live-desktop-devedition-gitunstable" + "live-desktop-unstable" ] } diff --git a/neon/needles/plasma_lockscreen/bionic/plasma-locked-idle.json b/neon/needles/plasma_lockscreen/bionic/plasma-locked-idle.json index b63c903..95461f3 100644 --- a/neon/needles/plasma_lockscreen/bionic/plasma-locked-idle.json +++ b/neon/needles/plasma_lockscreen/bionic/plasma-locked-idle.json @@ -1,46 +1,46 @@ { "area": [ { "height": 768, "match": 95, "type": "match", "width": 129, "xpos": 0, "ypos": 0 }, { "height": 43, "match": 60, "type": "match", "width": 42, "xpos": 621, "ypos": 150 }, { "height": 768, "match": 95, "type": "match", "width": 118, "xpos": 903, "ypos": 0 }, { "height": 547, "match": 95, "type": "match", "width": 1024, "xpos": 0, "ypos": 217 } ], "properties": [], "tags": [ "plasma-locked-idle", "plasma-locked", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable", + "ENV-TYPE-testing", "ENV-SERIES-bionic" ] } diff --git a/neon/needles/plasma_lockscreen/plasma-locked-idle-wallpaper.json b/neon/needles/plasma_lockscreen/plasma-locked-idle-wallpaper.json index cb01bab..5f79d01 100644 --- a/neon/needles/plasma_lockscreen/plasma-locked-idle-wallpaper.json +++ b/neon/needles/plasma_lockscreen/plasma-locked-idle-wallpaper.json @@ -1,21 +1,21 @@ { "area": [ { "height": 353, "match": 95, "type": "match", "width": 1024, "xpos": 0, "ypos": 414 } ], "properties": [], "tags": [ "plasma-locked-idle", "plasma-locked", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "plasma-locked-idle-wallpaper", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable" + "ENV-TYPE-testing" ] } diff --git a/neon/needles/plasma_lockscreen/plasma-locked-idle.json b/neon/needles/plasma_lockscreen/plasma-locked-idle.json index 7feee47..7e07b06 100644 --- a/neon/needles/plasma_lockscreen/plasma-locked-idle.json +++ b/neon/needles/plasma_lockscreen/plasma-locked-idle.json @@ -1,45 +1,45 @@ { "area": [ { "height": 768, "match": 95, "type": "match", "width": 129, "xpos": 0, "ypos": 0 }, { "height": 43, "match": 60, "type": "match", "width": 89, "xpos": 605, "ypos": 146 }, { "height": 768, "match": 95, "type": "match", "width": 118, "xpos": 903, "ypos": 0 }, { "height": 547, "match": 95, "type": "match", "width": 1024, "xpos": 0, "ypos": 217 } ], "properties": [], "tags": [ "plasma-locked-idle", "plasma-locked", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable" + "ENV-TYPE-testing" ] } diff --git a/neon/needles/plasma_lockscreen/plasma-locked-keyboard-icon-active.json b/neon/needles/plasma_lockscreen/plasma-locked-keyboard-icon-active.json index 28c51af..1a05e6a 100644 --- a/neon/needles/plasma_lockscreen/plasma-locked-keyboard-icon-active.json +++ b/neon/needles/plasma_lockscreen/plasma-locked-keyboard-icon-active.json @@ -1,20 +1,20 @@ { "area": [ { "height": 34, "match": 95, "type": "match", "width": 169, "xpos": 0, "ypos": 733 } ], "properties": [], "tags": [ "plasma-locked-keyboard-icon-active", "plasma-locked-keyboard-icon", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable" + "ENV-TYPE-testing" ] } diff --git a/neon/needles/plasma_lockscreen/plasma-locked-keyboard-icon-inactive.json b/neon/needles/plasma_lockscreen/plasma-locked-keyboard-icon-inactive.json index 39a1b71..cbf95ca 100644 --- a/neon/needles/plasma_lockscreen/plasma-locked-keyboard-icon-inactive.json +++ b/neon/needles/plasma_lockscreen/plasma-locked-keyboard-icon-inactive.json @@ -1,20 +1,20 @@ { "area": [ { "height": 39, "match": 95, "type": "match", "width": 152, "xpos": 0, "ypos": 728 } ], "properties": [], "tags": [ "plasma-locked-keyboard-icon-inactive", "plasma-locked-keyboard-icon", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable" + "ENV-TYPE-testing" ] } diff --git a/neon/needles/plasma_lockscreen/plasma-locked-keyboard-q.json b/neon/needles/plasma_lockscreen/plasma-locked-keyboard-q.json index 6f8abe3..4585447 100644 --- a/neon/needles/plasma_lockscreen/plasma-locked-keyboard-q.json +++ b/neon/needles/plasma_lockscreen/plasma-locked-keyboard-q.json @@ -1,19 +1,19 @@ { "area": [ { "height": 49, "match": 95, "type": "match", "width": 68, "xpos": 56, "ypos": 464 } ], "properties": [], "tags": [ "plasma-locked-keyboard-q", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable" + "ENV-TYPE-testing" ] } diff --git a/neon/needles/plasma_lockscreen/plasma-locked-keyboard-qq.json b/neon/needles/plasma_lockscreen/plasma-locked-keyboard-qq.json index 26954e8..8654f01 100644 --- a/neon/needles/plasma_lockscreen/plasma-locked-keyboard-qq.json +++ b/neon/needles/plasma_lockscreen/plasma-locked-keyboard-qq.json @@ -1,27 +1,27 @@ { "area": [ { "height": 43, "match": 90, "type": "match", "width": 316, "xpos": 352, "ypos": 370 }, { "height": 48, "match": 90, "type": "match", "width": 51, "xpos": 64, "ypos": 466 } ], "properties": [], "tags": [ "plasma-locked-keyboard-qq", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable" + "ENV-TYPE-testing" ] } diff --git a/neon/needles/plasma_lockscreen/plasma-locked-keyboard.json b/neon/needles/plasma_lockscreen/plasma-locked-keyboard.json index d6fcc0a..4b05461 100644 --- a/neon/needles/plasma_lockscreen/plasma-locked-keyboard.json +++ b/neon/needles/plasma_lockscreen/plasma-locked-keyboard.json @@ -1,19 +1,19 @@ { "area": [ { "height": 165, "match": 95, "type": "match", "width": 902, "xpos": 49, "ypos": 356 } ], "properties": [], "tags": [ "plasma-locked-keyboard", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable" + "ENV-TYPE-testing" ] } diff --git a/neon/needles/plasma_lockscreen/plasma-locked-switch-icon.json b/neon/needles/plasma_lockscreen/plasma-locked-switch-icon.json index 4611433..31ced61 100644 --- a/neon/needles/plasma_lockscreen/plasma-locked-switch-icon.json +++ b/neon/needles/plasma_lockscreen/plasma-locked-switch-icon.json @@ -1,19 +1,19 @@ { "area": [ { "height": 94, "match": 95, "type": "match", "width": 101, "xpos": 456, "ypos": 595 } ], "properties": [], "tags": [ "plasma-locked-switch-icon", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable" + "ENV-TYPE-testing" ] } diff --git a/neon/needles/plasma_lockscreen/plasma-locked-switch.json b/neon/needles/plasma_lockscreen/plasma-locked-switch.json index 419fd8e..fb369b0 100644 --- a/neon/needles/plasma_lockscreen/plasma-locked-switch.json +++ b/neon/needles/plasma_lockscreen/plasma-locked-switch.json @@ -1,35 +1,35 @@ { "area": [ { "height": 164, "match": 95, "type": "match", "width": 307, "xpos": 363, "ypos": 227 }, { "height": 28, "match": 95, "type": "match", "width": 64, "xpos": 479, "ypos": 657 }, { "height": 54, "match": 95, "type": "match", "width": 314, "xpos": 356, "ypos": 404 } ], "properties": [], "tags": [ "plasma-locked-switch", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable" + "ENV-TYPE-testing" ] } diff --git a/neon/needles/plasma_lockscreen/plasma-locked.json b/neon/needles/plasma_lockscreen/plasma-locked.json index 81670d1..09fdb1d 100644 --- a/neon/needles/plasma_lockscreen/plasma-locked.json +++ b/neon/needles/plasma_lockscreen/plasma-locked.json @@ -1,35 +1,35 @@ { "area": [ { "height": 36, "match": 80, "type": "match", "width": 310.5, "xpos": 356, "ypos": 412 }, { "height": 36.66666666666663, "match": 95, "type": "match", "width": 296.33333333333337, "xpos": 365.6666666666667, "ypos": 448.8888888888889 }, { "height": 94, "match": 95, "type": "match", "width": 101, "xpos": 456, "ypos": 595 } ], "properties": [], "tags": [ "plasma-locked", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "ENV-TYPE-useredition", - "ENV-TYPE-devedition-gitstable" + "ENV-TYPE-testing" ] } diff --git a/neon/needles/sddm/bionic/sddm-es.json b/neon/needles/sddm/bionic/sddm-es.json index ed6a8f3..b76910c 100644 --- a/neon/needles/sddm/bionic/sddm-es.json +++ b/neon/needles/sddm/bionic/sddm-es.json @@ -1,31 +1,31 @@ { "area": [ { "height": 38, "match": 95, "type": "match", "width": 244, "xpos": 0, "ypos": 730 }, { "height": 477, "match": 95, "type": "match", "width": 862, "xpos": 91, "ypos": 211 } ], "properties": [], "tags": [ "sddm-espanol", "sddm", "ENV-NONENGLISH", "sddm-es", - "ENV-TYPE-devedition-gitunstable", - "ENV-TYPE-devedition-gitstable", + "ENV-TYPE-unstable", + "ENV-TYPE-testing", "ENV-TYPE-useredition", "ENV-SERIES-bionic" ] } diff --git a/neon/needles/sddm/sddm-choose-session.json b/neon/needles/sddm/sddm-choose-session.json index 00d965d..dfe90f1 100644 --- a/neon/needles/sddm/sddm-choose-session.json +++ b/neon/needles/sddm/sddm-choose-session.json @@ -1,19 +1,19 @@ { "area": [ { "height": 30.33333333333337, "match": 95, "type": "match", "width": 164.33333333333337, "xpos": 139, "ypos": 737.6666666666665 } ], "properties": [], "tags": [ "sddm-choose-session", - "ENV-TYPE-devedition-gitunstable", - "ENV-TYPE-devedition-gitstable", + "ENV-TYPE-unstable", + "ENV-TYPE-testing", "ENV-TYPE-useredition" ] } diff --git a/neon/needles/sddm/sddm-es.json b/neon/needles/sddm/sddm-es.json index cfb5134..714e8c1 100644 --- a/neon/needles/sddm/sddm-es.json +++ b/neon/needles/sddm/sddm-es.json @@ -1,30 +1,30 @@ { "area": [ { "height": 38, "match": 95, "type": "match", "width": 244, "xpos": 0, "ypos": 730 }, { "height": 477, "match": 95, "type": "match", "width": 862, "xpos": 91, "ypos": 211 } ], "properties": [], "tags": [ "sddm-espanol", "sddm", "ENV-NONENGLISH", "sddm-es", - "ENV-TYPE-devedition-gitunstable", - "ENV-TYPE-devedition-gitstable", + "ENV-TYPE-unstable", + "ENV-TYPE-testing", "ENV-TYPE-useredition" ] } diff --git a/neon/needles/sddm/sddm-idle-unstable.json b/neon/needles/sddm/sddm-idle-unstable.json index 31d7ca7..7922757 100644 --- a/neon/needles/sddm/sddm-idle-unstable.json +++ b/neon/needles/sddm/sddm-idle-unstable.json @@ -1,28 +1,28 @@ { "area": [ { "height": 148, "match": 95, "type": "exclude", "width": 715, "xpos": 148, "ypos": 61 }, { "height": 768, "match": 95, "type": "match", "width": 1024, "xpos": 0, "ypos": 0 } ], "properties": [], "tags": [ "sddm-idle", "sddm", - "ENV-TYPE-devedition-gitunstable", + "ENV-TYPE-unstable", "sddm-idle-unstable" ] } diff --git a/neon/needles/sddm/sddm-idle.json b/neon/needles/sddm/sddm-idle.json index 2f3ba8a..8cbe1bb 100644 --- a/neon/needles/sddm/sddm-idle.json +++ b/neon/needles/sddm/sddm-idle.json @@ -1,28 +1,28 @@ { "area": [ { "height": 38, "match": 95, "type": "match", "width": 1024, "xpos": 0, "ypos": 730 }, { "height": 477, "match": 95, "type": "match", "width": 862, "xpos": 91, "ypos": 211 } ], "properties": [], "tags": [ "sddm-idle", "sddm", - "ENV-TYPE-devedition-gitstable", + "ENV-TYPE-testing", "ENV-TYPE-useredition" ] } diff --git a/neon/needles/sddm/sddm-plasma-wayland.json b/neon/needles/sddm/sddm-plasma-wayland.json index 4e87d09..4d009cb 100644 --- a/neon/needles/sddm/sddm-plasma-wayland.json +++ b/neon/needles/sddm/sddm-plasma-wayland.json @@ -1,19 +1,19 @@ { "area": [ { "height": 15, "match": 95, "type": "match", "width": 155.33333333333331, "xpos": 143.66666666666669, "ypos": 747 } ], "properties": [], "tags": [ "sddm-plasma-wayland", - "ENV-TYPE-devedition-gitunstable", - "ENV-TYPE-devedition-gitstable", + "ENV-TYPE-unstable", + "ENV-TYPE-testing", "ENV-TYPE-useredition" ] } diff --git a/neon/needles/sddm/sddm.json b/neon/needles/sddm/sddm.json index 6bf7d61..c31426f 100644 --- a/neon/needles/sddm/sddm.json +++ b/neon/needles/sddm/sddm.json @@ -1,27 +1,27 @@ { "area": [ { "height": 38, "match": 95, "type": "match", "width": 307, "xpos": 0, "ypos": 730 }, { "height": 477, "match": 95, "type": "match", "width": 862, "xpos": 91, "ypos": 211 } ], "properties": [], "tags": [ "sddm", - "ENV-TYPE-devedition-gitunstable", - "ENV-TYPE-devedition-gitstable", + "ENV-TYPE-unstable", + "ENV-TYPE-testing", "ENV-TYPE-useredition" ] } diff --git a/neon/tests/install/upgrade_bionic.pm b/neon/tests/install/upgrade_bionic.pm index 441d8e4..83fbb7b 100644 --- a/neon/tests/install/upgrade_bionic.pm +++ b/neon/tests/install/upgrade_bionic.pm @@ -1,304 +1,304 @@ # 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 testapi; sub run { my ($self) = @_; $self->boot_to_dm; # Setup a second user with an encrypted home. In ubiquity we never really # disabled home encryption as we didn't wanna support it but then it was # working fine and we had no reason to take away something that works. # Now we pay the price for that niceness. # As a basic requirement we'll want encrypted homes to be still encrypted # and accessible after the upgrade. Since we do not install encrypted # images though we'll have to manually setup an encrypted home first. # This isn't perfectly representive of how a ubiquity encrypted home # may look like, but it should be close enough. my $encrypt_user = 'encrypty'; my $encrypt_password = 'password'; select_console 'log-console'; { # https://help.ubuntu.com/community/EncryptedHome assert_script_sudo 'apt update', 60; assert_script_sudo 'apt install -y ecryptfs-utils', 60 * 5; # Simulate an oddity where some users seem to somehow ended up with # ecryptfs-utils only being a transitive auto dep that would end up # in the remove list of the upgrade. assert_script_sudo 'apt-mark auto ecryptfs-utils', 16; script_sudo "adduser --gecos '' --encrypt-home --force $encrypt_user", 0; assert_screen 'adduser-password1'; type_string $encrypt_password; send_key 'ret'; assert_screen 'adduser-password2'; type_string $encrypt_password; send_key 'ret'; assert_screen 'adduser-done'; # Give the new user sudo privs so they may actually chown the serial # device for logging. assert_script_sudo "adduser $encrypt_user sudo"; script_run 'logout', 0; assert_screen 'tty6-selected'; type_string $encrypt_user; send_key 'ret'; assert_screen 'tty-password'; type_password $encrypt_password; send_key 'ret'; # This is a bit stupid but we don't actually have a better way to # check except for looking at a completely new needle. Go with this # for now. sleep 4; validate_script_output 'ls', sub { m/^$/ }; assert_script_run 'touch marker'; validate_script_output 'ls', sub { m/^marker$/ }; script_run 'logout', 0; reset_consoles; # Relogin by simply switching to the console again. select_console 'log-console'; # Cache sudo password & make sure the home is unmounted! # https://wiki.ubuntu.com/EncryptedHomeFolder # Sometimes pam fails to unmount your folder (esp if use # graphical login), leaving it open even though your logged out. script_sudo "umount /home/$encrypt_user"; # ...and make sure the home is encrypted! validate_script_output "sudo ls /home/$encrypt_user", sub { m/.*Access-Your-Private-Data\.desktop.*/ }; # Take away sudo access again so it doesn't show up in polkit. assert_script_sudo "deluser $encrypt_user sudo"; } select_console 'x11'; $self->login; assert_screen 'folder-desktop'; if (!check_screen('folder-desktop-color', 4)) { # TODO: drop once all images have been rotated (~mid Sept 2018) record_soft_failure 'Testing an old disk image without static wallpaper'; mouse_set 400, 300; mouse_click 'right'; assert_and_click 'plasma-context-config-folder'; assert_and_click 'plasma-folder-config-background'; assert_and_click 'plasma-folder-config-background-color'; # Should the deafault ever become undesirable: #1d99f3 is the lovely color. assert_and_click 'kcm-ok'; } # Should now be lovely blue. assert_screen 'folder-desktop-color'; # x11_start_program 'distro-release-notifier'; x11_start_program 'konsole'; assert_screen 'konsole'; # Assert that the notifier was auto-started. assert_script_run 'pidof distro-release-notifier'; # And trigger a devel upgrade. type_string 'neon-preview-upgrade; exit'; send_key 'ret'; assert_and_click 'distro-release-notifier'; assert_and_click 'distro-release-notifier-2'; assert_screen 'ubuntu-upgrade-polkit'; type_password $testapi::password; send_key 'ret'; assert_screen 'ubuntu-upgrade-fetcher-notes'; assert_and_click 'ubuntu-upgrade-fetcher-notes'; assert_screen 'ubuntu-upgrade'; # ... preparation happens ... assert_and_click 'ubuntu-upgrade-start', 'left', 60 * 5; # A config was changed by us to force the bionic upgrade to be enabled, # we should get a diff prompt. assert_and_click 'ubuntu-upgrade-diff-2', 'left', 60 * 10; # (This has a super long time out because upgrading an all-packages # install takes forever) # TODO: consider finding a better way to detect problems than such a long # time out. maybe assert [remove, standardwindow], if the window gets # covered by an error or unexpected dialog we'd then abort immediately. assert_screen [qw(ubuntu-upgrade-error ubuntu-upgrade-remove)], 60 * 30; if (match_has_tag('ubuntu-upgrade-error')) { die 'We got error while upgrading.'; } assert_and_click 'ubuntu-upgrade-remove', 'left'; assert_screen 'ubuntu-upgrade-restart', 60 * 5; # upload logs in case something went wrong! select_console 'log-console'; { assert_script_sudo 'tar -cJf /tmp/dist-upgrade.tar.xz /var/log/dist-upgrade/'; upload_logs '/tmp/dist-upgrade.tar.xz'; my %type_to_path = ( - 'devedition-gitunstable' => 'dev/unstable', - 'devedition-gistable' => 'dev/stable', + 'devedition-gitunstable' => 'unstable', + 'devedition-gistable' => 'testing', 'useredition' => 'user', 'userltsedition' => 'user/lts' ); my $path = $type_to_path{get_var('TYPE')}; # NB: this hardcodes unstable, when we introduce other tests this needs # fixing somehow (map types to repos in a hash?) validate_script_output "cat /etc/apt/sources.list.d/neon.list", sub { m{.*^(\s?)deb(\s?)http://archive.neon.kde.org/$path(\s?)bionic(\s?)main.*} }; # Attempt a dist-upgrade. This should not cause any downgrades # as per T9535. Upgrading at this point would fail since downgrades # are not allowed by default and we've not enabled them either. assert_script_sudo 'DEBIAN_FRONTEND=noninteractive apt -y dist-upgrade', 30 * 60; } select_console 'x11'; assert_and_click 'ubuntu-upgrade-restart'; # Switch to bionic mode now. # This among other things makes sure the right virtual terminals will be # used for x11 etc. set_var 'OPENQA_SERIES', 'bionic', reload_needles => 1; console('x11')->set_tty(1); reset_consoles; $self->boot_to_dm; # NB: bionic has really awkward behavior if you log out of the getty # it gets closed and you get dumped back to an active VT (i.e. SDDM). # This screws up console consistency! # As a result logout is followed by reset and there's sleeps in place to # ensure VTs are fully active by the time we attempt to select another one. my $user = $testapi::username; my $password = $testapi::password; # Before handing over to subsequent tests we'll assert encrypted homes # are still working. select_console 'log-console'; { # We don't have access... validate_script_output "sudo ls /home/$encrypt_user", sub { m/.*Access-Your-Private-Data\.desktop.*/ }; # Give the encrypted user sudo privs so they may actually chown the # serial device for logging. assert_script_sudo "adduser $encrypt_user sudo"; # Switch to encrypted user and make sure it still has access to # its data after the upgrade though... script_run 'logout', 0; reset_consoles; # Wait a bit before switching around again sleep 1; } select_console 'x11'; # Wait a bit before switching back. Since x11 doesn't assert a screen we # could be switching too quickly and end up on the wrong VT. sleep 2; # Log into encrypted user next. $testapi::username = $encrypt_user; $testapi::password = $encrypt_password; select_console 'log-console'; { assert_script_run 'ls'; validate_script_output 'ls', sub { m/^marker$/ }; # And pop back to regular user. script_run 'logout', 0; reset_consoles; # Wait a bit before switching around again sleep 1; } select_console 'x11'; # Wait a bit before switching back. Since x11 doesn't assert a screen we # could be switching too quickly and end up on the wrong VT. sleep 2; # And back into regular user. $testapi::username = $user; $testapi::password = $password; # Make sure the evdev driver is installed. We prefer evdev at this time # instead of libinput since our KCMs aren't particularly awesome for # libinput. select_console 'log-console'; { # Cache sudo password & make sure the home is unmounted! # https://wiki.ubuntu.com/EncryptedHomeFolder # Sometimes pam fails to unmount your folder (esp if use # graphical login), leaving it open even though your logged out. script_sudo "umount /home/$encrypt_user"; # Delete the encrypted user. assert_script_sudo "deluser $encrypt_user"; # Make sure the evdev driver is installed. We prefer evdev at this time # instead of libinput since our KCMs aren't particularly awesome for # libinput. assert_script_run 'dpkg -s xserver-xorg-input-evdev'; validate_script_output 'grep -e "Using input driver" /var/log/Xorg.0.log', sub { m/.+evdev.+/ }; # Also assert that the upgrade's preference file is no longer present # T9535 assert_script_run '[ ! -e /etc/apt/preferences.d/98-xenial-overrides ]' } select_console 'x11'; } sub post_fail_hook { my ($self) = shift; $self->SUPER::post_fail_hook; select_console 'log-console'; # Check if the upgrader is running on the system bus. script_run 'qdbus --system | grep -i ubuntu'; save_screenshot; upload_logs '/var/log/dpkg.log'; upload_logs '/var/log/apt/term.log'; upload_logs '/var/log/apt/history.log'; # Try to get the dist upgrade log. It might not exist depending on when # the failure occured though. script_sudo 'tar -cJf /tmp/dist-upgrade.tar.xz /var/log/dist-upgrade/'; upload_logs '/tmp/dist-upgrade.tar.xz', failok => 1; } 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 { important => 1, fatal => 1 }; } 1;