mirror of
git://code.qt.io/qt/qt5.git
synced 2026-05-02 09:27:54 +08:00
RHEL: Add test to verify installed release package versions
This test will check that release packages are from current release
version i.e. RHEL 10.0 "el10_0" and not from 10.1 "el10_1" or newer.
If newer release packages are found, script will output those packages
and exit with exit code 1 to ensure that release version stays locked.
Task-number: QTQAINFRA-7817
Task-number: QTQAINFRA-7614
Change-Id: I905dd2e72bf5dadc6f3f4b21aa7c09f06204d297
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
(cherry picked from commit d0cda5eb77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
committed by
Qt Cherry-pick Bot
parent
3127f71294
commit
bc345548a7
20
coin/provisioning/common/linux/verify-release-packages.sh
Executable file
20
coin/provisioning/common/linux/verify-release-packages.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2026 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
# This script verifies that all installed packages originate from the current release version and not from newer releases.
|
||||
# The caller provides a regex that matches the allowed release version and excludes packages from newer releases.
|
||||
|
||||
set -ex
|
||||
|
||||
verify_release_packages() {
|
||||
local regex_verify="$1"
|
||||
|
||||
if rpm -qa --queryformat="%{NAME} %{RELEASE}\n" | grep -E " .*$regex_verify" >/dev/null; then
|
||||
echo "Found packages that belong to other RHEL release, aborting"
|
||||
exit 1
|
||||
else
|
||||
echo "All package versions checked OK"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -9,9 +9,13 @@
|
||||
set -ex
|
||||
|
||||
# shellcheck disable=SC2129
|
||||
source "${BASH_SOURCE%/*}/../common/linux/verify-release-packages.sh"
|
||||
|
||||
echo "*********************************************" >> ~/versions.txt
|
||||
echo "***** All installed RPM packages *****" >> ~/versions.txt
|
||||
rpm -q -a | sort >> ~/versions.txt
|
||||
echo "*********************************************" >> ~/versions.txt
|
||||
|
||||
"$(dirname "$0")/../common/linux/version.sh"
|
||||
|
||||
verify_release_packages "10_[1-9]"
|
||||
|
||||
Reference in New Issue
Block a user