Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expand docker integration tests to run against deeply nested cgroup hierarchies. #143

Open
fearful-symmetry opened this issue Apr 23, 2024 · 0 comments
Assignees
Labels
Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Comments

@fearful-symmetry
Copy link
Contributor

Right now, the docker container tests (container_system_mon_test.go) just test monitoring specific processes by calling sleep 30. #136 has reviled that it's really easy to break path traversal when fetching cgroup metrics. To test for this, we should come up with a test that does something kind of stupid, like create a process and add it to a new cgroup like /sys/fs/cgroup/testgroup/test.slice/test.service/test.scope/othertest.scope/. This will result in an equally dumb entry in /proc/pid/cgroups. If the code can properly handle that, it's probably fine. Making this a separate issue, since running this test across a variety of buildkite images will be a bit of a pain, since we need to support cgroups v1 and v2.

At least with v2 this is fairly easy, just mkdir /sys/fs/cgroup/whatever/path/we/want then move the PID to the cgroup via echo.

@fearful-symmetry fearful-symmetry self-assigned this Apr 23, 2024
@fearful-symmetry fearful-symmetry changed the title expand docker integration tests to run against nested cgroups expand docker integration tests to run against deeply nested cgroup hierarchies. Apr 23, 2024
@ycombinator ycombinator added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

No branches or pull requests

2 participants