Documentation ¶
Index ¶
- func AssetAcmeEBBFilePath() string
- func AssetDefaultConfigLocal() config.Path
- func AssetDefaultConfigOnline() config.Path
- func AssetLocalBundle() string
- func AssetsDir() string
- func LogReadLine(reader *bufio.Reader, timeout time.Duration) (string, error)
- func PortOpen(listenAddress string) bool
- func PrettyPrintObject(obj interface{}) string
- type EngineHarness
- func (h *EngineHarness) Cleanup()
- func (h *EngineHarness) Context() context.Context
- func (h *EngineHarness) CreateClient() *http.Client
- func (h *EngineHarness) CreateGRPCClient() authz2.AuthorizerClient
- func (h *EngineHarness) Req(verb, path, tenantID, body string) (string, int)
- func (h *EngineHarness) Runtime() *runtime.Runtime
- type LogDebugger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssetAcmeEBBFilePath ¶
func AssetAcmeEBBFilePath() string
AssetAcmeEBBFilePath returns the path of the test contoso EDS database file
func AssetDefaultConfigLocal ¶
AssetDefaultConfigLocal returns the path of the default yaml config file that doesn't use an online bundle
func AssetDefaultConfigOnline ¶
AssetDefaultConfigOnline returns the path of the default yaml config file that uses an online bundle
func AssetLocalBundle ¶
func AssetLocalBundle() string
AssetLocalBundle returns the path of the default local bundle directory that contains test policies and data
func LogReadLine ¶
LogReadLine reads and returns a single line from the given file. If a given timeout has passed, an error is returned.
func PrettyPrintObject ¶
func PrettyPrintObject(obj interface{}) string
PrettyPrintObject returns the JSON representation of any object; only useful for debugging
Types ¶
type EngineHarness ¶
type EngineHarness struct { Engine *app.Authorizer LogDebugger *LogDebugger // contains filtered or unexported fields }
EngineHarness wraps an Aserto Runtime Engine so we can set it up easily and monitor its logs
func SetupOffline ¶
func SetupOffline(t *testing.T, configOverrides func(*config.Config)) *EngineHarness
SetupOffline sets up an engine that uses a runtime that loads offline bundles, from the assets directory
func SetupOnline ¶
func SetupOnline(t *testing.T, configOverrides func(*config.Config)) *EngineHarness
SetupOnline sets up an engine that uses a runtime that loads online bundles, from the online aserto registry service
func (*EngineHarness) Cleanup ¶
func (h *EngineHarness) Cleanup()
Cleanup releases all resources the harness uses and shuts down servers and runtimes
func (*EngineHarness) Context ¶ added in v0.0.8
func (h *EngineHarness) Context() context.Context
func (*EngineHarness) CreateClient ¶
func (h *EngineHarness) CreateClient() *http.Client
CreateClient creates a new http client that can talk to the API
func (*EngineHarness) CreateGRPCClient ¶
func (h *EngineHarness) CreateGRPCClient() authz2.AuthorizerClient
func (*EngineHarness) Req ¶
func (h *EngineHarness) Req(verb, path, tenantID, body string) (string, int)
func (*EngineHarness) Runtime ¶
func (h *EngineHarness) Runtime() *runtime.Runtime
type LogDebugger ¶ added in v0.0.7
type LogDebugger struct {
// contains filtered or unexported fields
}
func NewLogDebugger ¶ added in v0.0.7
func NewLogDebugger(t *testing.T, logName string) *LogDebugger
func (*LogDebugger) Contains ¶ added in v0.0.7
func (d *LogDebugger) Contains(message string) bool