test: add container plugin correctness validator and CI - #3940
test: add container plugin correctness validator and CI#3940robbycochran wants to merge 8 commits into
Conversation
Regression reproductions against #3939These are local results against parent 1. A later cgroup entry erases an already found container IDThis reproduces the existing cgroup-iteration review comment on #3939. Start a process with Three cases cover the focused reproduction plus match-before-host and match-between-hosts corpus entries. The reverse-order case is a positive control. The tests exercise the actual capture callback and Collector attribution, not just the string parser. bash /src/collector/test/plugin-replay/run-corpus.sh /build /tmp/cgroup-repro \
--gtest_filter='*MatchingCgroup*:*MatchThenHost*:*MatchBetweenHosts*'Any fix must preserve a successful match across unrelated entries. If the fix stops iteration early, distinguish a successful early stop from a read error: Falco's iteration return value alone does not distinguish them. 2. A child created from its parent's event has no cached identityThis provides an event-only reproduction of the broader uninitialized-field concern already raised on #3939, plus a downstream connection test.
The production bash /src/collector/test/plugin-replay/run-corpus.sh /build /tmp/child-repro \
--gtest_filter='ContainerPluginReplayTest.HostPIDConnectionTracked*'Eight failures exercise the actual parent-created-child path: six parameterized cases, one installed-host-filter case and one downstream network case. Two additional failures insert a valid late-discovered process through Falco's real thread manager; these model Mapping every empty cache value to Scope of these findingsParent-only PID-namespace cases are excluded because their return value is namespace-local and cannot identify the global child entry. The valid parent-only reproductions above use host/hostPID processes. No test writes the plugin's cached ID or mocks callback ordering. These tests establish behavior for supplied events, not how frequently live capture loses an event. They do not establish Sensor delivery or recovery of the reported CPU regression. Build and extension instructions live in the README. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## collector-container-plugin #3940 +/- ##
===========================================================
Coverage 27.33% 27.33%
===========================================================
Files 94 94
Lines 5399 5399
Branches 2538 2538
===========================================================
Hits 1476 1476
Misses 3197 3197
Partials 726 726
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
Description
Stacked on #3939 (
collector-container-plugin). Adds an opt-in correctness validator that feeds synthetic events through the pinned Falco library, loads the production container plugin and checks Collector attribution, filtering and selected network handling. No live kernel capture or Kubernetes cluster is required.This PR changes no production plugin logic and includes no candidate fixes. It remains a draft while the regression cases fail; findings and reproductions link back to the relevant reviews on #3939.
Validation
Local Linux corpus execution completed. Workflow lint and diff whitespace checks pass. CI for the updated ASan/UBSan workflow is pending. The target is opt-in, so normal unit-test builds remain unchanged.
skip-integration-testsavoids the broad VM/Kubernetes matrix for this test-only companion PR; the validator does not need cloud/runtime credentials.