test

package
v4.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: BSD-3-Clause Imports: 9 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 privileges. 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.

Directories

Path Synopsis
oci

Jump to

Keyboard shortcuts

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