summaryrefslogtreecommitdiff
path: root/test/lib/ansible_test/_internal/cgroup.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/ansible_test/_internal/cgroup.py')
-rw-r--r--test/lib/ansible_test/_internal/cgroup.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/lib/ansible_test/_internal/cgroup.py b/test/lib/ansible_test/_internal/cgroup.py
index 977e359d63..a08513a55a 100644
--- a/test/lib/ansible_test/_internal/cgroup.py
+++ b/test/lib/ansible_test/_internal/cgroup.py
@@ -9,6 +9,7 @@ import re
class CGroupPath:
"""Linux cgroup path constants."""
+
ROOT = '/sys/fs/cgroup'
SYSTEMD = '/sys/fs/cgroup/systemd'
SYSTEMD_RELEASE_AGENT = '/sys/fs/cgroup/systemd/release_agent'
@@ -16,6 +17,7 @@ class CGroupPath:
class MountType:
"""Linux filesystem mount type constants."""
+
TMPFS = 'tmpfs'
CGROUP_V1 = 'cgroup'
CGROUP_V2 = 'cgroup2'
@@ -24,6 +26,7 @@ class MountType:
@dataclasses.dataclass(frozen=True)
class CGroupEntry:
"""A single cgroup entry parsed from '/proc/{pid}/cgroup' in the proc filesystem."""
+
id: int
subsystem: str
path: pathlib.PurePosixPath
@@ -46,7 +49,7 @@ class CGroupEntry:
return cls(
id=int(cid),
subsystem=subsystem.removeprefix('name='),
- path=pathlib.PurePosixPath(path)
+ path=pathlib.PurePosixPath(path),
)
@classmethod
@@ -58,6 +61,7 @@ class CGroupEntry:
@dataclasses.dataclass(frozen=True)
class MountEntry:
"""A single mount info entry parsed from '/proc/{pid}/mountinfo' in the proc filesystem."""
+
mount_id: int
parent_id: int
device_major: int