1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-09-25 07:38:52 +00:00
os-autoinst-distri-fedora/tests/base_package_install_remove.pm
Adam Williamson 29b065dd65 Replace ftp with autofs in the package install test (#413)
As reported by @yselkowitz , ftp is no longer in ELN, so this
test fails on ELN composes. autofs is in ELN, has minimal
dependencies and doesn't change often, so it looks like a good
option.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-08-28 14:18:09 -07:00

58 lines
1.8 KiB
Perl

use base "installedtest";
use strict;
use testapi;
use utils;
sub run {
my $self = shift;
# switch to TTY3 for both, graphical and console tests
$self->root_console(tty => 3);
# This test case tests that packages can be correctly installed and removed.
# We will test by installing two packages - autofs and mc.
#
# Install the FTP package.
assert_script_run("dnf install -y autofs", timeout => 240);
# Check the main packages are installed.
# Confirm that dnf lists the package
assert_script_run("dnf list autofs");
# Confirm that RPM lists the packages
assert_script_run("rpm -q autofs");
# Verify the installations using rpm --verify
assert_script_run("rpm --verify autofs");
# Install the MC package.
assert_script_run("dnf install -y mc", timeout => 240);
# Check the main packages are installed.
# Confirm that dnf lists the package
assert_script_run("dnf list mc");
# Confirm that RPM lists the packages
assert_script_run("rpm -q mc");
# Verify the installations using rpm --verify
assert_script_run("rpm --verify mc");
# Now we will uninstall the packages again and we will check that they have been uninstalled.
# We will not check that all of the dependencies have been uninstalled, too, because the
# dependencies might have been on the system already to satisfy some other packages' needs,
# which we believe is the normal user approach.
#
# Uninstall the packages.
assert_script_run("dnf remove -y autofs mc");
# Reports by the DNF
assert_script_run("!dnf list autofs");
assert_script_run("!dnf list mc");
# Reports by the RPM
assert_script_run("!rpm -q autofs");
assert_script_run("!rpm -q mc");
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et: