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 {
|
2023-02-12 22:59:37 +00:00
|
|
|
my $self = shift;
|
2018-09-26 13:32:42 +00:00
|
|
|
# switch to tty and login as root
|
2023-02-12 22:59:37 +00:00
|
|
|
$self->root_console(tty => 3);
|
2018-09-26 13:32:42 +00:00
|
|
|
|
2021-03-25 10:27:58 +00:00
|
|
|
# Install a Ruby module.
|
|
|
|
my $name = "nodejs";
|
|
|
|
my $stream = "14";
|
2021-08-15 05:32:07 +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.";
|
|
|
|
}
|
2023-02-12 22:59:37 +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:
|