2021-11-11 15:05:49 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# checks if the containers default pids-limit (4096) is removed and Iscsi
|
|
|
|
# containers continue to run
|
|
|
|
# exits 1 if fails
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
ISCSI_CONT_IDS=$(sudo podman ps -qa --filter='name=iscsi')
|
|
|
|
CONT_COUNT=$(echo ${ISCSI_CONT_IDS} | wc -w)
|
|
|
|
test ${CONT_COUNT} -eq 2
|
|
|
|
|
2022-05-31 08:34:05 +00:00
|
|
|
for i in ${ISCSI_CONT_IDS}
|
|
|
|
do
|
|
|
|
test $(sudo podman exec ${i} cat /sys/fs/cgroup/pids/pids.max) == max
|
|
|
|
done
|
|
|
|
|
2021-11-11 15:05:49 +00:00
|
|
|
for i in ${ISCSI_CONT_IDS}
|
|
|
|
do
|
2022-04-11 10:45:02 +00:00
|
|
|
sudo podman exec ${i} /bin/sh -c 'for j in {0..20000}; do sleep 300 & done'
|
2021-11-11 15:05:49 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
for i in ${ISCSI_CONT_IDS}
|
|
|
|
do
|
|
|
|
SLEEP_COUNT=$(sudo podman exec ${i} /bin/sh -c 'ps -ef | grep -c sleep')
|
|
|
|
test ${SLEEP_COUNT} -gt 20000
|
|
|
|
done
|
|
|
|
|
|
|
|
echo OK
|