]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephadm: fix iscsi pids limit check for centos 9
authorAdam King <adking@redhat.com>
Mon, 11 Dec 2023 20:44:30 +0000 (15:44 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 8 Jul 2024 15:29:07 +0000 (17:29 +0200)
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 <adking@redhat.com>
(cherry picked from commit 97efa97c2c72dba32774d0f105ae90462b93ac4e)
(cherry picked from commit e0e50da949147b41c685b90a884517fa6e187406)

qa/workunits/cephadm/test_iscsi_pids_limit.sh

index bed4cc9e274fb88ea6967f152286a707dcefa3a9..40bc6085667a36a1740d763b62203299331c5c88 100755 (executable)
@@ -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}