Skip to content

V2: Add integration tests for the agent v2 control protocol #1275

@cmacknz

Description

@cmacknz

There is an extensive set of unit tests for the control protocol defined in https://github.com/elastic/elastic-agent/blob/feature-arch-v2/pkg/component/runtime/manager_test.go that use a fake input interacting directly with the agent manager. These provide good coverage for the component and unit state transitions but bypass several layers of the agent (notably the gRPC server) that are involved in running a real input.

To ensure we have no gaps in our test coverage we we should implement integration tests of the v2 control protocol using a fake input binary communicating with the compiled agent binary. We should try to cover the test cases below, which include a basic functional test of an input in normal operation and several important error cases.

  • The input process starts normally, checks in, processes at least one action, acknowledges it, and then shuts down normally.
  • The input process exits unexpectedly. The agent should restart the input and recover it to a healthy state.
  • The agent process restarts unexpectedly. The input process should exit and a new input process instance should start when the agent restarts.
  • The input process attempts to connect to the agent using an invalid certificate or TLS configuration. The agent should refuse the connection and log an obvious error about an unauthenticated connection attempt.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions