Fix the test so it works for RHEL<9 as well

Before RHEL-9 the minizip-compat-devel package was named minizip-devel
Also since F38 the minizip package was renamed to minizip-ng so we
cannot check for the minizip-devel package using the 'rpm -q' because it
will always fail and not remove the package
This commit is contained in:
Lukas Javorsky 2023-03-23 09:56:17 +00:00
commit 1e3c9243a8

View file

@ -30,13 +30,21 @@
. /usr/share/beakerlib/beakerlib.sh
PACKAGE="zlib"
MINIZIP_PACKAGE="minizip-compat-devel"
if rlIsRHEL '<9'; then
MINIZIP_PACKAGE="minizip-devel"
fi
rlJournalStart
rlPhaseStartSetup
rlRun "rpm -q minizip-devel && yum remove minizip-devel -y" 0,1
rlRun "rpm -q minizip-compat-devel || yum install minizip-compat-devel -y"
rlAssertRpm $PACKAGE
rlAssertRpm minizip-compat-devel
# Since RHEL-9 the minizip-devel was replaced by minizip-compat-devel
# so we need to remove it before installing the compat package
# they conflict with each other
if ! rlIsRHEL '<9' ; then
rlRun "yum remove minizip-devel -y" 0,1
rlRun "rpm -q $MINIZIP_PACKAGE || yum install $MINIZIP_PACKAGE -y"
fi
rlAssertRpm $MINIZIP_PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "tar -C $TmpDir -xzf minizip.tar.gz"
rlRun "pushd $TmpDir"