mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 22:50:29 +00:00
Merge pull request #22351 from mrc0mmand/TEST-56-cgroupsv1
test: require unified cgroup hierarchy for TEST-56
This commit is contained in:
@@ -6,4 +6,9 @@ TEST_DESCRIPTION="test ExitType=cgroup"
|
||||
# shellcheck source=test/test-functions
|
||||
. "${TEST_BASE_DIR:?}/test-functions"
|
||||
|
||||
if [[ "$(get_cgroup_hierarchy)" != unified ]]; then
|
||||
echo "This test requires unified cgroup hierarchy, skipping..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -2010,6 +2010,24 @@ import_initdir() {
|
||||
export initdir
|
||||
}
|
||||
|
||||
get_cgroup_hierarchy() {
|
||||
case "$(stat -c '%T' -f /sys/fs/cgroup)" in
|
||||
cgroup2fs)
|
||||
echo "unified"
|
||||
;;
|
||||
tmpfs)
|
||||
if [[ -d /sys/fs/cgroup/unified && "$(stat -c '%T' -f /sys/fs/cgroup/unified)" == cgroup2fs ]]; then
|
||||
echo "hybrid"
|
||||
else
|
||||
echo "legacy"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
dfatal "Failed to determine host's cgroup hierarchy"
|
||||
exit 1
|
||||
esac
|
||||
}
|
||||
|
||||
## @brief Converts numeric logging level to the first letter of level name.
|
||||
#
|
||||
# @param lvl Numeric logging level in range from 1 to 6.
|
||||
|
||||
Reference in New Issue
Block a user