Documentation ¶
Index ¶
- func IsRequiredArg(err error) bool
- type AptInstalled
- type ArgFunc
- type Args
- type Checker
- func AptInstalledFromArgs(args Args) (Checker, error)
- func CompileGccFromArgs(args Args) (Checker, error)
- func FileCheckerFromArgs(args Args) (Checker, error)
- func GemInstalledFromArgs(args Args) (Checker, error)
- func LoadCheck(name string, args Args) (Checker, error)
- func PipInstalledFromArgs(args Args) (Checker, error)
- func RunScriptFromArgs(args Args) (Checker, error)
- func UlimitCheckerFromArgs(args Args) (Checker, error)
- func YumInstalledFromArgs(args Args) (Checker, error)
- type CompileGcc
- type FileChecker
- type GemInstalled
- type PipInstalled
- type RequiredArgError
- type RunScript
- type UlimitChecker
- type YumInstalled
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRequiredArg ¶
IsRequiredArg returns a boolean indicating if the given err is a RequiredArgError
Types ¶
type AptInstalled ¶
type AptInstalled struct {
Package string
}
AptInstalled checks if an apt/deb package is installed on the system
Type:
- apt-installed
Support Platforms:
- Linux
Arguments:
package (required): A string value that represents the deb package
func (AptInstalled) Check ¶
func (ai AptInstalled) Check() error
Check if a deb package is installed on the system
type ArgFunc ¶
ArgFunc is a function which takes the raw yaml test args and converts them into a Checker
type Args ¶
type Args map[string]interface{}
Args is a convenience type to express the "args" key in the test yaml
type Checker ¶
type Checker interface {
Check() error
}
Checker is any struct that performs a system check
func AptInstalledFromArgs ¶
AptInstalledFromArgs will populate the AptInstalled struct with the args given in the tests YAML config
func CompileGccFromArgs ¶
CompileGccFromArgs will populate the CompileGcc with the args given in the tests YAML config
func FileCheckerFromArgs ¶
FromArgs will populate the FileChecker with the args given in the tests YAML config
func GemInstalledFromArgs ¶
FromArgs will populate the GemInstalled struct with the args given in the tests YAML config
func LoadCheck ¶
LoadCheck will return the appropriate Checker based on the test type name. As documented on the various checkers
func PipInstalledFromArgs ¶
FromArgs will populate the PipInstalled struct with the args given in the tests YAML config
func RunScriptFromArgs ¶
RunScriptFromArgs will populate the RunScript with the args given in the tests YAML config
func UlimitCheckerFromArgs ¶
FromArgs will populate the UlimitChecker with the args given in the tests YAML config
func YumInstalledFromArgs ¶
YumInstalledFromArgs will populate the YumInstalled struct with the args given in the tests YAML config
type CompileGcc ¶
type CompileGcc struct { Source string Compiler string Cflags string CflagsCommand string `mapstructure:"cflags_command"` Run bool }
CompileGcc runs gcc compile.
Type:
- compile-gcc
Support Platforms:
- Mac
- Linux
- Windows
Arguments:
source (required): The source code to compile. compiler: path to the compiler. Default is 'gcc' from the $PATH cflags: compiles flags, string, e.g "-lss -lsasl2" cflags_command: command to get clags, e.g. "net-snmp-config --agent-libs" run: If true try running the compiled binary
func (CompileGcc) Check ¶
func (cg CompileGcc) Check() error
Check Runs a gcc command and checks the return code
type FileChecker ¶
FileChecker checks if a file exists or does not
Type:
- file-exists
- file-does-not-exist
Supported Platforms:
- MacOS
- Linux
- Windows
Arguments:
name (required): A string value that points to a path on the filesystem. exists: An optional boolean indicating whether the file should exist or not. For file-does-not-exist type tests this is always set to false, for the normal file-exists type tests this value defaults to true, the file should exist, but can be set to false if desired.
Notes:
For Unix systems no `~` expansion is done. So ~/.bashrc is not a valid path, or at least will not do what you think it will. Additionally, when checking paths on Windows provide windows style paths (i.e. C:\My\File\Path.txt).
type GemInstalled ¶
type GemInstalled struct {
Name string
}
GemInstalled checks if ruby gem is installed on the system
Type:
- gem-installed
Support Platforms:
- Linux
- Windows
Argument:
name (required): A string value that represents the gem name
func (GemInstalled) Check ¶
func (gi GemInstalled) Check() error
Check if a deb package is installed on the system
type PipInstalled ¶
type PipInstalled struct { Python string Module string Version string Relationship string Statement string }
PipInstalled checks if python module is installed on the system And verifies its version.
Type:
- python-module-version
Supported Platforms:
- Linux
- Windows
Argument:
module (required): A string value that represents the python module version: An optional version number to check Leave version blank to just verify module is present statement: Optional python statement, the result will be passed to print() Defaults to module.__version__ relationship: Optional comparison operator for the version provided. Valid values are lt, lte, gt, gte, eq. Defaults to gte (greater than or equal to)
func (PipInstalled) Check ¶
func (pmv PipInstalled) Check() error
Check if a python module is installed on the system and verify version if the Version string is set
type RequiredArgError ¶
RequiredArgError is an error which indicates a required arg was not given
func (RequiredArgError) Error ¶
func (rae RequiredArgError) Error() string
type RunScript ¶
RunScript runs a bash script and optionally checks output.
Type:
- run-bash-script
Support Platforms:
- Mac
- Linux
- Windows
Arguments:
source (required): The source code of the script. output: string to which the output of the script will be compared to determine a successful run. If omitted, only checks that the script exits with returncode 0. interpreter: path to bash. Default is '/bin/bash'.
Notes:
type UlimitChecker ¶
type UlimitChecker struct { Item string Value int IsHard bool GreaterThan bool `mapstructure:"greater_than"` Type string }
UlimitChecker checks if current process resource limits are above a given minimum
Type:
- ulimit
Supported Platforms:
- MacOS
- Linux
Arguments:
- item (required): A string value representing the type of limit to check
- value (required): Numerical value representing the value to be tested
- type: "hard" or "soft" with a default of "hard"
- greater_than: If provided will verify that the limit is greater than or equal to value instead of strictly equal to
Notes:
- "item" strings are from http://www.linux-pam.org/Linux-PAM-html/sag-pam_limits.html
- The following values are supported:
- core
- data
- fsize
- nofile
- stack
- cpu
- as
- "value" can be '-1' to represent that the resource limit should be unlimited
type YumInstalled ¶
type YumInstalled struct {
Packages []string
}
YumInstalled checks if an rpm package is installed on the system
Type:
- yum-installed
Support Platforms:
- Linux
Arguments:
package (required): A string value that represents the rpm package
func (YumInstalled) Check ¶
func (yi YumInstalled) Check() error
Check if an rpm is installed on the system