Documentation
¶
Index ¶
- Variables
- func NewScope(defs ...any) dscope.Scope
- func RandBetween[T number, T2 number](target *T, lower T2, upper T2)
- func RandBool[T ~bool](target *T)
- func RegisterAction(value any)
- type Action
- type ActionMaker
- type AddReport
- type AddScriptDef
- type CleanTempDir
- type Cleanup
- type ClearTestDataFile
- type CloseNode
- type ConfigItems
- type CreatedAt
- type Debug9P
- type Def
- func (_ Def) ClearTestDataFile(getFilePath TestDataFilePath, id uuid.UUID) ClearTestDataFile
- func (_ Def) CloseNode() CloseNode
- func (_ Def) CreatedAt() CreatedAt
- func (_ Def) CreatedAtConfigItem(t CreatedAt) ConfigItems
- func (_ Def) Debug9P() Debug9P
- func (_ Def) DoAction(do Do, nextThreadID NextThreadID) (doAction doAction)
- func (_ Def) DumbCleanup() Cleanup
- func (_ Def) Execute(nodes Nodes, numNodes NumNodes, mainAction MainAction, ops Operators, ...) Execute
- func (_ Def) ExecuteFuncs() (nodes Nodes, do Do)
- func (_ Def) ExecuteTimeout() ExecuteTimeout
- func (_ Def) FilterPacket() FilterPacket
- func (_ Def) GetPort(portRange PortRange, infos PortInfos) (get GetPort, getStr GetPortStr)
- func (_ Def) GlobTestDataFiles(testDataDir TestDataDir) GlobTestDataFiles
- func (_ Def) IsTesting() IsTesting
- func (_ Def) LoadScript(builtins ScriptBuiltins, get GetScriptDefs) LoadScript
- func (_ Def) Logger(testDataFilePath TestDataFilePath, id UUID, isTesting IsTesting) Logger
- func (_ Def) MainAction() (m MainAction)
- func (_ Def) MainActionConfigItem(action MainAction) ConfigItems
- func (_ Def) NamedConfigItems(items ConfigItems) (nameds []NamedConfigItem, m map[string]NamedConfigItem)
- func (_ Def) NetworkHost(id uuid.UUID, model NetworkModel, wt RootWaitTree, filter FilterPacket) (get GetNetworkHost, cleanup Cleanup)
- func (_ Def) NetworkModel() NetworkModel
- func (_ Def) NewPorcupineChecker(genVisual PorcupineAlwaysGenerateVisualization, write WriteTestDataFile, ...) NewPorcupineChecker
- func (_ Def) NextThreadID() NextThreadID
- func (_ Def) NodeConfigSources() (_ NodeConfigSources)
- func (_ Def) NodeConfigSourcesItem(srcs NodeConfigSources) ConfigItems
- func (_ Def) NumNodes() NumNodes
- func (_ Def) NumNodesConfigItem(num NumNodes) ConfigItems
- func (_ Def) Operators() Operators
- func (_ Def) PorcupineAlwaysGenerateVisualization() PorcupineAlwaysGenerateVisualization
- func (_ Def) PortInfos() PortInfos
- func (_ Def) PortRange() PortRange
- func (_ Def) ProcessReports(clearFile ClearTestDataFile, getReports GetAllReports, ...) processReports
- func (_ Def) ReadConfig(nameds map[string]NamedConfigItem) ReadConfig
- func (_ Def) Report() (add AddReport, getAll GetAllReports, get GetReports)
- func (_ Def) RootWaitTree() (wt RootWaitTree, cleanup Cleanup)
- func (_ Def) ScriptBuiltins(add AddScriptDef) ScriptBuiltins
- func (_ Def) ScriptDefs() (add AddScriptDef, get GetScriptDefs)
- func (_ Def) Setup9P(getHost GetNetworkHost, getPort GetPortStr, wt RootWaitTree, debug Debug9P) Setup9P
- func (_ Def) SetupFuse(logger Logger) SetupFuse
- func (_ Def) TempDir(logger Logger, model TempDirModel, setupFuse SetupFuse, setup9P Setup9P) (get GetTempDir, cleanup Cleanup, cleanDir CleanTempDir)
- func (_ Def) TempDirModel() TempDirModel
- func (_ Def) TestDataDir() (dir TestDataDir)
- func (_ Def) TestDataFilePath(dir TestDataDir, id uuid.UUID) TestDataFilePath
- func (_ Def) TestDataFilePathToUUID() TestDataFilePathToUUID
- func (_ Def) UUID() UUID
- func (_ Def) UUIDConfigItem(id uuid.UUID) ConfigItems
- func (_ Def) WriteConfig(nameds []NamedConfigItem) WriteConfig
- func (_ Def) WriteTestDataFile(dir TestDataDir, getFilePath TestDataFilePath, id uuid.UUID) WriteTestDataFile
- type Do
- type Execute
- type ExecuteTimeout
- type FilterPacket
- type GetAllReports
- type GetNetworkHost
- type GetPort
- type GetPortStr
- type GetReports
- type GetScriptDefs
- type GetTempDir
- type GlobTestDataFiles
- type IsTesting
- type LoadScript
- type Logger
- type MainAction
- type NamedConfigItem
- type NetworkModel
- type NewPorcupineChecker
- type NextThreadID
- type Node
- type NodeConfigSource
- type NodeConfigSources
- type NodeID
- type Nodes
- type NumNodes
- type Operator
- type Operators
- type ParallelAction
- type PorcupineAlwaysGenerateVisualization
- type PortInfo
- type PortInfos
- type PortRange
- type ReadConfig
- type Report
- type RootWaitTree
- type ScriptBuiltins
- type SequentialAction
- type Setup9P
- type SetupFuse
- type TempDirModel
- type TestDataDir
- type TestDataFilePath
- type TestDataFilePathToUUID
- type UUID
- type WriteConfig
- type WriteTestDataFile
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrActionNotRegistered = errors.New("action not registered")
View Source
var KVResultNotFound = kvResultNotFound{}
View Source
var KVResultTimeout = kvResultTimeout{}
View Source
var PorcupineKVModel = porcupine.Model{ Partition: porcupine.NoPartition, PartitionEvent: porcupine.NoPartitionEvent, Init: func() any { return make(map[any]any) }, Step: func(state any, input any, output any) (ok bool, newState any) { m := state.(map[any]any) arg := input.([2]any) op := arg[0].(string) key := arg[1] switch op { case "get": if output == KVResultNotFound { _, ok := m[key] return !ok, state } else if output == KVResultTimeout { return true, state } return m[key] == output, state case "set": if output == KVResultTimeout { return true, state } newMap := make(map[any]any, len(m)+1) for k, v := range m { newMap[k] = v } newMap[key] = output return true, newMap } panic("impossible") }, Equal: func(state1, state2 any) bool { m1 := state1.(map[any]any) m2 := state2.(map[any]any) for k, v := range m1 { if v != m2[k] { return false } } for k, v := range m2 { if v != m1[k] { return false } } return true }, }
Functions ¶
func RandBetween ¶
func RandBetween[T number, T2 number](target *T, lower T2, upper T2)
func RegisterAction ¶
func RegisterAction(value any)
Types ¶
type Action ¶
type Action interface { }
func RandomActionTree ¶
func RandomActionTree( makers []ActionMaker, numActions int, ) Action
type ActionMaker ¶
type ActionMaker = func() Action
type AddScriptDef ¶
type AddScriptDef func(any)
type CleanTempDir ¶
type ClearTestDataFile ¶
type ConfigItems ¶
type ConfigItems []any
type Def ¶
type Def struct{}
func (Def) ClearTestDataFile ¶
func (_ Def) ClearTestDataFile( getFilePath TestDataFilePath, id uuid.UUID, ) ClearTestDataFile
func (Def) CreatedAtConfigItem ¶
func (_ Def) CreatedAtConfigItem( t CreatedAt, ) ConfigItems
func (Def) DoAction ¶
func (_ Def) DoAction( do Do, nextThreadID NextThreadID, ) ( doAction doAction, )
func (Def) DumbCleanup ¶
func (Def) Execute ¶
func (_ Def) Execute( nodes Nodes, numNodes NumNodes, mainAction MainAction, ops Operators, doAction doAction, scope dscope.Scope, nextThreadID NextThreadID, closeNode CloseNode, processReports processReports, logger Logger, timeout ExecuteTimeout, ) Execute
func (Def) ExecuteFuncs ¶
func (Def) ExecuteTimeout ¶
func (_ Def) ExecuteTimeout() ExecuteTimeout
func (Def) FilterPacket ¶
func (_ Def) FilterPacket() FilterPacket
func (Def) GetPort ¶
func (_ Def) GetPort( portRange PortRange, infos PortInfos, ) ( get GetPort, getStr GetPortStr, )
func (Def) GlobTestDataFiles ¶
func (_ Def) GlobTestDataFiles( testDataDir TestDataDir, ) GlobTestDataFiles
func (Def) LoadScript ¶
func (_ Def) LoadScript( builtins ScriptBuiltins, get GetScriptDefs, ) LoadScript
func (Def) Logger ¶
func (_ Def) Logger( testDataFilePath TestDataFilePath, id UUID, isTesting IsTesting, ) Logger
func (Def) MainAction ¶
func (_ Def) MainAction() (m MainAction)
func (Def) MainActionConfigItem ¶
func (_ Def) MainActionConfigItem( action MainAction, ) ConfigItems
func (Def) NamedConfigItems ¶
func (_ Def) NamedConfigItems( items ConfigItems, ) ( nameds []NamedConfigItem, m map[string]NamedConfigItem, )
func (Def) NetworkHost ¶
func (_ Def) NetworkHost( id uuid.UUID, model NetworkModel, wt RootWaitTree, filter FilterPacket, ) ( get GetNetworkHost, cleanup Cleanup, )
func (Def) NetworkModel ¶
func (_ Def) NetworkModel() NetworkModel
func (Def) NewPorcupineChecker ¶
func (_ Def) NewPorcupineChecker( genVisual PorcupineAlwaysGenerateVisualization, write WriteTestDataFile, clear ClearTestDataFile, report AddReport, ) NewPorcupineChecker
func (Def) NextThreadID ¶
func (_ Def) NextThreadID() NextThreadID
func (Def) NodeConfigSources ¶
func (_ Def) NodeConfigSources() (_ NodeConfigSources)
func (Def) NodeConfigSourcesItem ¶
func (_ Def) NodeConfigSourcesItem( srcs NodeConfigSources, ) ConfigItems
func (Def) NumNodesConfigItem ¶
func (_ Def) NumNodesConfigItem( num NumNodes, ) ConfigItems
func (Def) PorcupineAlwaysGenerateVisualization ¶
func (_ Def) PorcupineAlwaysGenerateVisualization() PorcupineAlwaysGenerateVisualization
func (Def) ProcessReports ¶
func (_ Def) ProcessReports( clearFile ClearTestDataFile, getReports GetAllReports, writeFile WriteTestDataFile, testDataDir TestDataDir, id uuid.UUID, testDataFilePath TestDataFilePath, logger Logger, ) processReports
func (Def) ReadConfig ¶
func (_ Def) ReadConfig( nameds map[string]NamedConfigItem, ) ReadConfig
func (Def) Report ¶
func (_ Def) Report() ( add AddReport, getAll GetAllReports, get GetReports, )
func (Def) RootWaitTree ¶
func (_ Def) RootWaitTree() ( wt RootWaitTree, cleanup Cleanup, )
func (Def) ScriptBuiltins ¶
func (_ Def) ScriptBuiltins( add AddScriptDef, ) ScriptBuiltins
func (Def) ScriptDefs ¶
func (_ Def) ScriptDefs() ( add AddScriptDef, get GetScriptDefs, )
func (Def) Setup9P ¶
func (_ Def) Setup9P( getHost GetNetworkHost, getPort GetPortStr, wt RootWaitTree, debug Debug9P, ) Setup9P
func (Def) TempDir ¶
func (_ Def) TempDir( logger Logger, model TempDirModel, setupFuse SetupFuse, setup9P Setup9P, ) ( get GetTempDir, cleanup Cleanup, cleanDir CleanTempDir, )
func (Def) TempDirModel ¶
func (_ Def) TempDirModel() TempDirModel
func (Def) TestDataDir ¶
func (_ Def) TestDataDir() (dir TestDataDir)
func (Def) TestDataFilePath ¶
func (_ Def) TestDataFilePath( dir TestDataDir, id uuid.UUID, ) TestDataFilePath
func (Def) TestDataFilePathToUUID ¶
func (_ Def) TestDataFilePathToUUID() TestDataFilePathToUUID
func (Def) UUIDConfigItem ¶
func (_ Def) UUIDConfigItem( id uuid.UUID, ) ConfigItems
func (Def) WriteConfig ¶
func (_ Def) WriteConfig( nameds []NamedConfigItem, ) WriteConfig
func (Def) WriteTestDataFile ¶
func (_ Def) WriteTestDataFile( dir TestDataDir, getFilePath TestDataFilePath, id uuid.UUID, ) WriteTestDataFile
type ExecuteTimeout ¶
type FilterPacket ¶
type GetAllReports ¶
type GetAllReports func() []Report
type GetNetworkHost ¶
type GetNetworkHost func() string
type GetPortStr ¶
type GetReports ¶
type GetScriptDefs ¶
type GetScriptDefs func() []any
type GetTempDir ¶
type GetTempDir func() string
type GlobTestDataFiles ¶
type LoadScript ¶
type MainAction ¶
type MainAction struct {
Action Action
}
func (*MainAction) UnmarshalXML ¶
func (t *MainAction) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
type NamedConfigItem ¶
type NetworkModel ¶
type NetworkModel string
type NewPorcupineChecker ¶
type NextThreadID ¶
type NextThreadID func() int64
type NodeConfigSource ¶
type NodeConfigSource struct {
String string `xml:",cdata"`
}
type NodeConfigSources ¶
type NodeConfigSources struct {
Sources []NodeConfigSource `xml:"Source"`
}
type Operator ¶
type Operator struct { Finally func() BeforeDo func() AfterDo func() BeforeClose func() AfterClose func() }
type ParallelAction ¶
type ParallelAction struct {
Actions []Action
}
func Par ¶
func Par(actions ...Action) ParallelAction
func (ParallelAction) MarshalXML ¶
func (s ParallelAction) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)
func (*ParallelAction) UnmarshalXML ¶
func (s *ParallelAction) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
type PorcupineAlwaysGenerateVisualization ¶
type PorcupineAlwaysGenerateVisualization bool
type RootWaitTree ¶
type ScriptBuiltins ¶
type ScriptBuiltins starlark.StringDict
func (ScriptBuiltins) IsReducer ¶
func (_ ScriptBuiltins) IsReducer()
type SequentialAction ¶
type SequentialAction struct {
Actions []Action
}
func RandSeq ¶
func RandSeq(makers []ActionMaker, num int) SequentialAction
func Seq ¶
func Seq(actions ...Action) SequentialAction
func (SequentialAction) MarshalXML ¶
func (s SequentialAction) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)
func (*SequentialAction) UnmarshalXML ¶
func (s *SequentialAction) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
type TempDirModel ¶
type TempDirModel string
type TestDataDir ¶
type TestDataDir string
type TestDataFilePath ¶
type TestDataFilePathToUUID ¶
type WriteConfig ¶
Source Files
¶
- 9p.go
- action.go
- action_codec.go
- action_parallel.go
- action_rand_tree.go
- action_sequential.go
- alias.go
- builtins.go
- cleanup.go
- config.go
- config_codec.go
- debug.go
- execute.go
- fuse.go
- fuse_setup.go
- logger.go
- net.go
- net_filter.go
- net_port.go
- node.go
- node_config_source.go
- operator.go
- operator_porcupine.go
- os_linux.go
- rand.go
- report.go
- scope.go
- script.go
- temp_dir.go
- testdata.go
- util_random.go
- wait_tree.go
Click to show internal directories.
Click to hide internal directories.