Documentation ¶
Overview ¶
Package corehelpers contains testhelpers that don't depend on package vault, and thus can be used within vault (as well as elsewhere.)
Index ¶
- func MakeTestPluginDir(t testing.T) (string, func(t testing.T))
- func NewMockBuiltinRegistry() *mockBuiltinRegistry
- func NoopAuditFactory(records **[][]byte) audit.Factory
- func RetryUntil(t testing.T, timeout time.Duration, f func() error)
- type NoopAudit
- func (n *NoopAudit) GetHash(ctx context.Context, data string) (string, error)
- func (n *NoopAudit) Invalidate(ctx context.Context)
- func (n *NoopAudit) LogRequest(ctx context.Context, in *logical.LogInput) error
- func (n *NoopAudit) LogResponse(ctx context.Context, in *logical.LogInput) error
- func (n *NoopAudit) LogTestMessage(ctx context.Context, in *logical.LogInput, config map[string]string) error
- func (n *NoopAudit) Reload(ctx context.Context) error
- func (n *NoopAudit) Salt(ctx context.Context) (*salt.Salt, error)
- type TestLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeTestPluginDir ¶
func MakeTestPluginDir(t testing.T) (string, func(t testing.T))
MakeTestPluginDir creates a temporary directory suitable for holding plugins. This helper also resolves symlinks to make tests happy on OS X.
func NewMockBuiltinRegistry ¶
func NewMockBuiltinRegistry() *mockBuiltinRegistry
func NoopAuditFactory ¶
func RetryUntil ¶
RetryUntil runs f until it returns a nil result or the timeout is reached. If a nil result hasn't been obtained by timeout, calls t.Fatal.
Types ¶
type NoopAudit ¶
type NoopAudit struct { Config *audit.BackendConfig ReqErr error ReqAuth []*logical.Auth Req []*logical.Request ReqHeaders []map[string][]string ReqNonHMACKeys []string ReqErrs []error RespErr error RespAuth []*logical.Auth RespReq []*logical.Request Resp []*logical.Response RespNonHMACKeys [][]string RespReqNonHMACKeys [][]string RespErrs []error // contains filtered or unexported fields }
func TestNoopAudit ¶
func (*NoopAudit) Invalidate ¶
func (*NoopAudit) LogRequest ¶
func (*NoopAudit) LogResponse ¶
func (*NoopAudit) LogTestMessage ¶
type TestLogger ¶
type TestLogger struct { hclog.InterceptLogger Path string File *os.File // contains filtered or unexported fields }
func NewTestLogger ¶
func NewTestLogger(t testing.T) *TestLogger
func (*TestLogger) StopLogging ¶
func (tl *TestLogger) StopLogging()
Click to show internal directories.
Click to hide internal directories.