2018-09-26 13:32:42 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
2021-03-25 10:27:58 +00:00
|
|
|
use modularity;
|
2018-09-26 13:32:42 +00:00
|
|
|
use testapi;
|
|
|
|
use utils;
|
|
|
|
|
|
|
|
sub run {
|
|
|
|
my $self=shift;
|
|
|
|
# switch to tty and login as root
|
|
|
|
$self->root_console(tty=>3);
|
|
|
|
|
|
|
|
# The test case will check that dnf has modular functions and that
|
|
|
|
# it is possible to invoke modular commands to work with modularity.
|
2021-03-25 10:27:58 +00:00
|
|
|
|
|
|
|
# Check that modular repositories are installed and enabled.
|
|
|
|
# If the repository does not exist, the output of the command is empty.
|
2021-05-03 20:55:43 +00:00
|
|
|
if (lc(get_var('VERSION')) eq "rawhide") {
|
|
|
|
my $mrawhide_output = script_output("dnf repolist --enabled rawhide-modular");
|
|
|
|
die "The rawhide-modular repo seems not to be installed." unless (length $mrawhide_output);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
my $mfedora_output = script_output("dnf repolist --enabled fedora-modular");
|
|
|
|
die "The fedora-modular repo seems not to be installed." unless (length $mfedora_output);
|
|
|
|
my $mupdates_output = script_output("dnf repolist --enabled updates-modular");
|
|
|
|
die "The updates-modular repo seems not to be installed." unless (length $mupdates_output);
|
|
|
|
}
|
2018-09-26 13:32:42 +00:00
|
|
|
|
|
|
|
# Check that modularity works and dnf can list the modules.
|
2021-03-25 10:27:58 +00:00
|
|
|
my $modules = script_output('dnf module list --disablerepo=updates-modular --disablerepo=updates-testing-modular', timeout => 270);
|
|
|
|
my @modules = parse_module_list($modules);
|
|
|
|
die "The module list seems to be empty when it should not be." if (scalar @modules == 0);
|
2018-09-26 13:32:42 +00:00
|
|
|
|
|
|
|
# Check that modularity works and dnf can list the modules
|
|
|
|
# with the -all option.
|
2021-03-25 10:27:58 +00:00
|
|
|
$modules = script_output('dnf module list --all --disablerepo=updates-modular --disablerepo=updates-testing-modular', timeout => 270);
|
|
|
|
@modules = parse_module_list($modules);
|
|
|
|
die "The module list seems to be empty when it should not be." if (scalar @modules == 0);
|
2018-09-26 13:32:42 +00:00
|
|
|
|
|
|
|
# Check that dnf lists the enabled modules.
|
2021-03-25 10:27:58 +00:00
|
|
|
$modules = script_output('dnf module list --enabled', timeout => 270);
|
|
|
|
@modules = parse_module_list($modules);
|
|
|
|
die "There seem to be enabled modules when the list should be empty." unless (scalar @modules == 0);
|
2018-09-26 13:32:42 +00:00
|
|
|
|
|
|
|
# Check that dnf lists the disabled modules.
|
2021-03-25 10:27:58 +00:00
|
|
|
$modules = script_output('dnf module list --disabled', timeout => 270);
|
|
|
|
@modules = parse_module_list($modules);
|
|
|
|
die "There seem to be disabled modules when the list should be empty." unless (scalar @modules == 0);
|
2018-09-26 13:32:42 +00:00
|
|
|
|
|
|
|
# Check that dnf lists the installed modules.
|
2021-03-25 10:27:58 +00:00
|
|
|
$modules = script_output('dnf module list --installed', timeout => 270);
|
|
|
|
@modules = parse_module_list($modules);
|
|
|
|
die "There seem to be installed modules when the list should be empty." unless (scalar @modules == 0);
|
2018-09-26 13:32:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|