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;
|
2021-03-25 10:27:58 +00:00
|
|
|
|
2018-09-26 13:32:42 +00:00
|
|
|
sub run {
|
|
|
|
my $self=shift;
|
|
|
|
# switch to tty and login as root
|
|
|
|
$self->root_console(tty=>3);
|
|
|
|
|
2021-03-25 10:27:58 +00:00
|
|
|
# Install a Ruby module.
|
|
|
|
my $name = "nodejs";
|
|
|
|
my $stream = "14";
|
2022-02-07 12:27:59 +00:00
|
|
|
my $profile = "common";
|
2021-03-25 10:27:58 +00:00
|
|
|
assert_script_run("dnf module install -y $name:$stream/$profile");
|
2018-09-26 13:32:42 +00:00
|
|
|
|
2021-03-25 10:27:58 +00:00
|
|
|
# Check that it is listed in the installed list.
|
|
|
|
my $enabled = script_output('dnf module list --installed');
|
|
|
|
my @enabled_modules = parse_module_list($enabled);
|
|
|
|
my $found = is_listed($name, $stream, \@enabled_modules);
|
|
|
|
unless ($found) {
|
|
|
|
die "The installed module is not listed in the list of installed modules but it should be.";
|
|
|
|
}
|
2018-09-26 13:32:42 +00:00
|
|
|
|
2021-03-25 10:27:58 +00:00
|
|
|
# Check that it is listed in the enabled list.
|
|
|
|
my $disabled = script_output('dnf module list --enabled');
|
|
|
|
my @disabled_modules = parse_module_list($disabled);
|
|
|
|
$found = is_listed($name, $stream, \@disabled_modules);
|
|
|
|
unless ($found) {
|
|
|
|
die "The installed module is not listed in the list of enabled modules but it should be.";
|
|
|
|
}
|
2019-07-10 08:47:10 +00:00
|
|
|
|
2021-03-25 10:27:58 +00:00
|
|
|
# Remove the module again.
|
|
|
|
assert_script_run("dnf module remove -y $name:$stream");
|
|
|
|
|
|
|
|
# Check that it is not listed in the installed list.
|
|
|
|
my $enabled = script_output('dnf module list --installed');
|
|
|
|
my @enabled_modules = parse_module_list($enabled);
|
|
|
|
my $found = is_listed($name, $stream, \@enabled_modules);
|
|
|
|
if ($found) {
|
|
|
|
die "The installed module is listed in the list of installed modules but it should not be.";
|
|
|
|
}
|
2018-09-26 13:32:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|