tracee
tracee copied to clipboard
[FEAT] Container Enrichment tests
Prerequisites
- [ ] This issue is an EPIC issue (add label: EPIC).
- [ ] This issue is an EPIC TASK (add issue to EPIC description).
Select one OR another:
- [x] I'll create a PR to implement this feature (assign to yourself).
- [ ] Someone else should implement this (describe it well).
Feature description
Container Enrichment's code is dependent on a lot of runtime variables and as such can't be easily (and possibly meaningfully) unit tested. Since breaking it is quite easy, there is a need for an integration test.
Additional Information (feature drawings, files, logs, etc)
Possible flow 1 (integration): Perquisite: add docker to the build-dependencies action Add the following integration test
- Create and run a tracee object tracing container_create events with enrichment enabled
- With the docker golang SDK loop container creations
- Compare number of loops with number of events (possibly with margin of error?)
Possible flow 2 (e2e)
- Build a tracee container
- Run tracee container with enrichment enabled tracing container_create
- Loop
docker run --rm alpinecommands - Compare events to number of loop runs
this integration test should consider containerd as well and possibly crio. it's fine to start with testing docker but please consider this as well in the design of the test