Documentation
¶
Index ¶
- func IsRequiredArg(err error) bool
- type ArgFunc
- type Args
- type Checker
- func CompileGccFromArgs(args Args) (Checker, error)
- func CompileVisualStudioFromArgs(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 RegistryKeyCheckerFromArgs(args Args) (Checker, error)
- func RunScriptFromArgs(args Args) (Checker, error)
- type CompileGcc
- type CompileVisualStudio
- type FileChecker
- type GemInstalled
- type PipInstalled
- type RegistryKeyChecker
- type RequiredArgError
- type RunScript
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 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 CompileGccFromArgs ¶
CompileGccFromArgs will populate the CompileGcc with the args given in the tests YAML config
func CompileVisualStudioFromArgs ¶
CompileVisualStudioFromArgs will populate the CompileVisualStudio 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 RegistryKeyCheckerFromArgs ¶
FromArgs implements Argable for RegistryKeyChecker
func RunScriptFromArgs ¶
RunScriptFromArgs will populate the RunScript 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 CompileVisualStudio ¶
type CompileVisualStudio struct { Source string Cflags string Version float64 Extension string Compiler string Run bool }
CompileVisualStudio runs VisualStudio compile.
Type:
- compile-visual-studio
Support Platforms:
- Windows
Arguments:
source (required): The source code to compile. cflags: A string that will be parsed using shlex and passed as arguments to cl.exe version: Visual studio version to use. Default is the latest version installed on the system extension: The file extension to use for the generated temporary file. Default is "cpp" run: If true try running the compiled binary compiler: A string path to the compiler to use. This is a template that gets one variable: '{{ .VisualStudioPath }}' which is the path to the Visual Studio installation we are using, ending with the filepath separator '\'. For example for VS2015 it would be: C:\Program Files (x86)\Microsoft Visual Studio 14.0\ This allows you to specify compilers other than VC\bin\cl.exe to use. For example if you wanted to compile C#. You can pass a hardcoded string here without the template variable if you wish to specify a full path and bypass our VisualStudio installation detection logic. This defaults to "{{ .VisualStudioPath }}VC\\bin\\cl.exe"
Notes:
For the version argument you can either specify the year (2015) or the actual version number as recognized by Visual Studio registry entries (14.0) and this check will do the math to figure out what you want.
func (CompileVisualStudio) Check ¶
func (cvs CompileVisualStudio) Check() error
Check compiles, and optionally runs, code using VisualStudio
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 ¶
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 RegistryKeyChecker ¶
type RegistryKeyChecker struct { Root string Path string Key string ValueType string `mapstructure:"value_type"` Value interface{} }
RegistryKeyChecker verifies the value of a given registry key is correct or exists.
func (RegistryKeyChecker) Check ¶
func (rkc RegistryKeyChecker) Check() error
Check implements Checker for RegistryKeyChecker
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: