1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-25 07:13:09 +00:00
os-autoinst-distri-fedora/tests/server_cockpit_updates.pm
Adam Williamson 8251756331 Revert to having tests, not the scheduler, download packages (#108)
This effectively reverts 97618193 - but had to be done manually
and adjusted to maintain support for testing side tags and for
testing multiple tasks, since those features were added since
the update ISO change.

The 'scheduler injects ISOs of packages into the tests' approach
was intended to speed things up, especially for large updates,
and it did, but it had a few drawbacks. It means restarting
older tests from the web UI doesn't work as the ISOs get garbage
collected (you have to re-schedule in this case). And it has the
rather large problem that you can now only schedule tests from
the openQA server (or at least a machine with the openQA asset
share mounted), because the package download and ISO creation
just happen wherever the scheduler is running and assume that
the openQA asset share that will be used by the tests is at
/var/lib/openqa/share in that filesystem.

That's too big of a drawback to continue with this approach, IMO,
so this reverts back to the old way of doing things, with a bit
of refactoring to clean up the flow a little, and with support
for testing side tags and multiple tasks maintained.

As a follow-up I'm going to see if I can replace
_download_packages with a much more efficient downloader script
to mitigate the time this process takes on each test, especially
for large updates.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-01-11 11:31:40 -08:00

70 lines
1.9 KiB
Perl

use base "installedtest";
use strict;
use testapi;
use utils;
use packagetest;
use cockpit;
sub run {
my $self = shift;
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
start_cockpit(login => 1);
# 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
# 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.
#
last if (check_screen("cockpit_updates_updated"));
if (check_screen("cockpit_updates_reconnect", 1)) {
quit_firefox;
start_cockpit(login => 1, admin => 0);
select_cockpit_update();
last;
}
# 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';
last;
}
else {
sleep 10;
$run = $run + 1;
}
}
# Check that the system is updated
assert_screen 'cockpit_updates_updated';
# Switch off Cockpit
quit_firefox;
# Verify that the test package was updated correctly.
verify_updated_packages;
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et: