mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
e678a7cc9c
Improve the _require_cgroup2 helper to print a more useful message if the cgroup2 fs is not mounted. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
21 lines
493 B
Plaintext
21 lines
493 B
Plaintext
# cgroup2 specific common functions
|
|
|
|
export CGROUP2_PATH="${CGROUP2_PATH:-/sys/fs/cgroup}"
|
|
|
|
_require_cgroup2()
|
|
{
|
|
if [ `findmnt -d backward -n -o FSTYPE -f ${CGROUP2_PATH}` != "cgroup2" ]; then
|
|
_notrun "cgroup2 not mounted on ${CGROUP2_PATH}"
|
|
fi
|
|
|
|
if [ ! -f "${CGROUP2_PATH}/cgroup.subtree_control" ]; then
|
|
_notrun "Test requires cgroup2 enabled"
|
|
fi
|
|
|
|
if [[ ! $(cat ${CGROUP2_PATH}/cgroup.controllers) =~ $1 ]]; then
|
|
_notrun "Cgroup2 doesn't support $1 controller $1"
|
|
fi
|
|
}
|
|
|
|
/bin/true
|