# README
Sentinel Plugin Test Framework
This folder contains a library for testing plugins that are written in Go.
This works by building the plugin binary dynamically during go test
and
executing your test policy. The policy must pass. If the policy fails, the
failure trace is logged and shown. Execution is done via the publicly available
sentinel
binary.
Example
You can see an example in the plugin_test.go
file in this folder. This
test actually runs as part of the unit tests to verify the behavior.
# Packages
Package testplugin contains a test plugin that the testing package uses for unit tests.
# Functions
Clean cleans any temporary files created.
LoadTestPluginCase is used to load a TestPluginCase from a Sentinel policy file.
PluginPath attempts to infer the plugin path based on the GOPATH environment variable and the directory.
TestPlugin tests that a sdk.Plugin implementation works as expected.
TestPluginDir iterates over files in a directory, calls LoadTestPluginCase on each file suffixed with ".sentinel", and executes all of the plugin tests.
# Structs
TestPluginCase is a single test case for configuring TestPlugin.