From 6fb4687609290d5bd9396c2123c927b119bcd675 Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 11 Dec 2023 15:44:30 -0500 Subject: [PATCH] qa/cephadm: fix iscsi pids limit check for centos 9 Centos 9 uses cgroups v2 which has a slightly different file location for the pids.max. This commit updates the test to also check the new location so the test can pass on centos 9 Signed-off-by: Adam King (cherry picked from commit 97efa97c2c72dba32774d0f105ae90462b93ac4e) --- qa/workunits/cephadm/test_iscsi_pids_limit.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qa/workunits/cephadm/test_iscsi_pids_limit.sh b/qa/workunits/cephadm/test_iscsi_pids_limit.sh index bed4cc9e274fb..40bc6085667a3 100755 --- a/qa/workunits/cephadm/test_iscsi_pids_limit.sh +++ b/qa/workunits/cephadm/test_iscsi_pids_limit.sh @@ -12,7 +12,17 @@ test ${CONT_COUNT} -eq 2 for i in ${ISCSI_CONT_IDS} do - test $(sudo podman exec ${i} cat /sys/fs/cgroup/pids/pids.max) == max + # cgroups v1 and v2 have slightly different file locations for the pids.max + # so check both spots + if [ $(sudo podman exec ${i} cat /sys/fs/cgroup/pids/pids.max) ]; then + pid_limit=$(sudo podman exec ${i} cat /sys/fs/cgroup/pids/pids.max) + elif [ $(sudo podman exec ${i} cat /sys/fs/cgroup/pids.max) ]; then + pid_limit=$(sudo podman exec ${i} cat /sys/fs/cgroup/pids.max) + else + echo "could not find pids.max inside container" + exit 1 + fi + test $pid_limit == max done for i in ${ISCSI_CONT_IDS} -- 2.39.5