Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CacheDirPriv is the directory the cachedir gets set to when running privileged CacheDirPriv = "/tmp/WithPrivilege" // CacheDirUnpriv is the directory the cachedir gets set to when running unprivileged CacheDirUnpriv = "/tmp/WithoutPrivilege" )
Variables ¶
This section is empty.
Functions ¶
func DropPrivilege ¶
DropPrivilege drops privilege. Use this at the start of a test that does not require elevated privileges. A matching call to ResetPrivilege must occur before the test completes (a defer statement is recommended.)
func EnsurePrivilege ¶
EnsurePrivilege ensures elevated privileges are available during a test.
func ResetPrivilege ¶
ResetPrivilege returns effective privilege to the original user.
func WithPrivilege ¶
WithPrivilege wraps the supplied test function with calls to ensure the test is run with elevated privileges.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.