Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Case ¶
type Case struct {
// Name of the testcase
Name string
// Values of gloal variables before run
Inputs map[string]interface{}
// Expected values of global vars after run
Outputs map[string]interface{}
}
Case defines inputs and expected outputs for a run
func (Case) CheckResults ¶
func (c Case) CheckResults(coord *vm.Coordinator) []error
CheckResults compares the global variables of coord with the expected results for c and returns found errors
func (Case) InitializeVariables ¶
func (c Case) InitializeVariables(coord *vm.Coordinator)
InitializeVariables adds the variables required for the testcase to the variables of the given Coordinator
type Script ¶
type Script struct {
// The absolut path where the test-file was located. Used to retrieve the script files.
TestPath string
// Name of the script to run
Name string
// Maximum number of iterations for the script (0=infinite)
Iterations int
// Maximum number of lines to run from the script (0=infinite)
MaxLines int
// the content of the script. If empty, it is loaded from disk at run-time
Content string
}
Script contains run-options for a script in the test
type Test ¶
type Test struct {
// The path where the test-file was located. Used to retrieve the script files.
Path string
// Scripts to use in this test
Scripts []Script
// Cases for this test
Cases []Case
}
Test defines a test-run
func Parse ¶
Parse parses a yaml file into a Test path is the path from where the test was loaded. This is needed as the scripts are located relatice to the test-file
func (Test) CreateVMs ¶
func (t Test) CreateVMs(coord *vm.Coordinator, errF vm.ErrorHandlerFunc) ([]*vm.VM, []map[string]string, error)
CreateVMs creates and sets up the required vms for this test coord is the coordinato to use with the VMs Run() has been called on the returned VMs, but they are paused until coord.Run() is called The error handler of the VMs is set to errF Also returns variable-name translation-tables for nolol scripts