2019-09-10 12:59:57 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
|
|
|
use testapi;
|
|
|
|
use utils;
|
|
|
|
use packagetest;
|
|
|
|
use cockpit;
|
|
|
|
|
|
|
|
sub run {
|
2022-07-28 20:32:57 +00:00
|
|
|
my $self = shift;
|
2019-09-10 12:59:57 +00:00
|
|
|
|
|
|
|
my $cockdate = "0";
|
|
|
|
# Remove a package, disable repositories and enable test repositories, install the package
|
|
|
|
# from that repository to make the system outdated and verify that that package was
|
|
|
|
# correctly installed.
|
|
|
|
prepare_test_packages;
|
|
|
|
verify_installed_packages;
|
|
|
|
|
|
|
|
# Start Cockpit
|
2022-11-25 19:24:52 +00:00
|
|
|
start_cockpit(login => 1);
|
2019-09-10 12:59:57 +00:00
|
|
|
# Navigate to update screen
|
|
|
|
select_cockpit_update();
|
|
|
|
|
|
|
|
|
|
|
|
# Install the rest of the updates, or any updates
|
|
|
|
# that have not been previously installed.
|
|
|
|
assert_and_click 'cockpit_updates_all_install';
|
|
|
|
my $run = 0;
|
|
|
|
while ($run < 40) {
|
|
|
|
# When Cockpit packages are also included in the updates
|
|
|
|
# the user is forced to reconnect, i.e. to restart the Web Application
|
|
|
|
# and relog for further interaction. We will check if reconnection is
|
2022-11-25 19:24:52 +00:00
|
|
|
# needed and if so, we will restart Firefox and login again. We do
|
|
|
|
# *not* need to gain admin privs again, trying to do so will fail.
|
2019-09-10 12:59:57 +00:00
|
|
|
#
|
2021-02-18 22:33:32 +00:00
|
|
|
last if (check_screen("cockpit_updates_updated"));
|
2019-09-10 12:59:57 +00:00
|
|
|
if (check_screen("cockpit_updates_reconnect", 1)) {
|
2020-03-20 20:43:42 +00:00
|
|
|
quit_firefox;
|
2022-11-25 19:24:52 +00:00
|
|
|
start_cockpit(login => 1, admin => 0);
|
2019-09-10 12:59:57 +00:00
|
|
|
select_cockpit_update();
|
2021-02-18 22:33:32 +00:00
|
|
|
last;
|
2019-09-10 12:59:57 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
# Ignore rebooting the system because we want to finish the test instead.
|
|
|
|
elsif (check_screen('cockpit_updates_restart_ignore', 1)) {
|
|
|
|
assert_and_click 'cockpit_updates_restart_ignore';
|
2021-02-18 22:33:32 +00:00
|
|
|
last;
|
2019-09-10 12:59:57 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
sleep 10;
|
|
|
|
$run = $run + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# Check that the system is updated
|
|
|
|
assert_screen 'cockpit_updates_updated';
|
|
|
|
|
|
|
|
# Switch off Cockpit
|
2020-03-20 20:43:42 +00:00
|
|
|
quit_firefox;
|
2019-09-10 12:59:57 +00:00
|
|
|
|
|
|
|
# Verify that the test package was updated correctly.
|
|
|
|
verify_updated_packages;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
2022-07-28 20:32:57 +00:00
|
|
|
return {always_rollback => 1};
|
2019-09-10 12:59:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|