Add testcase to test the Package_install_remove testcase.
This commit is contained in:
parent
1a613fc8c2
commit
477d918b64
@ -603,6 +603,31 @@
|
||||
"USER_LOGIN": "false"
|
||||
}
|
||||
},
|
||||
"base_package_install_remove": {
|
||||
"profiles": {
|
||||
"fedora-Cloud_Base-qcow2-qcow2-aarch64-*-aarch64": 40,
|
||||
"fedora-Cloud_Base-qcow2-qcow2-ppc64le-*-ppc64le": 40,
|
||||
"fedora-Cloud_Base-qcow2-qcow2-x86_64-*-64bit": 40,
|
||||
"fedora-KDE-live-iso-x86_64-*-64bit": 42,
|
||||
"fedora-Minimal-raw_xz-raw.xz-arm-*-ARM": 42,
|
||||
"fedora-Minimal-raw_xz-raw.xz-aarch64-*-aarch64": 42,
|
||||
"fedora-Server-dvd-iso-aarch64-*-aarch64": 40,
|
||||
"fedora-Server-dvd-iso-ppc64le-*-ppc64le": 40,
|
||||
"fedora-Server-dvd-iso-x86_64-*-64bit": 40,
|
||||
"fedora-Server-raw_xz-raw.xz-aarch64-*-aarch64": 42,
|
||||
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 40,
|
||||
"fedora-Workstation-live-iso-x86_64-*-64bit": 40,
|
||||
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42
|
||||
},
|
||||
"settings": {
|
||||
"BOOTFROM": "c",
|
||||
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
|
||||
"POSTINSTALL": "base_package_install_remove",
|
||||
"ROOT_PASSWORD": "weakpassword",
|
||||
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%",
|
||||
"USER_LOGIN": "false"
|
||||
}
|
||||
},
|
||||
"base_services_start": {
|
||||
"profiles": {
|
||||
"fedora-Cloud_Base-qcow2-qcow2-aarch64-*-aarch64": 40,
|
||||
|
57
tests/base_package_install_remove.pm
Normal file
57
tests/base_package_install_remove.pm
Normal file
@ -0,0 +1,57 @@
|
||||
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 - ftp and mc.
|
||||
#
|
||||
# Install the FTP package.
|
||||
assert_script_run("dnf install -y ftp", timeout => 240);
|
||||
# Check the main packages are installed.
|
||||
# Confirm that dnf lists the package
|
||||
assert_script_run("dnf list ftp");
|
||||
# Confirm that RPM lists the packages
|
||||
assert_script_run("rpm -q ftp");
|
||||
# Verify the installations using rpm --verify
|
||||
assert_script_run("rpm --verify ftp");
|
||||
|
||||
# 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 ftp mc");
|
||||
# Reports by the DNF
|
||||
assert_script_run("!dnf list ftp");
|
||||
assert_script_run("!dnf list mc");
|
||||
# Reports by the RPM
|
||||
assert_script_run("!rpm -q ftp");
|
||||
assert_script_run("!rpm -q mc");
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub test_flags {
|
||||
return { fatal => 1 };
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
# vim: set sw=4 et:
|
Loading…
Reference in New Issue
Block a user