1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-12-01 17:53:08 +00:00
os-autoinst-distri-fedora/tests/modularity_update_norepo.pm
Lukáš Růžička 114610bf90 Rewrite Modularity tests to use Perl only.
The Modularity tests rely on an external script to test the modular
behaviour of DNF. There is a potentional risk that the connection
is be down and the script cannot be downloaded.

This enhancement uses a regular OpenQA perl test case script to only
invoke DNF commands and parse their output to test the same behaviour
that we have been testing already.

This enhancement picks a random module for each of the operations,
and thus tries to mimick reality a little bit more.
2021-05-03 19:13:09 +00:00

33 lines
925 B
Perl

use base "installedtest";
use strict;
use testapi;
use utils;
use modularity;
sub run {
my $self=shift;
# switch to tty and login as root
$self->root_console(tty=>3);
# Update the system
assert_script_run('dnf update -y');
# Enable and install the nodejs module, stream 11.
assert_script_run('dnf module install -y nodejs:15');
# Update the system without modular repos.
assert_script_run('dnf update --disablerepo=\*modular -y');
# Check that the same version is listed in the installed modules.
my $installed = script_output('dnf module list --installed');
my @installed_modules = parse_module_list($installed);
my $found = is_listed("nodejs", "15", \@installed_modules);
unless ($found) {
die "The expected module and version has not been found. The version might have been incorrectly changed by the upgrade command.";
}
}
1;
# vim: set sw=4 et: