From 9cc8cf166ab33b2f9a06901351c7111476f25d43 Mon Sep 17 00:00:00 2001 From: Charlie Olmstead Date: Wed, 12 Apr 2023 08:45:18 -0600 Subject: [PATCH] LU-16672 tests: auster node.yml labels Alma and Rocky as CentOS release() assumes a node with /etc/centos-release is CentOS. This patch removes that assumption and uses the name in the centos-release file. Corrected the os-release code to strip off the last word if present. Lustre-change: https://review.whamcloud.com/50442 Lustre-commit: TBD (from 3d6c37836b4bb7b1e6ea90bb7aacf4715e44c667) Test-Parameters: trivial Other-Id: Ia5acbce3351ca23f4d9265d1aaf8d952a2c8b502 Change-Id: Id16ec38d3530c4ece4fbdbb56c23af24d4c55b99 Signed-off-by: Charlie Olmstead Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50617 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/tests/yaml.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lustre/tests/yaml.sh b/lustre/tests/yaml.sh index d30183f..fc0bccf 100644 --- a/lustre/tests/yaml.sh +++ b/lustre/tests/yaml.sh @@ -78,13 +78,14 @@ release() { rhel_pat=".*release \([[:digit:]]\+\.[[:digit:]]\+\).*" if [ -r /etc/centos-release ]; then + name=$(sed -n -e "s/^\([A-Za-z]\+\).*/\1/p" /etc/centos-release) version=$(sed -n -e "s/${rhel_pat}/\1/p" /etc/centos-release) - dist="CentOS ${version}" + dist="${name} ${version}" elif [ -r /etc/redhat-release ]; then version=$(sed -n -e "s/${rhel_pat}/\1/p" /etc/redhat-release) dist="RHEL ${version}" elif [ -r /etc/os-release ]; then - name=$(sed -n -e 's/"//g' -e 's/^NAME=//p' /etc/os-release) + name=$(sed -n -e 's/"//g' -e 's/ [A-Za-z]*$//' -e 's/^NAME=//p' /etc/os-release) version=$(sed -n -e 's/"//g' -e 's/^VERSION_ID=//p' \ /etc/os-release) dist="${name} ${version}" -- 1.8.3.1