summaryrefslogtreecommitdiffstats
path: root/test/units/util.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/units/util.sh')
-rwxr-xr-xtest/units/util.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/units/util.sh b/test/units/util.sh
index 8a01c5c07a..fee642fa9d 100755
--- a/test/units/util.sh
+++ b/test/units/util.sh
@@ -171,3 +171,14 @@ systemctl_final() {
systemctl "$@"
}
+
+cgroupfs_supports_user_xattrs() {
+ local xattr
+
+ xattr="user.supported_$RANDOM"
+ # shellcheck disable=SC2064
+ trap "setfattr --remove=$xattr /sys/fs/cgroup || :" RETURN
+
+ setfattr --name="$xattr" --value=254 /sys/fs/cgroup
+ [[ "$(getfattr --name="$xattr" --absolute-names --only-values /sys/fs/cgroup)" -eq 254 ]]
+}