Documentation ¶
Overview ¶
Package testenv provides functions and data structures for constructing and manipulating a temporary Warewulf environment for use during automated testing.
The testenv package should only be used in tests.
Index ¶
Constants ¶
const Bindir = "bin"
const Datadir = "share"
const Firewallddir = "usr/lib/firewalld/services"
const Localstatedir = "var/local"
const Srvdir = "srv"
const Sysconfdir = "etc"
const Systemddir = "usr/lib/systemd/system"
const Tftpdir = "srv/tftp"
const WWChrootdir = "var/local/warewulf/chroots"
const WWClientdir = "warewulf"
const WWOverlaydir = "var/local/warewulf/overlays"
const WWProvisiondir = "srv/warewulf"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestEnv ¶
type TestEnv struct {
BaseDir string
}
func New ¶
New creates a test environment in a temporary directory and configures Warewulf to use it.
Caller is responsible to delete env.BaseDir by calling env.RemoveAll. Note that this does not restore Warewulf to its previous state.
Asserts no errors occur.
func (*TestEnv) GetPath ¶
GetPath returns the absolute path name for fileName specified relative to the test environment.
func (*TestEnv) MkdirAll ¶
MkdirAll creates dirName and any intermediate directories relative to the test environment.
Asserts no errors occur.
func (*TestEnv) ReadFile ¶
ReadFile returns the content of fileName as converted to a string.
Asserts no errors occur.