mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2025-02-08 16:43:13 +00:00
68 lines
1.9 KiB
Perl
68 lines
1.9 KiB
Perl
use base "installedtest";
|
|
use strict;
|
|
use testapi;
|
|
use utils;
|
|
use dnf;
|
|
|
|
# This script will make sure that DNF5 is able to
|
|
# distro sync the system according to
|
|
# https://fedoraproject.org/wiki/QA:Testcase_DNF_distro-sync.
|
|
|
|
|
|
sub run {
|
|
my $self = shift;
|
|
my $version = get_var("VERSION");
|
|
$version = get_var("RAWREL") if ($version eq "Rawhide");
|
|
# Calculate the version numbers around the current release.
|
|
my $higher = $version + 1;
|
|
my $lower = $version - 1;
|
|
|
|
# Install the packages that we will work with.
|
|
assert_script_run("dnf5 install -y mc elinks");
|
|
|
|
# Downgrade one of the packages.
|
|
assert_script_run("dnf5 downgrade -y mc --releasever=$lower");
|
|
|
|
# Upgrade the other package using the rawhide repositories.
|
|
if ($version ne "Rawhide") {
|
|
assert_script_run("dnf5 install -y fedora-repos-rawhide");
|
|
}
|
|
assert_script_run("dnf5 upgrade -y elinks --enablerepo=rawhide");
|
|
|
|
# Check the versions.
|
|
my $mcver = script_output("rpm -qa mc");
|
|
my $elinksver = script_output("rpm -qa elinks");
|
|
|
|
my $lmark = "fc$lower";
|
|
my $hmark = "fc$higher";
|
|
unless (index($mcver, $lmark) != -1) {
|
|
die("The mc package could not be downgraded to $lower version.");
|
|
}
|
|
unless (index($elinksver, $hmark) != -1) {
|
|
die("The elinks package could not be upgraded to $higher version.");
|
|
}
|
|
|
|
# Distro-sync the versions
|
|
assert_script_run("dnf5 distro-sync -y", timeout => 240);
|
|
|
|
# Check the versions.
|
|
$mcver = script_output("rpm -qa mc");
|
|
$elinksver = script_output("rpm -qa elinks");
|
|
|
|
my $mark = "fc$version";
|
|
unless (index($mcver, $mark) != -1) {
|
|
die("The mc package was not synced to the current version.");
|
|
}
|
|
unless (index($elinksver, $mark) != -1) {
|
|
die("The elinks package was not synced to the current version.");
|
|
}
|
|
}
|
|
|
|
sub test_flags {
|
|
return {always_rollback => 1};
|
|
}
|
|
|
|
1;
|
|
|
|
# vim: set sw=4 et:
|