From 26f483704ca28ccfc88b5037f23b13bd6b46c0c5 Mon Sep 17 00:00:00 2001 From: Brian Stinson Date: Nov 13 2020 22:27:47 +0000 Subject: Only check for REDHAT_SUPPORT_PRODUCT and REDHAT_SUPPORT_PRODUCT_VERSION on EL7 We removed these fields in CentOS Linux 8 Signed-off-by: Brian Stinson --- diff --git a/tests/p_centos-release/centos-release_os-release.sh b/tests/p_centos-release/centos-release_os-release.sh index fc20a2f..c26f4bb 100755 --- a/tests/p_centos-release/centos-release_os-release.sh +++ b/tests/p_centos-release/centos-release_os-release.sh @@ -5,7 +5,7 @@ t_Log "Running $0 - /etc/os-release has correct ABRT string for CentOS $centos_v if [ "$centos_ver" -ge 7 ];then if [[ $centos_stream == "no" ]]; then - for string in CENTOS_MANTISBT_PROJECT=\"CentOS-$centos_ver\" CENTOS_MANTISBT_PROJECT_VERSION=\"$centos_ver\" REDHAT_SUPPORT_PRODUCT=\"centos\" REDHAT_SUPPORT_PRODUCT_VERSION=\"$centos_ver\" + for string in CENTOS_MANTISBT_PROJECT=\"CentOS-$centos_ver\" CENTOS_MANTISBT_PROJECT_VERSION=\"$centos_ver\" do grep -q $string /etc/os-release if [ $? -ne "0" ];then @@ -16,6 +16,17 @@ if [ "$centos_ver" -ge 7 ];then else echo "Skipping for CentOS Stream" ; exit 0 fi + + if [ "$centos_ver" -eq 7 ]; then + for string in REDHAT_SUPPORT_PRODUCT=\"centos\" REDHAT_SUPPORT_PRODUCT_VERSION=\"$centos_ver\" + do + grep -q $string /etc/os-release + if [ $? -ne "0" ];then + t_Log "missing string $string in os-release file !" + exit 1 + fi + done + fi else echo "Skipping for CentOS 5 and 6 ..." ; exit 0