test

package
v3.0.0-alpha.1+incompa... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2018 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropPrivilege

func DropPrivilege(t *testing.T)

DropPrivilege drops privilege. Use this at the start of a test that does not require elevated privleges. A matching call to ResetPrivilege must occur before the test completes (a defer statement is recommended.)

func EnsurePrivilege

func EnsurePrivilege(t *testing.T)

EnsurePrivilege ensures elevated privileges are available during a test.

func ResetPrivilege

func ResetPrivilege(t *testing.T)

ResetPrivilege returns effective privilege to the original user.

func WithPrivilege

func WithPrivilege(f func(t *testing.T)) func(t *testing.T)

WithPrivilege wraps the supplied test function with calls to ensure the test is run with elevated privileges.

func WithoutPrivilege

func WithoutPrivilege(f func(t *testing.T)) func(t *testing.T)

WithoutPrivilege wraps the supplied test function with calls to ensure the test is run without elevated privileges.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL