Policy testing
Policy tests allow you to verify that an integration policy will be accepted by Fleet, and will create an expected Elastic Agent policy.
An Elastic Agent policy is used by Fleet to define the data that will be collected by the Elastic Agent. Within the Elastic Agent policies is a set of integration policies, which define how each integration's input will be configured.
Policy tests allow you to define the expected integration policy, and test that the generated policy is correct.
For more details, see HOWTO: Writing policy tests for a package
Policy tests require the Elastic Stack to be running. Start the Elastic stack with elastic-package, if it's not already running. Then simply navigate to the package’s root folder (or any sub-folder under it) and run the following command.
# Start the stack (if not already running)
elastic-package stack up -d --services kibana,elasticsearch
# Run policy tests
elastic-package test policy