dax/dm: disable testing on devices that don't support dax
[xfstests-dev.git] / common / cgroup2
1 # cgroup2 specific common functions
2
3 export CGROUP2_PATH="${CGROUP2_PATH:-/sys/fs/cgroup}"
4
5 _require_cgroup2()
6 {
7         if [ `findmnt -d backward -n -o FSTYPE -f ${CGROUP2_PATH}` != "cgroup2" ]; then
8                 _notrun "cgroup2 not mounted on ${CGROUP2_PATH}"
9         fi
10
11         if [ ! -f "${CGROUP2_PATH}/cgroup.subtree_control" ]; then
12                 _notrun "Test requires cgroup2 enabled"
13         fi
14
15         if [[ ! $(cat ${CGROUP2_PATH}/cgroup.controllers) =~ $1 ]]; then
16                 _notrun "Cgroup2 doesn't support $1 controller $1"
17         fi
18 }
19
20 /bin/true